Grendel
Grendel

Reputation: 597

Biopython Alignment using Muscle or ClustalW without file input

I'm actually building a script in python3 to calculate divergence between several paired sequences. So, I need firt to make an alignment between 2 proteines sequences and then make a codon alignment with 2 dna sequences. To make my first alignment (between 2 proteines sequences), I'm actually using

alns = pairwise2.align.globalds(prot1 ,prot2, matrix, gap_open, gap_extend)

But I need something more sofisticated such ClustalW or MUSCLE algorithmes. The problem is that my script is built in the way that I ask 4 sequences: 2 of dna and 2 of amino acides.

Then I convert my sequences in string. But ClustalW and MUSCLE ask to give a file with those sequences. Is there a way to give the sequences like that:

muscle_cline = MuscleCommandline(muscle_exe, prot1 , prot2, out=out_file)
instead of the input file (unaligned sequences file):
muscle_cline = MuscleCommandline(muscle_exe, input=in_file, out=out_file)

or like that:

clustalw_cline = ClustalwCommandline("clustalw2", prot1, prot2)
instead of that:
clustalw_cline = ClustalwCommandline("clustalw2", infile=in_file)

Because I do not want to creat a file with my sequence unaligned for each of my sequences (around 450)...

Thanks you very much.

Upvotes: 0

Views: 370

Answers (0)

Related Questions