Hey I'm new here, and pretty new to R as well. I am trying to perform a PairwiseAlignment on 25 protein sequences from Uniprot. I have 25 Fasta files in this format:
>tr|A0A287AI92|A0A287AI92_PIG Carbonic anhydrase 1 OS=Sus scrofa OX=9823 GN=CA1 PE=1 SV=1MTSPAWGYDGEYGPEHWSKVYPIANGNNQSPIDIKTSETKHDTSLKPISV.....
I loaded the Fasta files to R using :
ProtSeq_1 <- read.fasta("C:/Users/tiriy/Documents/A0A287AI92.fasta")
Now I'm trying to order the Fasta files into data frame - which I miserably failed at doing and looping the Pairwise alignment with for loop like so:
comb<- combn(10,2)
MT1 <- a_data_frame
for (i in 1:ncol(comb)) {
x<-pairwiseAlignment( toString( MT1 [comb [1,i],1]),
toString(MT1 [comb[2,i],1]),
substitutionMatrix = "BLOSUM100",
gapOpening = -2,
gapExtension = -8,
scoreOnly = FALSE)
fileA<-paste0("C:/Users/uri/Desktop/", i,"-","blusom",".txt")
writePairwiseAlignments(x,file=fileA)}
- How can I data frame all the sequences?
- Or otherwise any other suggestion on looping the pairwise alignment on these fasta files?
Many thanks in advance! I hope I'd be able to give my aid back in the future