Read FASTA into a dataframe and extract subsequences of FASTA file
library("Biostrings")
fastaFile <- readDNAStringSet("my.fasta")
seq_name = names(fastaFile)
sequence = paste(fastaFile)
df <- data.frame(seq_name, sequence)
You should have a look at the Biostrings package.
library("Biostrings")
s = readDNAStringSet("nm.fasta")
subseq(s, start=c(1, 2, 3), end=c(3, 6, 5))