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

Annotation of /FigKernelScripts/blastp_pseq.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : efrank 1.1 # -*- perl -*-
2 : olson 1.4 #
3 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
4 :     # for Interpretations of Genomes. All Rights Reserved.
5 :     #
6 :     # This file is part of the SEED Toolkit.
7 :     #
8 :     # The SEED Toolkit is free software. You can redistribute
9 :     # it and/or modify it under the terms of the SEED Toolkit
10 :     # Public License.
11 :     #
12 :     # You should have received a copy of the SEED Toolkit Public License
13 :     # along with this program; if not write to the University of Chicago
14 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15 :     # Genomes at veronika@thefig.info or download a copy from
16 :     # http://www.theseed.org/LICENSE.TXT.
17 :     #
18 :    
19 : efrank 1.1
20 :     ###########################################
21 :     use Carp;
22 :     use Data::Dumper;
23 :     use FIG_Config;
24 :    
25 :     # -*- perl -*-
26 :    
27 :     # usage: blastp_pseq MinGood [Db] < pseq > table_of_hits
28 :    
29 :     (($cutoff = shift @ARGV) && ($db = shift @ARGV))
30 :     || die "usage: blastp_pseq MinGood [Db] < pseq > table_of_hits";
31 :    
32 :     $tmp = "$FIG_Config::temp/tmp$$";
33 :     open(TMP,">$tmp") || die "could not open $tmp";
34 :     while (defined($_ = <STDIN>))
35 :     {
36 :     print TMP $_;
37 :     }
38 :     close(TMP);
39 :    
40 : olson 1.3 $ENV{"BLASTMAT"} = $FIG_Config::blastmat;
41 : efrank 1.1 if (! -s "$db.psq")
42 :     {
43 : olson 1.2 (system("$FIG_Config::ext_bin/formatdb -i $db -pT") == 0)
44 :     || die "could not run $FIG_Config::ext_bin/formatdb -i $db";
45 : efrank 1.1 }
46 :    
47 :     $done = 0;
48 :     while (! $done)
49 :     {
50 : olson 1.2 if (system("$FIG_Config::ext_bin/blastall -FF -d $db -i $tmp -p blastp > $tmp.out") == 0)
51 : efrank 1.1 {
52 :     @tmp = `tail -15 $tmp.out`;
53 :     if ((($tmp[$#tmp] =~ /bits\)\n/s) || (grep(/No hits found/,@tmp) > 0)) &&
54 :     (system("$FIG_Config::fig/bin/condense_blast $cutoff < $tmp.out > $tmp.out2") == 0) &&
55 :     open(JOB,"<$tmp.out2"))
56 :     {
57 :     while (defined($_ = <JOB>))
58 :     {
59 :     print "blastp,$_";
60 :     }
61 :     close(JOB);
62 :     print "done\n";
63 :     $done = 1;
64 :     }
65 :     }
66 :     }
67 :     unlink("$tmp");
68 :     unlink("$tmp.out");
69 :     unlink("$tmp.out2");

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3