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]]

