Mercurial > repos > ucsb-phylogenetics > osiris_phylogenetics
comparison phyloconversion/raxify_fasta.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 use strict; | |
3 | |
4 my $infile = $ARGV[0]; | |
5 my $outfile = $ARGV[1]; | |
6 | |
7 open(IN, "$infile") or exit; | |
8 open(OUT, ">$outfile") or exit; | |
9 | |
10 while (<IN>) { | |
11 my $line = $_; | |
12 if($line =~ m/\>/ ){ | |
13 $line=raxify($line); | |
14 } | |
15 if($line =~ m/\n/){ | |
16 print OUT $line; | |
17 }else{ | |
18 print OUT $line."\n"; | |
19 } | |
20 } | |
21 close(IN); | |
22 close(OUT); | |
23 | |
24 sub raxify | |
25 { | |
26 my $raxline = shift; | |
27 $raxline = substr($raxline,0,51); | |
28 $raxline =~ s/\./_/g; | |
29 $raxline =~ s/\|/_/g; | |
30 $raxline =~ s/ /_/g; | |
31 return $raxline; | |
32 } |