[BioPython] FormatConverter: from Fasta format to ClustalW format

Peter biopython at maubp.freeserve.co.uk
Wed Jan 2 11:54:34 UTC 2008


Hello Byung chul Lee,

On 1/2/08, Lee,Byung-chul wrote:
>
> Dear colleagues.
>
> I want to use the AlignInfo.SummaryInfo for fasta-format alignment file.
> I think that to do the process firstly the fasta format should be
> converted to clustalw format, so I try to use Formatconverter.
> However, at my trial, I cannot do that.

Once you have an alignment object (loaded from any file format), this
should work with AlignInfo.  I don't think you need to convert it from
FASTA to ClustalW.

I would guess the error you saw is a problem with Biopython/Martel and
mxTextTools 3.0, which isn't 100% compatible with mxTextTools 2.0.
What version of Biopython are you using, as I would have expected this
to work fine with Biopython 1.44?

You could also try using Bio.SeqIO to load the FASTA format alignment
file instead, see http://biopython.org/wiki/SeqIO

from Bio import SeqIO
from Bio.Align import AlignInfo
alignment = SeqIO.to_alignment(SeqIO.parse(open('tmp.fasta'), "fasta"))
summary_align = AlignInfo.SummaryInfo(alignment)

Peter



More information about the Biopython mailing list