Hi Guys
I could not find way to apply the following loop to the genome scaffolds:
peachgenome<- readFASTA(url("http://www.rosaceae.org/sites/www.rosaceae.org/files/Prunus_persica.main_genome.scaffolds.fasta"))
myobs <- paste("peachgenx$scaffold_", 1:8, sep = "")
TATA = "TATAAAAA"
require(Biostrings)
sapply(myobs, function (x) { countPattern(TATA, x, max.mismatch = 1) })
Gives me just zero:
peachgenx$scaffold_1 peachgenx$scaffold_2 peachgenx$scaffold_3
0 0 0
peachgenx$scaffold_4 peachgenx$scaffold_5 peachgenx$scaffold_6
0 0 0
peachgenx$scaffold_7 peachgenx$scaffold_8
0 0
However individual code works:
countPattern (TATA, peachgenx$scaffold_1, max.mismatch = 1)