On Wed, Apr 29, 2009 at 5:47 PM, <[email protected]> wrote:

> Hi Deepayan,
>
> I had a partial victory with xyplot.
>
> Changing chromosome == "chr19" to chromosome == "chr19.fa" indeed fixed the
> problem.
>
> I can plot to my screen now doing
>
> xyplot(log(count) ~ nread | sample,
>        as(gdapply(E1, islandReadSummary), "data.frame"),
>        subset = (chromosome == "chr19.fa" & nread <= 40),
>        layout = c(1, 4), pch = 16, type = c("p", "g"))
>
> Its a very nice 4-paneled figure for control 1, control 2, treatment 1 and
> treatment 2.
>
> The not so successful story is when I try to plot to an eps file. I do
>
> postscript(file = fileOutputGraph,
>            horizontal=FALSE,
>            onefile=FALSE, # needed for EPS output. It is counterintuitive.
>            paper="letter",
>            #width=8.5, height=8.5/3,
>            width=6, height=8.5,
>            colormodel="rgb")
>
> xyplot(log(count) ~ nread | sample,
>        as(gdapply(E1, islandReadSummary), "data.frame"),
>        subset = (chromosome == "chr19.fa" & nread <= 40),
>        layout = c(1, 4), pch = 16, type = c("p", "g"))
>
> but the eps that is produced has a beheaded top panel and the figure
> becomes only black and white.
>
> I can't report any error messages because there are none. I tried to plot
> to png or pdf but neither worked, no error messages from R. Only output to
> eps worked to some extent.
>
> Can you give some pointer to solve it?
>


Hi, Ivan.  You will need to print the xyplot().  So, surrounding the entire
xyplot() command with print() will probably do what you want.  And, of
course, be sure that you are calling dev.off() after writing the
png/pdf/eps.

Sean



>
>
>
> ----- Original Message ----
> From: "[email protected]" <[email protected]>
> To: Deepayan Sarkar <[email protected]>
> Cc: [email protected]
> Sent: Wednesday, 29 April, 2009 0:23:05
> Subject: Re: [Bioc-sig-seq] Error while trying to xyplot. Perhaps a lattice
> problem.
>
>
> Hello Deepayan,
>
> Thanks for giving me a hand with xyplot.
>
> The output of str(nread.islands) is
>
> > nread.islands <- as(gdapply(E1, islandReadSummary), "data.frame")
> > str(nread.islands)
> 'data.frame':    4886 obs. of  4 variables:
> $ nread     : num  1 2 3 4 5 6 7 8 9 10 ...
> $ count     : num  80871 12722 2548 666 176 ...
> $ chromosome: Factor w/ 21 levels "chr1.fa","chr10.fa",..: 1 1 1 1 1 1 1 1
> 1 1 ...
> $ sample    : Factor w/ 4 levels "C1","C2","T1",..: 1 1 1 1 1 1 1 1 1 1 ...
> >
>
> Aha! I see what you mean. Instead of using
>
> chromosome == "chr19"
>
> I should be using
>
> chromosome == "chr19.fa"
>
> Now I am logged in remotely to my work computer. Bad connection. I'll try
> it tomorrow and let you know if it works.
>
> Thank you.
>
> Ivan
>
>
>
>
>
> ----- Original Message ----
> From: Deepayan Sarkar <[email protected]>
> To: [email protected]
> Cc: [email protected]
> Sent: Tuesday, 28 April, 2009 19:01:16
> Subject: Re: [Bioc-sig-seq] Error while trying to xyplot. Perhaps a lattice
>  problem.
>
> On Tue, Apr 28, 2009 at 9:58 AM,  <[email protected]> wrote:
> >
> > Hello everybody,
> >
> > I am working with the yet unreleased package chipseq.
> >
> > There is a very nice xyplot that I am trying to reproduce from the
> >
> >
> http://www.bioconductor.org/workshops/2009/SeattleJan09/ChIP-seq/ChipSeqWorkflow.pdf
> >
> > However, R complains saying
> >
> > "Error in limits..and.aspect(prepanel.default.xyplot, prepanel =
> prepanel,  :
> > need at least one panel"
> >
> > What am I doing? This
> >
> >> class(E1)
> > [1] "GenomeDataList"
> > attr(,"package")
> > [1] "BSgenome"
> >> names(E1)
> > [1] "C1" "C2" "T1" "T2"
> >> islandReadSummary <- function(x)
> > + {
> > + g <- extendReads(x, seqLen = 200)
> > + s <- slice(coverage(g, 1, max(end(g))), lower = 1)
> > + tab <- table(viewSums(s) / 200)
> > + ans <- data.frame(nread = as.numeric(names(tab)), count =
> as.numeric(tab))
> > + ans
> > + }
> >> nread.islands <- as(gdApply(E1, islandReadSummary), "data.frame")
> > There were 50 or more warnings (use warnings() to see the first 50)
>
> Could you share the output of
>
> str(nread.islands)
>
> ?
>
> >> xyplot(log(count) ~ nread | sample,
> > +        nread.islands,
> > +        subset = (chromosome == "chr19" & nread <= 40),
> > +        layout = c(1, 4), pch = 16, type = c("p", "g"))
> > Error in limits..and.aspect(prepanel.default.xyplot, prepanel = prepanel,
>  :
> >  need at least one panel
> >>
> >
> > Can anybody shed some light?
> >
> > Clarification: the warning "There were 50 or more warnings (use
> warnings() to see the first 50)" comes from IRanges. chipseq is using the
> slightly older start/end convention rather than the newer shift/step
> convention.
> >
>
> Actually, that's happening inside your 'islandReadSummary' function, where
>
> s <- slice(coverage(g, 1, max(end(g))), lower = 1)
>
> should now be
>
> s <- slice(coverage(g), lower = 1)
>
> -Deepayan
>
> > Thank you,
> >
> > Ivan
> >
> >
> >
> >
> > _______________________________________________
> > Bioc-sig-sequencing mailing list
> > [email protected]
> > https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
> >
>
>
>
>
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> [email protected]
> https://stat.ethz..ch/mailman/listinfo/bioc-sig-sequencing
>
>
>
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>
>

        [[alternative HTML version deleted]]

_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to