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

View of /FigKernelScripts/get_long_enough.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Thu Dec 30 02:30:16 2004 UTC (15 years, 6 months ago) by overbeek
Branch: MAIN
CVS Tags: merge-trunktag-bobdev_news-2, Root-bobdev_news, merge-bobdev_news-1, caBIG-dataload-0, merge-trunktag-bobdev_news-1, merge-bodev_news-3, efrank-preMakefileToStandardMk, caBIG-00-00-00, merge-bobdev_news-2, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news
add tree manipulation utilities

$usage = "usage: get_long_enough Min  FastaFile > pulled";

(
 ($min = shift @ARGV) &&
 ($fasta = shift @ARGV)
)
    || die $usage;

$/ = "\n>";
open(FASTA,"<$fasta") || die "could not open $fasta";
while (defined($_ = <FASTA>))
{
    chomp;
    if ($_ =~ /^>?(\S+)[^\n]*\n(.*)/s)
    {
	$id  =  $1;
	$seq =  $2;
	$seq1 = $2;
	$seq =~ s/\s//gs;
	$seq =~ s/[\.\-\~]//g;
	if (length($seq) >= $min)
	{
	    print ">$id\n$seq1\n";
	}
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3