Hey guys,

I would like to know if there are any methods of efficiently subset a
GRangeList by it seqnames.

I have something like this:


GRangesList of length 86046:
$1
GRanges with 27 ranges and 3 elementMetadata values:
       seqnames               ranges strand   |   exon_id   exon_name exon_rank
          <Rle>            <IRanges>  <Rle>   | <integer> <character> <integer>
   [1]     chr1 [66999065, 66999090]      +   |         1        <NA>         1
   [2]     chr1 [66999928, 67000051]      +   |         2        <NA>         2
   [3]     chr1 [67091529, 67091593]      +   |         3        <NA>         3
   [4]     chr1 [67098752, 67098777]      +   |         4        <NA>         4
   [5]     chr1 [67099762, 67099846]      +   |         5        <NA>         5
   [6]     chr1 [67105459, 67105516]      +   |         6        <NA>         6
   [7]     chr1 [67108492, 67108547]      +   |         7        <NA>         7
   [8]     chr1 [67109226, 67109402]      +   |         8        <NA>         8
   [9]     chr1 [67126195, 67126207]      +   |         9        <NA>         9
   ...      ...                  ...    ... ...       ...         ...       ...



In which each element ($1,$2,$3,...) represents a transcript and it
set of exons...

In the seqnames colum I have the chromosomes ranging from 1 to Y (all
24 human cromosomes), what I would like to know is how to get just the
elements accounting for chromosome 14...

I have made successfully by unlisting the structure into a huge normal
GRange and then subseting normally:

ex <- unlist(ex_tx)
ex14 <- ex[which(seqnames(ex) == "chr14")]


But obviously I lose the GRangesList structure. So are there any way
to subset this directly in the GRangesList without the need to unlist,
in a way that my result is also a GRangesList ?

Thanks,
Halian

	[[alternative HTML version deleted]]

