comparison phyloconversion/phylip2fasta.pl @ 0:5b9a38ec4a39 draft default tip

First commit of old repositories
author osiris_phylogenetics <ucsb_phylogenetics@lifesci.ucsb.edu>
date Tue, 11 Mar 2014 12:19:13 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5b9a38ec4a39
1 #!/usr/bin/perl -w
2
3
4 my $infile = $ARGV[0];
5 my $interlv = $ARGV[1];
6 my $idlen = $ARGV[2];
7 my $outfile = $ARGV[3];
8
9 #open (OUT, ">$outfile");
10
11 use strict;
12 use Bio::AlignIO;
13 use Bio::SimpleAlign;
14 #you can set the name length to something other than the default 10
15 #if you use a version of phylip (hacked) that accepts ids > 10
16 my $outstream = Bio::AlignIO->new(-format => 'fasta',
17 -fh => \*STDOUT );
18
19 # convert data from one format to another
20 my $phylipstream = Bio::AlignIO->new(-interleaved => $interlv,
21 -format => 'phylip',
22 -file => '<'.$infile,
23 -idlength=>$idlen );
24 while( my $aln = $phylipstream->next_aln ) {
25 $outstream->write_aln($aln);
26 }
27