lawremi / ggbio

Grid and ggplot2 based visualization for biological data
111 stars 24 forks source link

autoplot, GappedAlignment makes no sense #19

Closed leipzig closed 12 years ago

leipzig commented 12 years ago
reads <- GappedAlignments(
  names = c("a","b","c","d","e","f","g"),
  seqnames = Rle(c(rep(c("chr1", "chr2"), 3), "chr1")),
  pos = as.integer(c(1400, 2700, 3400, 7100, 4000, 3100, 5200)),
  cigar = c("500M", "100M", "300M", "500M", "300M", "50M200N50M", "50M150N50M"),
  strand = strand(rep.int("+", 7L))) 

plot

there is something screwy with this plot - I can't see the chromsomes or the names, and I have no idea what the y-axis is supposed to be

tengfei commented 12 years ago

Hi

It's a bug for autoplot,GappedAlignments

autoplot(reads, show.junction = TRUE) + facet_grid(~seqnames)

for now this can fix faceting problem, I will look into the weird "y" problem and release a fix sometime this week.

Thanks!

Tengfei

On Wed, Apr 18, 2012 at 11:22 AM, Jeremy Leipzig < reply@reply.github.com

wrote:

reads <- GappedAlignments( names = c("a","b","c","d","e","f","g"), seqnames = Rle(c(rep(c("chr1", "chr2"), 3), "chr1")), pos = as.integer(c(1400, 2700, 3400, 7100, 4000, 3100, 5200)), cigar = c("500M", "100M", "300M", "500M", "300M", "50M200N50M", "50M150N50M"), strand = strand(rep.int("+", 7L)))

plot

there is something screwy with this plot - I can't see the chromsomes or the names, and I have no idea what the y-axis is supposed to be


Reply to this email directly or view it on GitHub: https://github.com/tengfei/ggbio/issues/19

Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name

tengfei commented 12 years ago

Hi Jemery,

Thanks for reporting this issue. I forget update autoplot,GappedAlignment to some changed utils.

I looked at the problem, your strange "y" is grouped by alignments, and default is one group keep one level, I will change this to "non-selfish" grouping, which shown as plot1, and doesn't use color by default as all others, internally it coerce by unlist a grglist(object) to a GRanges, and you could pass arguments as you control a GRanges. default is group by "alignment" and show gaps. if you can tell me what kind of visualization you expect to see or will help you understand the GappedAlignments, or a better default, that will be really helpful. Thanks again.

plot plot2

tengfei commented 12 years ago

Hi Jeremy,

By the way, before I fix the bug in realsed ggbio/biovizBase, there is another solution, to coerce it into the GRangesList

autoplot(grglist(reads), group.selfish = TRUE) autoplot(grglist(reads))

this should get what you want, please let me know, if it doesn't work.

Thanks

Tengfei

On Wed, Apr 18, 2012 at 11:44 AM, Tengfei Yin yintengfei@gmail.com wrote:

Hi

It's a bug for autoplot,GappedAlignments

autoplot(reads, show.junction = TRUE) + facet_grid(~seqnames)

for now this can fix faceting problem, I will look into the weird "y" problem and release a fix sometime this week.

Thanks!

Tengfei

On Wed, Apr 18, 2012 at 11:22 AM, Jeremy Leipzig < reply@reply.github.com

wrote:

reads <- GappedAlignments( names = c("a","b","c","d","e","f","g"), seqnames = Rle(c(rep(c("chr1", "chr2"), 3), "chr1")), pos = as.integer(c(1400, 2700, 3400, 7100, 4000, 3100, 5200)), cigar = c("500M", "100M", "300M", "500M", "300M", "50M200N50M", "50M150N50M"), strand = strand(rep.int("+", 7L)))

plot

there is something screwy with this plot - I can't see the chromsomes or the names, and I have no idea what the y-axis is supposed to be


Reply to this email directly or view it on GitHub: https://github.com/tengfei/ggbio/issues/19

Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name

Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name

tengfei commented 12 years ago

forge to mention for autoplot,GRangesList, default is geom "alignments",

example

data("genesymbol", package = "biovizBase") bamfile <- system.file("extdata", "SRR027894subRBM17.bam", package="biovizBase")

need to set use.names = TRUE

ga <- readBamGappedAlignments(bamfile, param = ScanBamParam(which = genesymbol["RBM17"]), use.names = TRUE)

grl <- grglist(ga)

no gaps, but consider the gapped groups, so no reads fall in gaps

autoplot(grl, geom = "rect")

coerce to GRanges, this case doesn't consider group information about

gapped reads autoplot(unlist(grl), geom = "rect")

just coverage

autoplot(unlist(grl), stat = "coverage", geom = "area")

or

autoplot(unlist(grl), stat = "coverage")

control gap geom for default alignemnt, very slow for big data(for geom

alignment), I need to check this problem autoplot(grl, gap.geom = "segment")

Tengfei

On Wed, Apr 18, 2012 at 4:36 PM, Tengfei Yin yintengfei@gmail.com wrote:

Hi Jeremy,

By the way, before I fix the bug in realsed ggbio/biovizBase, there is another solution, to coerce it into the GRangesList

autoplot(grglist(reads), group.selfish = TRUE) autoplot(grglist(reads))

this should get what you want, please let me know, if it doesn't work.

Thanks

Tengfei

On Wed, Apr 18, 2012 at 11:44 AM, Tengfei Yin yintengfei@gmail.comwrote:

Hi

It's a bug for autoplot,GappedAlignments

autoplot(reads, show.junction = TRUE) + facet_grid(~seqnames)

for now this can fix faceting problem, I will look into the weird "y" problem and release a fix sometime this week.

Thanks!

Tengfei

On Wed, Apr 18, 2012 at 11:22 AM, Jeremy Leipzig < reply@reply.github.com

wrote:

reads <- GappedAlignments( names = c("a","b","c","d","e","f","g"), seqnames = Rle(c(rep(c("chr1", "chr2"), 3), "chr1")), pos = as.integer(c(1400, 2700, 3400, 7100, 4000, 3100, 5200)), cigar = c("500M", "100M", "300M", "500M", "300M", "50M200N50M", "50M150N50M"), strand = strand(rep.int("+", 7L)))

plot

there is something screwy with this plot - I can't see the chromsomes or the names, and I have no idea what the y-axis is supposed to be


Reply to this email directly or view it on GitHub: https://github.com/tengfei/ggbio/issues/19

Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name

Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name

Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name

leipzig commented 12 years ago
autoplot(grglist(reads), group.selfish = TRUE)

is what I would expect although the stack order should be a,b,c... from the top

thanks for addressing this!

tengfei commented 12 years ago

this is fixed in ggbio 1.4.6 + biovizBase 1.4.2 for R 2.15, dev version might need one more day to update.