This is a test version of Biostars. For the public version, visit https://www.biostars.org.
sequence retrieval in R using fasta file

I have a Hg19.fasta file and I have a csv file which contains the genomic coordinates of all 23 chromosomes which the sequence is to be retrieved. How can I do it using R?

r sequence retrieval

Not what you ask for, but bedtools getfasta would be the way to do this if you wouldn't constrain to R.

1 answer

You could use the R package seqinr to read the FASTA file with read.fasta(), read the csv file with read.csv() then subset the sequence using the coordinates. There may also be something for you in the Bioconductor GenomicRanges package.

Log in to answer this question.