- Timestamp:
- Apr 17, 2008, 12:46:13 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/base1/se.lu.thep.wenni/trunk/base/base1/base_plugin_script/wenni.pl
r115 r665 29 29 sub basefile_options($$); 30 30 sub BaseFileConverter($); 31 sub cleanup($ );31 sub cleanup($$); 32 32 sub cmdline_options($); 33 33 sub nni($); 34 sub NNIFileConverter($ $);34 sub NNIFileConverter($); 35 35 sub result($$); 36 36 … … 49 49 # determine beta and number of neighbours. Presedence order is (low to 50 50 # high priority): default value, basefile value, command line value. 51 my %option=( beta => 0.6, datatype => "derived", 52 neighbours => 4, nodelete => 0 ); 51 my %option=( 52 beta => 0.6, 53 datatype => "derived", 54 intensity1 => "intensity1", 55 intensity2 => "intensity2", 56 neighbours => 4, 57 nodelete => 0, 58 BCh1SD => "BCh1SD", 59 BCh2SD => "BCh2SD" 60 ); 53 61 basefile_options(\%option,$basefile); 54 62 foreach my $key (keys %cmdline_option) { … … 59 67 } 60 68 61 BaseFileConverter( $option{'datatype'});62 NNIFileConverter( $option{'beta'},$option{'datatype'});69 BaseFileConverter(\%option); 70 NNIFileConverter(\%option); 63 71 nni($option{'neighbours'}); 64 result($basefile, $option{'datatype'});72 result($basefile,\%option); 65 73 if (!$option{'nodelete'}) { 66 cleanup($basefile );74 cleanup($basefile,\%option); 67 75 } 68 76 … … 92 100 93 101 sub BaseFileConverter($) { 94 my $ datatype=$_[0];102 my $option=$_[0]; 95 103 my $command="$FindBin::Bin/BaseFileConverter"; 96 104 $command.=" BASEfile.data"; 97 105 $command.=" wenni_"; 98 if ($ datatypeeq "derived") {99 $command.=" -assayFields intensity1";100 $command.=" -assayFields intensity2";106 if ($option{"datatype"} eq "derived") { 107 $command.=" -assayFields $$option{intensity1}"; 108 $command.=" -assayFields $$option{intensity2}"; 101 109 } 102 110 else { … … 106 114 $command.=" -assayFields BCh2Mean"; 107 115 } 108 $command.=" -assayFields BCh1SD";109 $command.=" -assayFields BCh2SD";116 $command.=" -assayFields $$option{BCh1SD}"; 117 $command.=" -assayFields $$option{BCh2SD}"; 110 118 return system("$command"); 111 119 } 112 120 113 sub cleanup($ ) {121 sub cleanup($$) { 114 122 my $basefile=$_[0]; 123 my $option=$_[1]; 115 124 unlink($basefile); 116 125 unlink("wenni_BCh1Mean.data"); 117 unlink("wenni_ BCh1SD.data");126 unlink("wenni_$$option{BCh1SD}.data"); 118 127 unlink("wenni_BCh2Mean.data"); 119 unlink("wenni_ BCh2SD.data");128 unlink("wenni_$$option{BCh2SD}.data"); 120 129 unlink("wenni_FCh1Mean.data"); 121 130 unlink("wenni_FCh2Mean.data"); 122 131 unlink("wenni_imputed.data"); 123 unlink("wenni_ intensity1.data");124 unlink("wenni_ intensity2.data");132 unlink("wenni_$$option{intensity1}.data"); 133 unlink("wenni_$$option{intensity2}.data"); 125 134 unlink("wenni_logratio.data"); 126 135 unlink("wenni_weight.data"); … … 187 196 } 188 197 189 sub NNIFileConverter($$) { 190 my $beta=$_[0]; 191 my $datatype=$_[1]; 198 sub NNIFileConverter($) { 199 my $option=$_[0]; 192 200 my $command="$FindBin::Bin/NNIFileConverter"; 193 $command.=" -beta $ beta";194 if ($ datatypeeq "derived") {195 $command.=" -fg1 wenni_ intensity1.data";196 $command.=" -fg2 wenni_ intensity2.data";201 $command.=" -beta $$option{'beta'}"; 202 if ($$option{'datatype'} eq "derived") { 203 $command.=" -fg1 wenni_$$option{intensity1}.data"; 204 $command.=" -fg2 wenni_$$option{intensity2}.data"; 197 205 $command.=" -datatype derived"; 198 206 } … … 204 212 $command.=" -datatype raw"; 205 213 } 206 $command.=" -bgstd1 wenni_ BCh1SD.data";207 $command.=" -bgstd2 wenni_ BCh2SD.data";214 $command.=" -bgstd1 wenni_$$option{BCh1SD}.data"; 215 $command.=" -bgstd2 wenni_$$option{BCh2SD}.data"; 208 216 $command.=" -logratio wenni_logratio.data"; 209 217 $command.=" -weight wenni_weight.data"; … … 213 221 sub result($$) { 214 222 my $basefile=$_[0]; 215 my $datatype=$_[1]; 223 my $option=$_[1]; 224 my $datatype=$$option{'datatype'}; 216 225 print "BASEfile\n"; 217 226 print "section\tspots\n"; … … 255 264 } 256 265 else { 257 open(F1FILE,"<wenni_ intensity1.data");258 open(F2FILE,"<wenni_ intensity2.data");266 open(F1FILE,"<wenni_$$option{intensity1}.data"); 267 open(F2FILE,"<wenni_$$option{intensity2}.data"); 259 268 } 260 269 while (<IMPUTEFILE>) {
Note: See TracChangeset
for help on using the changeset viewer.