#Isolating column with sequences
seqs=bam1[[12]]
dnaseq = seqs
#containing pattern sequences
master <- read.csv("brca1.csv")
k=DNAStringSet(dnaseq)
df=as.data.frame(master$PCR_product)
for(i in 1:nrow(df)){
row=df[i,]
s=DNAString(row)
print(s)
klm=vmatchPattern(s, k, fixed=FALSE)
klm_df=as.data.frame(klm)
}
k is DNA strings from my bam file. Master is a CSV that I prepared with pattern sequences that I am looking for. They are about 60 rows. I need an automatic way to check every pattern sequence in the CSV with my bam file and to store the results in a data frame.
At the moment I am trying for loop but with no success since print(s) return my DNAstrings from CSV file but I cannot use further. I need automatically to feed vmatchPattern with every row extracted from CSV(transformed in DNAString) and to store the results. I found vmatchPatterns that have the limitation of pattern to be single xstring. Any suggestion please of how to iterate or maybe to suggest another way or function for multiple matching. Thank you very much!