[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.2 - (view) (download) (as text)

1 : olson 1.2 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 : overbeek 1.1 $usage = "usage: get_long_enough Min FastaFile > pulled";
19 :    
20 :     (
21 :     ($min = shift @ARGV) &&
22 :     ($fasta = shift @ARGV)
23 :     )
24 :     || die $usage;
25 :    
26 :     $/ = "\n>";
27 :     open(FASTA,"<$fasta") || die "could not open $fasta";
28 :     while (defined($_ = <FASTA>))
29 :     {
30 :     chomp;
31 :     if ($_ =~ /^>?(\S+)[^\n]*\n(.*)/s)
32 :     {
33 :     $id = $1;
34 :     $seq = $2;
35 :     $seq1 = $2;
36 :     $seq =~ s/\s//gs;
37 :     $seq =~ s/[\.\-\~]//g;
38 :     if (length($seq) >= $min)
39 :     {
40 :     print ">$id\n$seq1\n";
41 :     }
42 :     }
43 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3