This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to convert mugsy (maf) alignment to phylip for RaxML input

Hi Everyone

I was trying to convert mugsy whole genome alignment (maf) file to phylip using bioperl. My code is bellow

use Bio::AlignIO;

$in  = Bio::AlignIO->new(-file => "mygenome_test.maf" ,
                         -format => 'maf');
$out = Bio::AlignIO->new(-file => ">mygenome_test_out.phy",
                         -format => 'phylip');

while ( my $aln = $in->next_aln ) {
  $out->write_aln($aln);
}

In next step when I run RaxMl for phylogeny

$ ./raxmlHPC -s mygenome_test_out.phy -m GTRCAT -n Test_dna2

RAxML correctly finished parsing your PHYLIP file,
but there seems to be garbage at the end of the file, i.e., non-whitespace characters!
RAxML will exit now

Can anyone please help me out?

bioperl phylogeny

1 answer

Here is an awk script that converts .maf to phylip style alignments.

https://github.com/EvolBioInf/andi/blob/master/scripts/maf2phy.awk

Log in to answer this question.