1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#!/usr/local/bin/perl
# This program is licensed to you under the Fred
# Hutchinos Cancer Research Center (FHCRC)
# NONCOMMERICAL LICENSE. A copy of the license may be found at
# http://blocks.fhcrc.org/sift/license.html and should be attached
# to this software.
$file = @ARGV[0];
$queryseq = @ARGV[1];
$database = @ARGV[2];
print "hello $file query $queryseq data $database\n";
open (QUERYSEQ,">$queryseq");
open (DATABASE,">$database");
open (FILE,$file);
$count = 0;
$reached_first_seq = 0; # added to get rid of html crap
while (<FILE>){
if ($flag == 1){
if ($prev ne ""){
print DATABASE "$prev";
}
print DATABASE "$_";
$prev = "";
}
else{
if ($_ =~ /\>/){
$count ++;
$reached_first_seq = 1;
if ($count == 2){
$prev = $_;
$flag = 1;
next;
}
else{
$prev = "";
}
}
if ($reached_first_seq) {
print QUERYSEQ "$_";
}
}
}
close (FILE);
close (QUERYSEQ);
close (DATABASE);
exit (0);
|