Search
Question: Extract isoform-specific ranges
0
gravatar for hwu12
3 months ago by
hwu1210
hwu1210 wrote:

Hi, is there a way to identify/extract the isoform-specific ranges for multiple isoforms? For example: 

GeneA.1 with 1 ranges [1,10]

GeneA.2 with two ranges [1,3][8:10]

GeneA.3 with two ranges [1,3][7:15]

I want:

The range specific for GeneA.1 is [4:6]

The range specific for GeneA.2 is none

The range specific for GeneA.3 is [11,15]

Thanks!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ADD COMMENTlink modified 3 months ago by Malcolm Cook1.4k • written 3 months ago by hwu1210
2
gravatar for Malcolm Cook
3 months ago by
Malcolm Cook1.4k
United States
Malcolm Cook1.4k wrote:

Hello - I expect GenomicRanges:disjoin is your friend for this operation. Look:

# editted for tightness and clarity, and to add a final split

> g<-GRangesList(GeneA.1 = GRanges(seqnames="x", ranges=IRanges(1, 10), strand="+")
+               ,GeneA.2 =  GRanges(seqnames="x", ranges=IRanges(c(1, 8), c(3,10)), strand='+')
+               ,GeneA.3 = GRanges(seqnames="x", ranges=IRanges(c(1, 7), c(3,15)), strand='+'))
> u<-unlist(g)
> d <- disjoin(u, with.revmap=TRUE)
> d$source<-lapply(d$revmap,function(i)names(u)[i])
> d1<-d[1==lengths(d$revmap)]
> s<-split(d1,unlist(d1$source))
> d1
GRanges object with 2 ranges and 2 metadata columns:
      seqnames    ranges strand |        revmap  source
         <Rle> <IRanges>  <Rle> | <IntegerList>  <list>
  [1]        x  [ 4,  6]      + |             1 GeneA.1
  [2]        x  [11, 15]      + |             5 GeneA.3
  -------
  seqinfo: 1 sequence from an unspecified genome; no seqlengths
> s
GRangesList object of length 2:
$GeneA.1 
GRanges object with 1 range and 2 metadata columns:
      seqnames    ranges strand |        revmap  source
         <Rle> <IRanges>  <Rle> | <IntegerList>  <list>
  [1]        x    [4, 6]      + |             1 GeneA.1

$GeneA.3 
GRanges object with 1 range and 2 metadata columns:
      seqnames   ranges strand | revmap  source
  [1]        x [11, 15]      + |      5 GeneA.3

-------
seqinfo: 1 sequence from an unspecified genome; no seqlengths
> 

 

ADD COMMENTlink modified 3 months ago • written 3 months ago by Malcolm Cook1.4k
1

Could also do

subset(GRanges(coverage(u)), score==1L)

 

ADD REPLYlink written 3 months ago by Michael Lawrence9.8k
1

Yes, except that it does not provide the info present in the revmap, being the association of each range with the to which it is unique isoform which I am assuming (perhaps incorrectly?) is desired result

 

> subset(GRanges(coverage(u)), score==1L)
GRanges object with 2 ranges and 1 metadata column:
      seqnames    ranges strand |     score
         <Rle> <IRanges>  <Rle> | <integer>
  [1]        x  [ 4,  6]      * |         1
  [2]        x  [11, 15]      * |         1
  -------
  seqinfo: 1 sequence from an unspecified genome
ADD REPLYlink modified 3 months ago • written 3 months ago by Malcolm Cook1.4k

 Malcolm Cook, thank you so much for the complete example. Michael Lawrence, thanks for your help, too. I really appreciate it.

ADD REPLYlink modified 3 months ago • written 3 months ago by hwu1210
1

@hwu12 - Glad to help!  The best thanks would be to accept my answer!

ADD REPLYlink written 3 months ago by Malcolm Cook1.4k

Malcolm, how can I accept your answer? I want to do it but I cannot find a way to do it. It is not similar to StackOverflow. Sorry I did not see your reply until now. Please let me know and I will accept your answer. Thanks again!

ADD REPLYlink written 12 weeks ago by hwu1210

To the left of every response to your question you should have the opportunity to click on a "thumb" to give the response +1 points and I think also a check-mark in a circle, which will turn green, which indicates that you have "accepted" the response as an answer.  I could not find documentation on this for you.  I wonder where it is.  Here is an example of a response of mine which was accepted as an answer: A: Importing a .txt file with multiple headers into R - you should be able to see the gree check mark

 

 

ADD REPLYlink written 12 weeks ago by Malcolm Cook1.4k

The problem is in my Safari browser. I cannot/never see the green circle there. I switched to Firefox and can see it now. Thanks again.

ADD REPLYlink written 12 weeks ago by hwu1210
1

Thanks. I reported your experience as an issue here: checkbox to accept response as answer does not appear in Safari browser #439

ADD REPLYlink written 12 weeks ago by Malcolm Cook1.4k
1

Thanks! I uploaded an image to issue #439 from the two browsers to show the problem. Hopefully, they can fix it soon. In any case, I will use the Firefox to vote in the future. 

ADD REPLYlink written 12 weeks ago by hwu1210
0
gravatar for Michael Lawrence
3 months ago by
United States
Michael Lawrence9.8k wrote:

Maybe you're looking for GenomicFeatures::mapToTranscripts()?

ADD COMMENTlink written 3 months ago by Michael Lawrence9.8k

Thanks, Michael. I am actually looking for a way to isolate isoform-specific ranges (e.g. for the isoform 1 in the example, the bases from 4 to 6 are unique for the isoform 1 because it is spliced out in other 2 isoforms and does not exist in the final transcript. The [11:15] range for isoform 3 is unique, too. This range does not exist in other isoforms.).   

ADD REPLYlink written 3 months ago by hwu1210
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 198 users visited in the last hour