Question: Get sequence by genomic coordinates in R
0
gravatar for a11msp
5 weeks 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 • 140 views
ADD COMMENTlink modified 5 weeks ago by ATpoint40k • written 5 weeks ago by a11msp110
6
gravatar for ATpoint
5 weeks ago by
ATpoint40k
Germany
ATpoint40k 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 5 weeks ago • written 5 weeks ago by ATpoint40k

This is great - thanks very much!

ADD REPLYlink written 5 weeks 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: 1514 users visited in the last hour