[Bio] / FigKernelScripts / get_long_enough.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/get_long_enough.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : overbeek 1.1 $usage = "usage: get_long_enough Min FastaFile > pulled";
2 :    
3 :     (
4 :     ($min = shift @ARGV) &&
5 :     ($fasta = shift @ARGV)
6 :     )
7 :     || die $usage;
8 :    
9 :     $/ = "\n>";
10 :     open(FASTA,"<$fasta") || die "could not open $fasta";
11 :     while (defined($_ = <FASTA>))
12 :     {
13 :     chomp;
14 :     if ($_ =~ /^>?(\S+)[^\n]*\n(.*)/s)
15 :     {
16 :     $id = $1;
17 :     $seq = $2;
18 :     $seq1 = $2;
19 :     $seq =~ s/\s//gs;
20 :     $seq =~ s/[\.\-\~]//g;
21 :     if (length($seq) >= $min)
22 :     {
23 :     print ">$id\n$seq1\n";
24 :     }
25 :     }
26 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3