annotate tools/rdock/bin/run_rbscreen.pl @ 3:b02d74d22d05 draft default tip

planemo upload
author marpiech
date Mon, 29 Aug 2016 08:23:52 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
1 #!/usr/bin/perl
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
2 use File::stat;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
3 use lib "$ENV{'RBT_ROOT'}/lib";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
4 use strict;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
5 require "run_rbfuncs.pl";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
6
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
7 my $rbtroot = $ENV{'RBT_ROOT'};
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
8 my $rbthome = $ENV{'RBT_HOME'};
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
9 my $rbtligdb = $ENV{'RBT_LIGDB'};
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
10 my $recepDir = "$rbtroot/data/receptors";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
11 my $scriptDir = "$rbtroot/data/scripts";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
12 my $filterDir = "$rbtroot/data/filters";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
13 my $libraryDir = "$rbtligdb/dock";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
14 my $binDir = "$rbtroot/bin";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
15
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
16 #override default directories
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
17 #Parse command line arguments
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
18 my $nArgs = scalar(@ARGV);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
19
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
20 while (scalar(@ARGV)) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
21 my $arg = shift @ARGV;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
22 if (index($arg,'-r')==0) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
23 $recepDir = substr($arg,2);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
24 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
25 elsif (index($arg,'-s')==0) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
26 $scriptDir = substr($arg,2);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
27 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
28 elsif (index($arg,'-l')==0) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
29 $libraryDir = substr($arg,2);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
30 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
31 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
32
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
33
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
34 # Get the receptor, library and script tables
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
35 #my %receptor_table = get_prm_table($recepDir);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
36 my %receptor_table = get_prm_table($rbthome);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
37 my %script_table = get_prm_table($scriptDir);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
38 my %library_table = get_dock_table($libraryDir);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
39
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
40 #GET ALL THE INPUTS
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
41 #my $library = get_selection(\%library_table,"library");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
42 my $isOK;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
43 my @libraries;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
44 my $receptor;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
45 my $script;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
46
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
47 do {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
48 @libraries = get_multiple_selection(\%library_table,"library");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
49 $isOK = get_input("\nIs this OK (Y/N)","Y");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
50 } until ($isOK eq "Y");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
51
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
52 do {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
53 $receptor = get_selection(\%receptor_table,"receptor");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
54 $isOK = get_input("\nIs this OK (Y/N)","Y");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
55 } until ($isOK eq "Y");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
56
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
57 # (SJ) check whether all the required files are in the dir
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
58 # DM 7 Feb 2002 - get PSF/CRD filenames from PRM file
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
59 print "\nLooking for all required target files in $rbthome...\n\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
60 my $prm_file = "$rbthome/".$receptor;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
61 my $prm_root = substr($prm_file, 0, rindex($prm_file,"."));
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
62 my $as_file = "${prm_root}.as";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
63 my $vdw1_file = "${prm_root}_vdw1.grd";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
64 my $vdw5_file = "${prm_root}_vdw5.grd";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
65
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
66 #Set the default file names equal to their parameter names so that
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
67 #error messages make sense if the parameters are missing completely from
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
68 #the .prm file.
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
69 my $psf_file = "RECEPTOR_TOPOL_FILE";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
70 my $crd_file = "RECEPTOR_COORD_FILE";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
71 my $mol2_file;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
72
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
73 # DM 12 May 2003
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
74 # Optional target files for experimental restraints
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
75 #
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
76 # These default restraint suffixes and filenames should be synchronised
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
77 # with the default parameter values in the relevant C++ class source files ($RBT_ROOT/fw/src/.cxx)
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
78 # They are used if the user does not explicitly define the parameter in the
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
79 # receptor .prm file
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
80 #
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
81 # Note: this code searches for specific SECTION names in the receptor .prm file
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
82 # thus forcing a naming convention for the restraint terms that is not mandatory in the C++ code itself
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
83 #
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
84 # Pharmacophore restraint file
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
85 # SECTION PHARMA
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
86 # CONSTRAINTS_FILE = explicit filename
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
87 # OPTIONAL_FILE = explicit filename
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
88 my $ph4_filename = ".const";#synchronise with RbtPharmaSF::_CONSTRAINTS_FILE
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
89 my $ph4_optfilename = "";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
90 my $has_ph4 = 0;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
91 # Tether restraint file
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
92 # SECTION TETHER
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
93 # REFERENCE_FILE = suffix to the root receptor.prm filename
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
94 my $tether_suffix = "_reference.sd";#synchronise with RbtTetherSF::_REFERENCE_FILE
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
95 my $has_tether = 0;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
96 # Nmr restraint file
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
97 # SECTION NMR
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
98 # FILENAME = explicit filename (not suffix)
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
99 my $nmr_filename = "default.noe";#synchronise with RbtTetherSF::_FILENAME
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
100 my $has_nmr = 0;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
101
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
102 open PRMHANDLE,$prm_file || die "Cannot read $prm_file";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
103 while (<PRMHANDLE>) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
104 my @fields = split(' ',$_);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
105 my $nfields = scalar(@fields);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
106 $psf_file = "$rbthome/".$fields[1] if (($fields[0] eq 'RECEPTOR_TOPOL_FILE') && ($nfields > 1));
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
107 $crd_file = "$rbthome/".$fields[1] if (($fields[0] eq 'RECEPTOR_COORD_FILE') && ($nfields > 1));
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
108 $mol2_file = "$rbthome/".$fields[1] if (($fields[0] eq 'RECEPTOR_FILE') && ($nfields > 1));
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
109 chomp $psf_file;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
110 chomp $crd_file;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
111 $has_ph4 = 1 if (($nfields > 1) && ($fields[0] eq 'SECTION') && ($fields[1] eq 'PHARMA') );
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
112 $ph4_filename = "$rbthome/".$fields[1] if (($nfields > 1) && ($fields[0] eq 'CONSTRAINTS_FILE') && $has_ph4);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
113 $ph4_optfilename = "$rbthome/".$fields[1] if (($nfields > 1) && ($fields[0] eq 'OPTIONAL_FILE') && $has_ph4);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
114 $has_tether = 1 if (($nfields > 1) && ($fields[0] eq 'SECTION') && ($fields[1] eq 'TETHER') );
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
115 $tether_suffix = $fields[1] if (($nfields > 1) && ($fields[0] eq 'REFERENCE_FILE') && $has_tether);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
116 $has_nmr = 1 if (($nfields > 1) && ($fields[0] eq 'SECTION') && ($fields[1] eq 'NMR') );
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
117 $nmr_filename = "$rbthome/".$fields[1] if (($nfields > 1) && ($fields[0] eq 'FILENAME') && $has_nmr);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
118 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
119 close PRMHANDLE;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
120
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
121 my @src_files = ($prm_file,$as_file, $vdw1_file, $vdw5_file);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
122 # check for either MOL2 or PSF/CRD
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
123 if ($mol2_file ne "") {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
124 push (@src_files,"$mol2_file");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
125 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
126 else {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
127 push (@src_files,"$psf_file");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
128 push (@src_files,"$crd_file");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
129 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
130 push (@src_files,"${ph4_filename}") if ($has_ph4);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
131 push (@src_files,"${ph4_optfilename}") if (($has_ph4) && ($ph4_optfilename ne ""));
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
132 push (@src_files,"${prm_root}${tether_suffix}") if ($has_tether);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
133 push (@src_files,"${nmr_filename}") if ($has_nmr);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
134
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
135 my $is_file_missing = 0;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
136 foreach my $srcfile ( @src_files) { # search through all the target files
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
137 if(-e $srcfile) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
138 print "Found: $srcfile";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
139 my $sb = stat($srcfile);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
140 #if ($sb->size < 1024) {print " WARNING size is suspiciously small ",$sb->size};
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
141 print "\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
142 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
143 else {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
144 print "ERROR: $srcfile is missing\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
145 $is_file_missing = 1;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
146 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
147 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
148
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
149 if ($is_file_missing) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
150 print "\nCannot continue - please generate all required target files and place in $rbthome\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
151 exit;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
152 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
153
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
154 do {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
155 $script = get_selection(\%script_table,"docking script");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
156 $isOK = get_input("\nIs this OK (Y/N)","Y");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
157 } until ($isOK eq "Y");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
158
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
159 my $flags = get_input("Enter optional rbdock flags","-ap -an");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
160 my $mode;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
161 do
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
162 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
163 $mode = get_input("High Throughput (HT) or Exhaustive Docking (ED)", "HT");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
164 }until (($mode eq "HT") || ($mode eq "ED"));
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
165
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
166 my $HT;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
167 my $filter;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
168 my $FILTERFILE;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
169 my $nRedock;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
170 my $nStages;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
171 my @targets;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
172 my @runs;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
173 my $redockTarget;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
174 my $redockTargetDef = -20.0;#Default score threshold for redocking phase
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
175
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
176 if ($mode eq "ED")
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
177 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
178 $HT = 0;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
179 my $run = get_input("Enter number of runs/ligand",50);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
180 $flags = $flags . " -n" . $run;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
181 $run--;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
182 $filter = "1\nif - SCORE.NRUNS $run 0.0 -1.0,\n0\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
183 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
184 else
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
185 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
186 $HT = 1;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
187 $nStages = get_input("Number of stages (excluding redocking, enter 0 for redocking only)",2);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
188
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
189 #GET AND STORE THE TARGET SCORES AND NUMBER OF RUNS FOR EACH STAGE
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
190
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
191 if ($nStages > 0) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
192 for (my $n = 0; $n < $nStages; $n++) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
193 print "\nDOCKING STAGE $n\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
194 my $target = get_input("Enter target score",-20.0);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
195 my $run = get_input("Enter number of runs/ligand",20);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
196 if ($run > 0)
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
197 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
198 push @targets,$target;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
199 push @runs,$run;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
200 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
201 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
202 $nStages = @targets;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
203 print "\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
204 #Default score threshold for redocking is equal to target score for last docking stage
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
205 $redockTargetDef = $targets[$nStages-1];
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
206 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
207
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
208 $nRedock = get_input("Enter number of redocking runs/ligand",0);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
209 if ($nRedock > 0) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
210 $redockTarget = get_input("Enter target score for redocking",$redockTargetDef);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
211 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
212 else
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
213 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
214 $redockTarget = $redockTargetDef;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
215 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
216 my $nPhases = $nStages;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
217 if ($nRedock > 0)
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
218 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
219 $nPhases++;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
220 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
221 $filter = "$nPhases\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
222 my $nr;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
223 for (my $n = 0; $n < $nStages ; $n++)
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
224 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
225 $nr = $runs[$n] - 1;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
226 $filter .= "if - $targets[$n] SCORE.INTER 1.0 if - SCORE.NRUNS $nr 0.0 -1.0,\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
227 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
228 if ($nRedock > 0)
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
229 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
230 $nr = $nRedock - 1;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
231 $filter .= "if - SCORE.NRUNS $nr 0.0 -1.0,\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
232 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
233 my %filter_table = get_filter_table($filterDir, $redockTarget);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
234 my @wfilters;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
235 do {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
236 print "\nSelect filters. Only the conformations that pass all the\n",
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
237 "filters chosen AND have SCORE.INTER lower than ", $redockTarget,
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
238 "\nAND SCORE.RESTR.CAVITY < 1.0 will be written down\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
239 @wfilters = get_multiple_selection(\%filter_table,"filters");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
240 $isOK = get_input("\nIs this OK (Y/N)","Y");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
241 } until ($isOK eq "Y");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
242
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
243 for (my $i = 0 ; $i < @wfilters ; $i++) # remove the no filters
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
244 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
245 if ($wfilters[$i] eq "1no_other_filters")
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
246 {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
247 splice(@wfilters, $i, 1);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
248 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
249 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
250
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
251 my $nwfilters = @wfilters + 2;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
252 $filter .= "$nwfilters\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
253 $filter .= "- SCORE.INTER $redockTarget,\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
254 $filter .= "- SCORE.RESTR.CAVITY 1.0,\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
255 foreach my $wfilter (@wfilters) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
256 open(FF, "$filterDir/$wfilter") || open(FF, "./$wfilter") ||
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
257 die "cannot open $wfilter for reading: $!";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
258 my $line;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
259 while ($line = <FF>){ $filter .= $line;}
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
260 $filter .= ",\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
261 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
262 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
263
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
264
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
265
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
266 my $runRoot = get_input("Enter run name","rbdock");
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
267
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
268 my $pwd = `pwd`;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
269 chomp $pwd;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
270
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
271 #Make a subdirectory for each docking stage
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
272 #plus a tmp directory
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
273 mkdir($runRoot,0755);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
274 mkdir("$runRoot/tmp",0755);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
275 mkdir("$runRoot/tmp/condor_logs",0755);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
276 mkdir("$runRoot/log",0755);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
277 mkdir("$runRoot/sd",0755);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
278 mkdir("$runRoot/errors",0755);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
279 chdir "$runRoot/tmp";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
280
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
281 my $filterFile = "${runRoot}_filter.txt";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
282 print "Writing $filterFile...\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
283 open FILTERHANDLE,">$filterFile";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
284 print FILTERHANDLE $filter;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
285 #WRITE THE CUSTOM DOCKING SCRIPT FOR USE BY CONDOR
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
286 #This will be the Condor "Executable"
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
287 #gzipped SD file to dock is passed as $1 argument
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
288 #Run name is passed as $2 argument
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
289 my $nqsFile = "run_${runRoot}.csh";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
290 print "Writing $nqsFile...\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
291 open NQSHANDLE,">$nqsFile";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
292 print NQSHANDLE "#!/bin/tcsh -f\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
293 print NQSHANDLE "#CONDOR EXECUTABLE SCRIPT WRITTEN BY run_rbscreen.pl\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
294
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
295 # DM 14 Mar 2003
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
296 #Create a tmp runtime directory on the local disk for rDock SD and log files
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
297 #These will be compressed before copying back to the submission directory
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
298 #on the file server
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
299 #There are now two tmp directories:
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
300 # /tmp/ribodock/<version> - stores the grid files etc that are common between runs
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
301 # /tmp/${PROG}.XXXXXX - stores the I/O SD and log files unique to each run
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
302
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
303 print NQSHANDLE "set PROG = \${0:t}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
304 print NQSHANDLE "set TMPDIR = `mktemp -d /tmp/\${PROG}.XXXXXX`\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
305
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
306 # synchronizing target files
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
307 my $versionidx = index $rbtroot,"ribodock";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
308 my $targetdir = "/tmp/".substr($rbtroot,$versionidx);
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
309 print NQSHANDLE "mkdir -pv -m0775 /tmp/ribodock\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
310 print NQSHANDLE "mkdir -pv -m0775 $targetdir\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
311 print NQSHANDLE "setenv RBT_HOME $targetdir\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
312 print NQSHANDLE "rsync -avz ".join(" ",@src_files)." $targetdir\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
313
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
314 # Copy the compressed sd file to the tmp directory and uncompress
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
315 # DM 28 Feb 2002 - use the /tmp directory on the local disk instead
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
316 # DM 14 Mar 2003 - use TMPDIR = /tmp/${PROG}.XXXXXX instead
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
317 print NQSHANDLE "set gzfile = \$1\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
318 print NQSHANDLE "set runName = \$2\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
319 print NQSHANDLE "set copied_gzfile = \${TMPDIR}/\${gzfile:t}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
320 print NQSHANDLE "set sdfile = \${copied_gzfile:r}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
321 print NQSHANDLE "echo Ligand_DB : \$gzfile\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
322 print NQSHANDLE "echo Local copy: \$copied_gzfile\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
323 print NQSHANDLE "echo Unzipped : \$sdfile\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
324 print NQSHANDLE "cp -f \$gzfile \$copied_gzfile\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
325 print NQSHANDLE "gunzip -f \$copied_gzfile\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
326
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
327 my $target = $redockTarget;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
328 print NQSHANDLE "#\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
329 print NQSHANDLE "set outRoot = \${TMPDIR}/\${runName}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
330 print NQSHANDLE "set logFile = \${outRoot}.log\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
331 print NQSHANDLE "if (-e \$logFile) rm -f \$logFile\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
332 print NQSHANDLE "\$RBT_ROOT/bin/rbdock -i\$sdfile -o\${outRoot} -r$receptor -p$script -t$filterFile $flags > \$logFile\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
333
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
334 # Compress the SD and log files and copy back to submission directory
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
335 # The ..._errors.sd files are generated by the pharmacophore restraints term for ligands that
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
336 # do not fulfill the feature requirements
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
337 print NQSHANDLE "if (-e \${outRoot}.sd) then\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
338 print NQSHANDLE " gzip -9vf \${outRoot}.sd\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
339 print NQSHANDLE " cp \${outRoot}.sd.gz ../sd\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
340 print NQSHANDLE "endif\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
341 print NQSHANDLE "if (-e \${logFile}) then\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
342 print NQSHANDLE " gzip -9vf \${logFile}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
343 print NQSHANDLE " cp \${logFile}.gz ../log\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
344 print NQSHANDLE "endif\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
345 print NQSHANDLE "if (-e \${outRoot}_errors.sd) then\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
346 print NQSHANDLE " gzip -9vf \${outRoot}_errors.sd\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
347 print NQSHANDLE " cp \${outRoot}_errors.sd.gz ../errors\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
348 print NQSHANDLE "endif\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
349
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
350 print NQSHANDLE "rm -rf \${TMPDIR}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
351 close NQSHANDLE;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
352 chmod 0755,$nqsFile;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
353
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
354 #PREPARE THE CONDOR JOB FILE
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
355 my $condorFile = "run_${runRoot}.cmd";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
356 print "Writing $condorFile...\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
357 open CMDHANDLE,">$condorFile";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
358 print CMDHANDLE "#CONDOR COMMAND FILE WRITTEN BY run_rbscreen.pl\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
359 print CMDHANDLE "universe = vanilla\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
360 print CMDHANDLE "initialdir = $pwd/$runRoot/tmp\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
361 print CMDHANDLE "environment = RBT_ROOT=$rbtroot;RBT_LIGDB=$rbtligdb;RBT_HOME=$rbthome;LD_LIBRARY_PATH=/usr/local/lib:$rbtroot/lib;\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
362 print CMDHANDLE "executable = ${nqsFile}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
363 #Stop Condor filling your mailbox
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
364 print CMDHANDLE "Notification = Error\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
365 print CMDHANDLE "log = run_${runRoot}.log\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
366 # Added by DM, Enspiral Discovery, 28 Feb 2005
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
367 # Prevent rDock jobs running on dedicated Catalyst nodes
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
368 print CMDHANDLE "Requirements = CATALYST_NODE =!= True\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
369
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
370 #GET THE LIST OF COMPRESSED SD FILES TO DOCK
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
371 my $iFile=0;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
372 foreach my $library (@libraries) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
373 my @libFiles = glob "$library_table{$library}";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
374 foreach my $libFile (@libFiles) {
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
375 $iFile++;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
376 my $runName = "${runRoot}_$iFile";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
377 print CMDHANDLE "output = condor_logs/run_${runName}.out\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
378 print CMDHANDLE "error = condor_logs/run_${runName}.err\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
379 print CMDHANDLE "arguments = $libFile $runName\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
380 print CMDHANDLE "queue\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
381 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
382 }
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
383 close CMDHANDLE;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
384
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
385 #WRITE THE CUSTOM CLEANUP SCRIPT
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
386 #This will be run by the user from the command line
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
387 #after all the jobs have finished
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
388 my $cleanFile = "clean_${runRoot}.csh";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
389 print "Writing $cleanFile...\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
390 open CLEANHANDLE,">$cleanFile";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
391 print CLEANHANDLE "#!/bin/tcsh -f\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
392 print CLEANHANDLE "#CLEANUP SCRIPT WRITTEN BY run_rbscreen.pl\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
393 print CLEANHANDLE "set sdout = ../${runRoot}_raw_hits.sd\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
394 print CLEANHANDLE "if (-e \${sdout}) then\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
395 print CLEANHANDLE " echo ARE YOU SURE YOU WANT TO DO THIS\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
396 print CLEANHANDLE " echo \${sdout} already exists\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
397 print CLEANHANDLE " echo To rerun the script remove \${sdout} manually first\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
398 print CLEANHANDLE " exit\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
399 print CLEANHANDLE "endif\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
400 print CLEANHANDLE "echo All compressed SD files in ../sd/ will be concatenated into a single compressed file \${sdout}.gz\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
401 print CLEANHANDLE "touch \${sdout}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
402 print CLEANHANDLE "foreach file (../sd/*.sd.gz)\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
403 print CLEANHANDLE " echo Sorting and concatenating \${file}...\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
404 print CLEANHANDLE " zcat \${file} | \${RBT_ROOT}/bin/sdsort -n -fSCORE -s >> \${sdout}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
405 print CLEANHANDLE "end\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
406 print CLEANHANDLE "echo Each block of consecutive records per ligand have been presorted by SCORE ";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
407 print CLEANHANDLE "ready for filtering\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
408 print CLEANHANDLE "echo Compressing \${sdout}...\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
409 print CLEANHANDLE "gzip -9vf \${sdout}\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
410 print CLEANHANDLE "echo DONE\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
411 print CLEANHANDLE "echo You may now safely remove the ../sd/ directory if you wish to save disk space\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
412 close CLEANHANDLE;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
413 chmod 0755,$cleanFile;
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
414
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
415 print "To submit, cd $runRoot/tmp; condor_submit $condorFile\n";
b02d74d22d05 planemo upload
marpiech
parents:
diff changeset
416 print "When all jobs have completed, run $runRoot/tmp/$cleanFile to concatenate the output files\n";