Question: Get sequence by genomic coordinates in R
0
gravatar for a11msp
4 months ago by
a11msp110
European Union
a11msp110 wrote:

I've realised that after many years of using R, I still don't know a good way to extract a sequence by genomic coordinates. I tried using bioMart, but it seems like getSequence() can't just get any sequence, it asks for some anchors such as gene name, etc. Would appreciate your advice!

sequence R • 263 views
ADD COMMENTlink modified 4 months ago by ATpoint44k • written 4 months ago by a11msp110
6
gravatar for ATpoint
4 months ago by
ATpoint44k
ATpoint44k wrote:

In R given a BSgenome object, here chr1:3000000-3000100, using the Biostrings library:

my.dnastring <- as.character(Biostrings::getSeq(BSgenome.Mmusculus.UCSC.mm10, "chr1", 3000000, 3000100))

my.dnastring
> NTTCTGTTTCTATTTTGTGGTTACTTTGAGGAGAGTTGGAATTAGGTCTTCTTTGAAGGTCTGGTAGAACTCTGCATTAAACCCATCTGGTCCTGGGCTTT
ADD COMMENTlink modified 4 months ago • written 4 months ago by ATpoint44k

This is great - thanks very much!

ADD REPLYlink written 4 months ago by a11msp110
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.3.0
Traffic: 2089 users visited in the last hour
_