[Biopython] problem with ClustalW wrapper in Bio.Align.Applications

Jakub Stanislaw Nowak jakub.nowak at ed.ac.uk
Thu Sep 4 16:13:28 UTC 2014


Hi biopython community,

Many thanks for the help me with a previous problem. It turned to be vital and help me move forward.
Unfortunately I have got another conundrum that I can't solve easily.

I am trying to use clustalW command tool in biopython on following set of sequences
> {'pre-miR-344f': 'AGUCAGUCUCCUGGCUGGAGUCCAGCUCUAAGCUGGUUCCAGGCUCUAGCCAGGACCUGACUAC\n', 'pre-miR-9': 'UCUUUGGUUAUCUAGCUGUAUGAGUGGUGUGGAGUCUUCAUAAAGCUAGAUAACCGAAAGU\r\n', 'pre-miR-210': 'CCGGGGCAGUCCCUCCAGGCUCAGGACAGCCACUGCCCACCGCACACUGCGUUGCUCCGGACCCACUGUGCGUGUGACAGCGGCUGA'}


First I processed them and converted them to fasta files using and saved into TL variable
> def get_fasta_composite(self,name):

>         self.name=name

>         file_name=raw_input('How do you want call the file?')

>         my_file = open(file_name + '.fasta', 'w')

>         for key,values in self.name.items():

>             my_file.write('>' + key + ' type ' + '\n' + self.name.get(key) + '\n')

>             print('>' + key + ' type ' + '\n' + self.name.get(key))

>         my_file.close()

>         print('The file was saved as ' + file_name + '.fasta\n')

>         depo = file_name + '.fasta'

>         return depo


		Output:

> Saving Terminal loops
> 
> How do you want call the file?loops
> >pre-miR-344f type 
> CCAGCUCUAAGCUGGUUCCAGGC
> >pre-miR-9 type 
> GAGUGGUGUGGAGUCUUCAUA
> >pre-miR-210 type 
> CAGGACAGCCACUGCCCACCGCACACUGCGUUGCUCCGGACCCAC
> The file was saved as loops.fasta


and the I used following command to produce alignment

> #aligning TL
> test3=tollbox()
> attempt=test3.align(TL)
> alignment=AlignIO.read(attempt, "clustal")
> print(alignment)
> print("\n")


and align method was defined as follows

> def align(self, name):

>         self.name=name

>         print('This is alignment of '+self.name)

>         cline = ClustalwCommandline("/Users/s1159142/clustalw_2.1/clustalw2", infile=self.name)

> ##        cline = ClustalwCommandline("/Users/user/BioinformaticsTools/clustalw_2.1", infile=self.name)

>         output_file = self.name.rstrip("fasta")

>         return output_file + "aln"

TL variable is ascribed by get_fasta_composite method from above
but unfortunately print(alignment) limits itself to only two first sequences from the loops.fasta file

this is output:

> This is alignment of loops.fasta

> SingleLetterAlphabet() alignment with 2 rows and 22 columns

> CCAGCUCUAAGCUGGUUCCAGG pre-miR-344f

> -GAGUGGUGUGGAGUCUUCAUA pre-miR-9

It is not the length of the last sequence. As I tried to substitute it for some similar and add also one more and I always got alignment of only first two sequences. 
I would be grateful if anyone can point the origin of problem.

Thanks,

Jakub

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20140904/46cdca6b/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20140904/46cdca6b/attachment.ksh>


More information about the Biopython mailing list