#!/usr/bin/perl # --- (c) Molinspiration Cheminformatics 2006 # --- script automatizing screening by miscreen toolkit # # --- run as: screen.pl act.smi ina.smi|ina.frag toscreen.smi # --- as inactives either molecules, or fragments may be used (i.e. 100k.frag) # --- if provideing fragmnet file, it must end by '.frag' # --- edit the following parameters $miscreen = "java -jar miscreen.jar"; $name = "run"; # --- filename of output files $minscore = 0.3; # molecules with score < minscore will be discarded if ($#ARGV < 2) { print "Usage: screen.pl act.smi ina.smi toscreen.smi\n"; print "(you can use your own file names)\n"; exit; } $actdata = $ARGV[0]; # --- file with active molecules $inadata = $ARGV[1]; # --- file with inactive molecules # --- start of the run open (ACT,"$actdata") || die "Cannot open file $actdata\n"; open (INA,"$inadata") || die "Cannot open file $inadata\n"; # --- generation of active fragments print "generating active fragments ...\n"; $actfragments = $name.".af"; `$miscreen -fragment $actdata > $actfragments`; print "file $actfragments created\n"; # --- generation of inactive fragments (if file does not end by 'frag') print "generating inactive fragments ...\n"; $inafragments = $name.".if"; `$miscreen -fragment $inadata > $inafragments`; print "file $inafragments created\n"; # --- calculation of scores; print "creating model ...\n"; $model = $name.".model"; `$miscreen -createmodel -af $actfragments -if $inafragments > $model`; print "model $model created\n"; # --- screening print "screening ...\n"; $tmppred = $name.".tmp"; $test = $ARGV[2]; `$miscreen -screen $test -model $model -minscore $minscore > $tmppred`; # --- sorting based on the calculated activity # --- this requires UNIX or cygwin sort (will not run on Windows) ! $pred = $name.".pred"; `sort +1 -2 -rn $tmppred > $pred`; print "Screened molecules sorted according to activity in $pred\n";