IUBio

PHYLIP interleaved/sequential format conversion

Roland Walker walker at ncbi.nlm.nih.gov
Thu Jun 25 11:43:55 EST 1998


> interleaved format of a PHYLIP alignment file into sequential format?
> Preferably for DOS (Win95) or UNIX platform.

Below is a little perl 5 script for this purpose.  I'm working on
a complete set of scripts to integrate PHYLIP with the SEALS package,
but they aren't yet available.

R

#!/usr/bin/perl
undef $/;
while (<>) {
 my %output;
 split /\n[\n \t]*/;
 my $info = shift @_;
 my ($species,$letters)=split ' ', $info;
 while (@_) {
  for (1..$species) {
    $output{$_} .= (shift @_)."\n";
  }
 }
 print $info."\n";
 for (1..$species) {
   print $output{$_};
 }
}




More information about the Bio-soft mailing list

Send comments to us at biosci-help [At] net.bio.net