[Bioperl-l] Clustal/T-Coffee to Fasta

James Wasmuth james.wasmuth at ed.ac.uk
Wed Mar 17 15:22:47 EST 2004

Hi Alberto,  taken from docs for Bio::AlignIO 

$inputfilename = "testaln.fasta";
    $in  = Bio::AlignIO->new(-file => $inputfilename ,
                             '-format' => 'clustal');
    $out = Bio::AlignIO->new(-file => ">out.aln.pfam" ,
                             '-format' => 'fasta');

    while ( my $aln = $in->next_aln() ) {

if you want the gaps removed then...

while ( my $aln = $in->next_aln() ) {
	$aln->map_chars('\.','')    # first arguement is whatever your gap 
character is...


Alberto M R Davila wrote:

>I was looking in to the SeqIO module trying to know if it could convert
>multiple alignments done with ClustalW/X (*.aln files) or T-Coffee to
>Fasta sequences into a single file... no luck... there would be any other
>Bioperl module to do that format conversion ?
>Thanks, Alberto
>Do you Yahoo!?
>Yahoo! Mail - More reliable, more storage, less spam
>Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org

More information about the Bioperl-l mailing list