I want to do multiple sequence alignment by using MUSCLE algorithm .
from Bio.Align.Applications import MuscleCommandline
muscle_exe = r"C:\Program file\muscle3.8.31_i86win32.exe"
in_file = r"non_aligned.fasta"
out_file = r"aligned.fasta"
muscle_cline = MuscleCommandline(muscle_exe, input=in_file, out=out_file)
print(muscle_cline)
stdout, stderr = muscle_cline()
But, I want to use it in a different way as the following:
nsequences = len(sequences)
for i in range(nsequences):
for j in range(i+1, nsequences):
aln = alignment_function(sequences[i], sequences[j])
print (sequences[i], sequences[j], aln)
where sequences are the sequences contained in the file non_aligned.fasta, and nsequences is the number of sequences. So, I want to align two sequences by MUSCLE , each time like I mentioned in the above code and print every two sequences. alignment_function(sequences[i], sequences[j]) is a function, which does the alignment of two sequences by MUSCLE. How can I do this ? This should then output something like:
seq1 seq2 aln12
seq1 seq3 aln13
seq2 seq3 aln23