[BioC] rtracklayer::liftOver ordering

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Wed Aug 24 17:40:42 CEST 2011


I have not used the liftOver tool from rtracklayer and I am happy to
see it exists.

What I have been doing using the command line tool and a wrapper
script from R is to add a "name" column that is really the row number
of the original region.  Then (the command line version) outputs this
as a name column in the text file.  This allows me to go back and see
how they are matched up 1-1.  I find this indispensable.

Andrew: you might be able to fake this by add names to your initial
GRanges object or by adding a metadata column.

Kasper



On Wed, Aug 24, 2011 at 11:28 AM, Andrew Jaffe <ajaffe at jhsph.edu> wrote:
> I'm having a problem maintaining the ordering of my GRanges object
> when I lift it over using rtracklayer::liftOver. For example:
>
>> g # my regions
> GRanges with 5 ranges and 0 elementMetadata values
>    seqnames                 ranges strand |
>       <Rle>              <IRanges>  <Rle> |
> [1]    chr19 [ 13130686,  13133039]      * |
> [2]     chr4 [160026138, 160028079]      * |
> [3]    chr12 [ 65671230,  65672140]      * |
> [4]     chr8 [ 19615409,  19616461]      * |
> [5]    chr14 [ 99706752,  99708661]      * |
>
>> chain = import.chain("hg19ToHg18.over.chain") # from UCSC
>> lifted = liftOver(g, chain) # suppressed unmatched chrs
>> lifted
> GRanges with 5 ranges and 0 elementMetadata values
>    seqnames                 ranges strand |
>       <Rle>              <IRanges>  <Rle> |
> [1]     chr4 [160245588, 160247529]      * |
> [2]     chr8 [ 19659689,  19660741]      * |
> [3]    chr12 [ 63957497,  63958407]      * |
> [4]    chr14 [ 98776505,  98778414]      * |
> [5]    chr19 [ 12991686,  12994039]      * |
>
> This is just a toy example with 5 regions all on different
> chromosomes, but with real data where there are multiple regions per
> chromosome, I am unable to determine the resulting matched lifted data
> for a particular region. Is there any way to preserve the ordering of
> my original list in the liftOver output? Presorting by chromosome and
> position might work 99% of time, but the ordering of some regions
> might shift during the liftOver, and I would not be able to tell if
> this occurred.
>
> Thanks a lot,
> Andrew Jaffe
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list