matchPattern function for multiple patterns in R
0
0
Entering edit mode
adklts • 0
@adklts-21974
Last seen 3.7 years ago
#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!

matchPattern automatic Biostrings for-loop • 1.1k views
ADD COMMENT

Login before adding your answer.

Traffic: 413 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6