Get sequence by genomic coordinates in R

Get sequence by genomic coordinates in R

1

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!


R


sequence

• 915 views

updated 2 hours ago by

0

written 13 months ago by

▴

110

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


Login
before adding your answer.

Read more here: Source link

Tagged