11 Jan 2013 01:41
Re: ggbio : misplaced tracks in a test case
On Thu, Jan 10, 2013 at 2:13 PM, Tengfei Yin <yintengfei@...> wrote: > Hi Abhi, > > You raised an important point that users need to pay attention to when they > construct circular view: > > 1. All the data you added on the same circular view, have to have exactly > the same seqlevels and seqlengths. > 2. They have to have lengths information for each chromosome, otherwise, > length is estimated from the data, and it's not accurate in most cases. > > it's easy to check when you print the data > hg19ideo > test_gr > > So in your case, your test_gr's seqlevels is just 1 with seqlengths NA, > which is not consistency with hg19ideo. So you have to do something similar > to this > > seqlevels(test_gr) <- seqlevels(hg19Ideo) > seqlengths(test_gr) <- seqlengths(hg19Ideo) > > probably easier to do this all at once with seqinfo<-. > or do it when you construct the test_gr object. > > this will solve the misalignment problem. > > HTH > > Tengfei > > On Thu, Jan 10, 2013 at 4:01 PM, Abhishek Pratap <apratap@...> wrote: > > > I am trying to run a test case in ggbio(based on example in a vignette) > and > > seem to be running into an odd case where a feature is misplaced on the > > graph. working Example below > > > > In the plot I see the variation(rectangle) is misplaced. I see it on chr3 > > whereas it should be on chr1. plot also attached > > > > > > library(ggbio) > > data(hg19Ideogram, package = "biovizBase") > > ## subset_chr > > chr.sub <- paste("chr", 1:3, sep = "") > > new.names <- as.character(1:3) > > names(new.names) <- paste("chr",new.names,sep="") > > hg19Ideo <- hg19Ideogram > > hg19Ideo <- keepSeqlevels(hg19Ideogram,chr.sub) > > hg19Ideo <- renameSeqlevels(hg19Ideo,new.names) > > > > > > p <- ggplot() + > > layout_circle(hg19Ideo,geom="ideo",fill="gray70",radius=30,trackWidth=4) > > #adding the scale track > > p <- p + > > > > > layout_circle(hg19Ideo,geom="scale",fill="gray70",size=4,radius=35,trackWidth=2) > > #adding the text track > > p <- p + > > > > > layout_circle(hg19Ideo,geom="text",aes(label=seqnames),vjust=0,radius=39,trackWidth=7,size=6) > > > > > > #testing : placing a rect for a dummy variation > > test_gr <- GRanges('1',IRanges(start=3000,width=1)) > > > > #adding the mutant track > > p <- p + > > > layout_circle(test_gr,geom="rect",color="steelblue",radius=23,trackWidth=6) > > p > > > > > > > > > > Thanks! > > -Abhi > > > > > > > > > > > sessionInfo()R version 2.15.2 (2012-10-26) > > Platform: x86_64-pc-linux-gnu (64-bit) > > > > locale: > > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > > LC_TIME=en_US.UTF-8 > > [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 > > LC_MESSAGES=en_US.UTF-8 > > [7] LC_PAPER=C LC_NAME=C > > LC_ADDRESS=C > > [10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 > > LC_IDENTIFICATION=C > > > > attached base packages: > > [1] stats graphics grDevices utils datasets methods base > > > > other attached packages: > > [1] biovizBase_1.6.2 rtracklayer_1.18.2 ggbio_1.6.4 > > ggplot2_0.9.3 > > [5] GenomicRanges_1.10.5 IRanges_1.16.3 BiocGenerics_0.4.0 > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@... > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > > > -- > Tengfei Yin > MCDB PhD student > 1620 Howe Hall, 2274, > Iowa State University > Ames, IA,50011-2274 > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@... > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]] _______________________________________________ Bioconductor mailing list Bioconductor@... https://stat.ethz.ch/mailman/listinfo/bioconductor Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
RSS Feed