[BioC] GRanges list and reduce function

Vincent Carey stvjc at channing.harvard.edu
Fri Aug 15 12:42:13 CEST 2014


On Fri, Aug 15, 2014 at 6:20 AM, Asma rabe <asma.rabe at gmail.com> wrote:

> Hi ,
>
>
> I need a Granges object with exons data for  few chromosomes, i got Granges
> list of transcripts and their exons as follows:
>
>
> library("TxDb.Hsapiens.UCSC.hg19.knownGene")
>
> txdb<-TxDb.Hsapiens.UCSC.hg19.knownGene
>
> tx_Exons<-exonsBy(txdb)
>
>
>
> 1-How to use reduce on Granges list?how to get the unique exons only and
> exclude redundant exons?
>
>
r = reduce(tx_Exons)


>
> 2-How to select exons of certain chromosomes only ex: chr10? i tried the
> following but i wonder why i got  GRnages list with empty Grange lists??
>
>
one way

ur = unlist(r)
r10 = ur[which(seqnames(ur)=="chr10")]


>
> chr10<-tx_Exons[seqnames(tx_Exons)=="chr10",]
>
>
> >chr10
>
> GRangesList of length 80922:
>
> $1
>
> GRanges with 0 ranges and 3 metadata columns:
>
>    seqnames    ranges strand |   exon_id   exon_name exon_rank
>
>       <Rle> <IRanges>  <Rle> | <integer> <character> <integer>
>
>
> $2
>
> GRanges with 0 ranges and 3 metadata columns:
>
>      seqnames ranges strand | exon_id exon_name exon_rank
>
>
> $3
>
> GRanges with 0 ranges and 3 metadata columns:
>
>      seqnames ranges strand | exon_id exon_name exon_rank
>
>
> ...
>
> <80919 more elements>
>
> ---
>
> seqlengths:
>
>                   chr1                  chr2 ...        chrUn_gl000249
>
>              249250621             243199373 ...                 38502
>
>
>
> > length(chr10)
>
> [1] 80922
>
> > length(tx_Exons)
>
> [1] 80922
>
>
> Thank you
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> 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
>

	[[alternative HTML version deleted]]



More information about the Bioconductor mailing list