Importing error using rtracklayer's "import" function
1
0
Entering edit mode
@kavitha-mukund-5074
Last seen 9.6 years ago
Hello, I am trying to import a gff file from ucsc genome browser using rtracklayer's "import" function. Although it imports the file into R without any error, it changes the order of my chromosomes That is to say it is reordering the chromosomes when it inputs into R genes = import("file.gff") names(genes)= "chr1" "chr10" "chr11" "chr12" "chr13" "chr14" "chr15" "chr16" "chr17" "chr18" "chr19" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" "chr8" "chr9" "chrX" "chrY" This is giving me some problems when I compute overlaps using countOverlaps ( IntervalTree-class {IRanges}) as my subject has the order "chr1" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" "chr8" "chr9" "chr10" "chr11" "chr12" "chr13" "chr14" "chr15" "chr16" "chr17" "chr18" "chr19" "chrX" "chrY" Any advice would be greatly appreciated. Thanks! Kavitha [[alternative HTML version deleted]]
• 1.2k views
ADD COMMENT
0
Entering edit mode
@michael-lawrence-3846
Last seen 2.4 years ago
United States
On Wed, Jan 25, 2012 at 3:22 PM, Kavitha Mukund <kmukund@ucsd.edu> wrote: > Hello, > I am trying to import a gff file from ucsc genome browser using > rtracklayer's "import" function. > Although it imports the file into R without any error, it changes the > order of my chromosomes > > That is to say it is reordering the chromosomes when it inputs into R > genes = import("file.gff") > names(genes)= "chr1" "chr10" "chr11" "chr12" "chr13" "chr14" "chr15" > "chr16" "chr17" "chr18" "chr19" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" > "chr8" "chr9" "chrX" "chrY" > > This is giving me some problems when I compute overlaps using > countOverlaps ( IntervalTree-class {IRanges}) as my subject has the order > "chr1" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" "chr8" "chr9" "chr10" > "chr11" "chr12" "chr13" "chr14" "chr15" "chr16" "chr17" "chr18" "chr19" > "chrX" "chrY" > > Any advice would be greatly appreciated. > > It's true that rtracklayer current reorders the sequences. That's not very desirable, so this will be fixed in the next version. To work around this, simply reorder the RangedData object using query[names(subject)] or similar to get things in the right order. Michael > Thanks! > Kavitha > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
Hello Michael, Thank you so much! I didn't know "query[names(subject)]" reorders the RangedData object - I spent a lot of time trying to reorder the gff file by converting it into a data frame etc. Is there a link where this is provided? Thanks again! -Kavitha From: Michael Lawrence [mailto:lawrence.michael@gene.com] Sent: Thursday, January 26, 2012 10:59 AM To: Kavitha Mukund Cc: bioconductor@r-project.org Subject: Re: [BioC] Importing error using rtracklayer's "import" function On Wed, Jan 25, 2012 at 3:22 PM, Kavitha Mukund <kmukund@ucsd.edu<mailto:kmukund@ucsd.edu>> wrote: Hello, I am trying to import a gff file from ucsc genome browser using rtracklayer's "import" function. Although it imports the file into R without any error, it changes the order of my chromosomes That is to say it is reordering the chromosomes when it inputs into R genes = import("file.gff") names(genes)= "chr1" "chr10" "chr11" "chr12" "chr13" "chr14" "chr15" "chr16" "chr17" "chr18" "chr19" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" "chr8" "chr9" "chrX" "chrY" This is giving me some problems when I compute overlaps using countOverlaps ( IntervalTree-class {IRanges}) as my subject has the order "chr1" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" "chr8" "chr9" "chr10" "chr11" "chr12" "chr13" "chr14" "chr15" "chr16" "chr17" "chr18" "chr19" "chrX" "chrY" Any advice would be greatly appreciated. It's true that rtracklayer current reorders the sequences. That's not very desirable, so this will be fixed in the next version. To work around this, simply reorder the RangedData object using query[names(subject)] or similar to get things in the right order. Michael Thanks! Kavitha [[alternative HTML version deleted]] _______________________________________________ Bioconductor mailing list Bioconductor@r-project.org<mailto:bioconductor@r-project.org> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
This should be in help(RangedData). On Thu, Jan 26, 2012 at 11:35 AM, Kavitha Mukund <kmukund@ucsd.edu> wrote: > Hello Michael,**** > > Thank you so much! I didn’t know “query[names(subject)]” reorders the > RangedData object - I spent a lot of time trying to reorder the gff file by > converting it into a data frame etc.**** > > Is there a link where this is provided?**** > > Thanks again!**** > > -Kavitha**** > > ** ** > > ** ** > > *From:* Michael Lawrence [mailto:lawrence.michael@gene.com] > *Sent:* Thursday, January 26, 2012 10:59 AM > *To:* Kavitha Mukund > *Cc:* bioconductor@r-project.org > *Subject:* Re: [BioC] Importing error using rtracklayer's "import" > function**** > > ** ** > > ** ** > > On Wed, Jan 25, 2012 at 3:22 PM, Kavitha Mukund <kmukund@ucsd.edu> wrote:* > *** > > Hello, > I am trying to import a gff file from ucsc genome browser using > rtracklayer's "import" function. > Although it imports the file into R without any error, it changes the > order of my chromosomes > > That is to say it is reordering the chromosomes when it inputs into R > genes = import("file.gff") > names(genes)= "chr1" "chr10" "chr11" "chr12" "chr13" "chr14" "chr15" > "chr16" "chr17" "chr18" "chr19" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" > "chr8" "chr9" "chrX" "chrY" > > This is giving me some problems when I compute overlaps using > countOverlaps ( IntervalTree-class {IRanges}) as my subject has the order > "chr1" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" "chr8" "chr9" "chr10" > "chr11" "chr12" "chr13" "chr14" "chr15" "chr16" "chr17" "chr18" "chr19" > "chrX" "chrY" > > Any advice would be greatly appreciated.**** > > > It's true that rtracklayer current reorders the sequences. That's not very > desirable, so this will be fixed in the next version. To work around this, > simply reorder the RangedData object using query[names(subject)] or similar > to get things in the right order. > > Michael > > **** > > Thanks! > Kavitha > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor**** > > ** ** > [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

Traffic: 905 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6