Search
Question: Gviz Incorrect Labels on Features
0
gravatar for Lance Parsons
4.6 years ago by
Lance Parsons130
United States
Lance Parsons130 wrote:
I have run into what appears to be a bug with GViz labels, though perhaps I'm using the annotations incorrectly. The following minimal example seems to plot the correct features, but with the labels mixed up. I suspect the issue has to do with the sorting (or lack thereof) of the features in the GRanges list, however, I'm not sure of the proper workaround. Any help would be appreciated. # Gviz annotation label mixup library(Gviz) library(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene) txdb <- TxDb.Scerevisiae.UCSC.sacCer3.sgdGene chr = 'chrVIII' start=212535 - 500 end=214718 + 2000 grtrack = GeneRegionTrack(txdb, chromosome=chr, start=start, end=end, showId=TRUE, shape='fixedArrow') grtrack at range plotTracks(grtrack) Here you can see that YHR054W-A should be plotted at 214508 and in the forward direction. However, that is clearly not the case in the plot. GRanges with 6 ranges and 7 metadata columns: seqnames ranges strand | feature id exon transcript gene symbol density <rle> <iranges> <rle> | <character> <character> <character> <character> <character> <character> <numeric> [1] chrVIII [212510, 212704] + | CDS unknown YHR052W-A_1 YHR052W-A YHR052W-A YHR052W-A 1 [2] chrVIII [214508, 214702] + | CDS unknown YHR054W-A_1 YHR054W-A YHR054W-A YHR054W-A 1 [3] chrVIII [212535, 212720] - | CDS unknown YHR053C_1 YHR053C YHR053C YHR053C 1 [4] chrVIII [213185, 214249] - | CDS unknown YHR054C_1 YHR054C YHR054C YHR054C 1 [5] chrVIII [214533, 214718] - | CDS unknown YHR055C_1 YHR055C YHR055C YHR055C 1 [6] chrVIII [215183, 217834] - | CDS unknown YHR056C_1 YHR056C YHR056C YHR056C 1 --- seqlengths: chrVIII NA -- Lance Parsons - Scientific Programmer 134 Carl C. Icahn Laboratory Lewis-Sigler Institute for Integrative Genomics Princeton University
ADD COMMENTlink modified 4.6 years ago by florian.hahne@novartis.com1.6k • written 4.6 years ago by Lance Parsons130
0
gravatar for florian.hahne@novartis.com
4.6 years ago by
Switzerland
Jep, I think I know what is going on here. Damn factors in data.frames? Will post a fix soon. Florian From: Lance Parsons <lparsons@princeton.edu<mailto:lparsons@princeton.edu>> Date: Wednesday 21 May 2014 17:53 To: "bioconductor at r-project.org<mailto:bioconductor at="" r-project.org="">" <bioconductor at="" r-project.org<mailto:bioconductor="" at="" r-project.org="">> Cc: Florian Hahne <florian.hahne at="" novartis.com<mailto:florian.hahne="" at="" novartis.com="">> Subject: Gviz Incorrect Labels on Features I have run into what appears to be a bug with GViz labels, though perhaps I'm using the annotations incorrectly. The following minimal example seems to plot the correct features, but with the labels mixed up. I suspect the issue has to do with the sorting (or lack thereof) of the features in the GRanges list, however, I'm not sure of the proper workaround. Any help would be appreciated. # Gviz annotation label mixup library(Gviz) library(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene) txdb <- TxDb.Scerevisiae.UCSC.sacCer3.sgdGene chr = 'chrVIII' start=212535 - 500 end=214718 + 2000 grtrack = GeneRegionTrack(txdb, chromosome=chr, start=start, end=end, showId=TRUE, shape='fixedArrow') grtrack at range plotTracks(grtrack) Here you can see that YHR054W-A should be plotted at 214508 and in the forward direction. However, that is clearly not the case in the plot. GRanges with 6 ranges and 7 metadata columns: seqnames ranges strand | feature id exon transcript gene symbol density <rle> <iranges> <rle> | <character> <character> <character> <character> <character> <character> <numeric> [1] chrVIII [212510, 212704] + | CDS unknown YHR052W-A_1 YHR052W-A YHR052W-A YHR052W-A 1 [2] chrVIII [214508, 214702] + | CDS unknown YHR054W-A_1 YHR054W-A YHR054W-A YHR054W-A 1 [3] chrVIII [212535, 212720] - | CDS unknown YHR053C_1 YHR053C YHR053C YHR053C 1 [4] chrVIII [213185, 214249] - | CDS unknown YHR054C_1 YHR054C YHR054C YHR054C 1 [5] chrVIII [214533, 214718] - | CDS unknown YHR055C_1 YHR055C YHR055C YHR055C 1 [6] chrVIII [215183, 217834] - | CDS unknown YHR056C_1 YHR056C YHR056C YHR056C 1 --- seqlengths: chrVIII NA [cid:part1.07010103.00050306 at princeton.edu] -- Lance Parsons - Scientific Programmer 134 Carl C. Icahn Laboratory Lewis-Sigler Institute for Integrative Genomics Princeton University -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 22755 bytes Desc: image.png URL: <https: stat.ethz.ch="" pipermail="" bioconductor="" attachments="" 20140523="" 5a71628c="" attachment.png="">
ADD COMMENTlink written 4.6 years ago by florian.hahne@novartis.com1.6k
Fantastic. Not sure when this cropped up, but this will certainly help quite a bit. Let me know once you have a patch, I'd be happy to test it. Lance Hahne, Florian wrote: > Jep, I think I know what is going on here. Damn factors in > data.frames� Will post a fix soon. > Florian > > From: Lance Parsons <lparsons@princeton.edu> <mailto:lparsons@princeton.edu>> > Date: Wednesday 21 May 2014 17:53 > To: "bioconductor@r-project.org <mailto:bioconductor@r-project.org>" > <bioconductor@r-project.org <mailto:bioconductor@r-project.org="">> > Cc: Florian Hahne <florian.hahne@novartis.com> <mailto:florian.hahne@novartis.com>> > Subject: Gviz Incorrect Labels on Features > > I have run into what appears to be a bug with GViz labels, though > perhaps I'm using the annotations incorrectly. The following minimal > example seems to plot the correct features, but with the labels mixed > up. I suspect the issue has to do with the sorting (or lack thereof) > of the features in the GRanges list, however, I'm not sure of the > proper workaround. Any help would be appreciated. > > # Gviz annotation label mixup > > library(Gviz) > library(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene) > txdb <- TxDb.Scerevisiae.UCSC.sacCer3.sgdGene > chr = 'chrVIII' > start=212535 - 500 > end=214718 + 2000 > grtrack = GeneRegionTrack(txdb, chromosome=chr, start=start, end=end, > showId=TRUE, shape='fixedArrow') > grtrack@range > plotTracks(grtrack) > > > Here you can see that YHR054W-A should be plotted at 214508 and in the > forward direction. However, that is clearly not the case in the plot. > > > GRanges with 6 ranges and 7 metadata columns: > seqnames ranges strand | feature > id exon transcript gene symbol density > <rle> <iranges> <rle> | <character> <character> <character> > <character> <character> <character> <numeric> > [1] chrVIII [212510, 212704] + | CDS unknown > YHR052W-A_1 YHR052W-A YHR052W-A YHR052W-A 1 > [2] chrVIII [214508, 214702] + | CDS unknown > YHR054W-A_1 YHR054W-A YHR054W-A YHR054W-A 1 > [3] chrVIII [212535, 212720] - | CDS unknown > YHR053C_1 YHR053C YHR053C YHR053C 1 > [4] chrVIII [213185, 214249] - | CDS unknown > YHR054C_1 YHR054C YHR054C YHR054C 1 > [5] chrVIII [214533, 214718] - | CDS unknown > YHR055C_1 YHR055C YHR055C YHR055C 1 > [6] chrVIII [215183, 217834] - | CDS unknown > YHR056C_1 YHR056C YHR056C YHR056C 1 > --- > seqlengths: > chrVIII > NA > > > > -- > Lance Parsons - Scientific Programmer > 134 Carl C. Icahn Laboratory > Lewis-Sigler Institute for Integrative Genomics > Princeton University > -- Lance Parsons - Scientific Programmer 134 Carl C. Icahn Laboratory Lewis-Sigler Institute for Integrative Genomics Princeton University [[alternative HTML version deleted]]
ADD REPLYlink written 4.6 years ago by Lance Parsons130
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 229 users visited in the last hour