Pull out sequences between ranges?
2
0
Entering edit mode
Teeps • 0
@teeps-17582
Last seen 3.0 years ago

Hi everyone. Simple question but I'm new to bioconductor. I have a DNAString (myDNAStringSet) and a GRanges object made from a BED file (myGRangesObject) so I can find the sequences of the exons in myDNAStringSet using: getSeq(myDNAStringSet, myGRangesObject).

How could I pull out user defined sections between the exons? For example, if I wanted to grab the 1000 base pairs upstream of the first exon listed in myGRangesObject, or the 200 base pairs downstream of the 5th exon listed in myGRangesObject, how would I write that? Thank you for the help!

getsequence • 316 views
ADD COMMENT
0
Entering edit mode
@herve-pages-1542
Last seen 22 hours ago
Seattle, WA, United States

Hi,

Are you sure myGRangesObject is a GRanges object and not a GRangesList object?

Anyway you first need to come up with a GRanges (or GRangesList) object containing the genomic ranges of the sequences you want to pull out. For example, to grab the 1000 base pairs upstream of the ranges in myGRangesObject, first obtain the ranges of the upstream regions with upstream_regions <- promoters(myGRangesObject, upstream=1000, downstream=0), then use this instead of myGRangesObject in your call to getSeq(). Assuming myGRangesObject is a GRanges object and not a GRangesList object, if you only want to do this for the first exon listed in myGRangesObject, you can subset this GRanges object (with myGRangesObject[1]) before passing it to promoters().

See ?GenomicRanges::promoters for more information about promoters() and other intra range transformations like shift(), flank()resize(), etc...

Hope this helps,

H.

ADD COMMENT

Login before adding your answer.

Traffic: 200 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6