+ model selection scripts are ready
authorfabio <fabio@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Mon, 11 Feb 2008 16:01:37 +0000 (16:01 +0000)
committerfabio <fabio@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Mon, 11 Feb 2008 16:01:37 +0000 (16:01 +0000)
git-svn-id: http://svn.tuebingen.mpg.de/ag-raetsch/projects/QPalma@7783 e1793c9e-67f9-0310-80fc-b846ff1f7b36

scripts/Experiment.py
scripts/ModelSelection.py
scripts/resurrect

index bfb4517..69889eb 100644 (file)
@@ -34,7 +34,8 @@ def createRuns():
 
    allRuns = []
 
-   dataset_filename = '/fml/ag-raetsch/home/fabio/svn/projects/QPalma/scripts/chr1_dataset.pickle'
+   #dataset_filename = '/fml/ag-raetsch/home/fabio/svn/projects/QPalma/scripts/dataset_10k'
+   dataset_filename = '/fml/ag-raetsch/home/fabio/svn/projects/QPalma/scripts/new_dataset_100'
 
    for QFlag in [True,False]:
       for SSFlag in [True,False]:
@@ -56,14 +57,20 @@ def createRuns():
             currentRun['print_matrix']          = Conf.print_matrix
             currentRun['read_size']             = Conf.read_size
 
+            currentRun['numLengthSuppPoints']   = Conf.numLengthSuppPoints
+            currentRun['numDonSuppPoints']      = Conf.numDonSuppPoints
+            currentRun['numAccSuppPoints']      = Conf.numAccSuppPoints
+
             currentRun['numQualPlifs']          = Conf.numQualPlifs
             currentRun['numQualSuppPoints']     = Conf.numQualSuppPoints
             currentRun['totalQualSuppPoints']   = Conf.totalQualSuppPoints
 
             # run-specific settings
 
-            currentRun['dataset_begin']         = 10
-            currentRun['dataset_end']           = 20
+            currentRun['training_begin']         = Conf.training_begin
+            currentRun['training_end']           = Conf.training_end
+            currentRun['prediction_begin']       = Conf.prediction_begin
+            currentRun['prediction_end']         = Conf.prediction_end
 
             currentRun['enable_quality_scores'] = QFlag
             currentRun['enable_splice_signals'] = SSFlag
@@ -72,9 +79,12 @@ def createRuns():
             currentName = '%s_quality_%s_splicesignals_%s_intron_len' %\
             (bool2str[QFlag],bool2str[SSFlag],bool2str[ILFlag])
 
-            currentRun['name']                  = currentName
+            currentRun['C']                     = Conf.C
 
+            currentRun['name']                  = currentName
             currentRun['dataset_filename']      = dataset_filename
+            currentRun['experiment_path']       = '/fml/ag-raetsch/home/fabio/tmp/QPalma'
+
 
             allRuns.append(currentRun)
 
@@ -84,8 +94,8 @@ def createRuns():
    for currentRun in allRuns:
 
       assert 0 < currentRun['anzpath'] < 100
-      assert 0 < currentRun['dataset_begin'] < currentRun['dataset_end']
-      assert currentRun['dataset_begin'] < currentRun['dataset_end']
+      assert 0 <= currentRun['training_begin'] < currentRun['training_end']
+      assert currentRun['training_end'] <= currentRun['prediction_begin'] < currentRun['prediction_end']
 
       assert currentRun['iter_steps']
 
@@ -98,6 +108,9 @@ def createRuns():
 
       assert 0 < currentRun['numFeatures'] < 10000
 
+      # assert currentRun['numLengthSuppPoints']
+      # assert currentRun['numDonSuppPoints']
+      # assert currentRun['numAccSuppPoints']
       #assert currentRun['numQualPlifs']
       #assert currentRun['numQualSuppPoints']
 
@@ -111,6 +124,7 @@ def createRuns():
 
       #assert currentRun['totalQualSuppPoints']
       assert os.path.exists(currentRun['dataset_filename'])
+      assert os.path.exists(currentRun['experiment_path'])
 
    return allRuns
 
index a619b2a..0fb0e3a 100644 (file)
@@ -6,6 +6,7 @@ import os
 import os.path
 import time
 
+from qpalma_main import QPalma
 import Experiment as Exp
 
 class Model:
@@ -22,23 +23,22 @@ class Model:
       for currentRun in allRuns:
                
          currentInstance = QPalma(currentRun)
-         self.allInstances.append(currentInstance)
 
          #print 'instance created, starting to pickle configuration...'
-         fh = open('config_%d.pickle'%instance_counter,'w+')
-         cPickle.dump(configObject,fh)
-         fh.close()
-
-         #print 'starting to pickle algorithm object...'
-         fh = open('lmm_%d.pickle'%instance_counter,'w+')
+         name = currentRun['name']
+         instance_fn = 'run_%s.pickle'%name
+         fh = open(instance_fn,'w+')
          cPickle.dump(currentInstance,fh)
          fh.close()
 
+         self.allInstances.append(instance_fn)
+
+
    def doSelection(self):
-      for idx in range(self.numInstances):
+      for instance in self.allInstances:
          time.sleep(3)
-         os.system('echo ./resurrect %d | qsub -l h_vmem=1.0G -cwd -j y -N \"model_%d.log\"'%(idx,idx))
-         #os.system('./resurrect %d >out_%d.log 2>err_%d.log &'%(idx,idx,idx))
+         #os.system('echo ./resurrect %d | qsub -l h_vmem=1.0G -cwd -j y -N \"model_%d.log\"'%(idx,idx))
+         os.system('echo "./resurrect %s >out_%s.log 2>err_%s.log &"'%(instance,instance,instance))
 
 
 if __name__ == '__main__':
index 6023fea..cf8f27a 100755 (executable)
@@ -12,4 +12,4 @@ export ILOG_LICENSE_FILE=/fml/ag-raetsch/share/software/ilog/ilm/access2.ilm
 #except:
 #   sys.exit(99)"
 
-python -c "import sys; from cPickle import *; ma=load(open('lmm_${instance}.pickle')); ma.run()"
+python -c "import sys; from cPickle import *; ma=load(open('${instance}')); ma.train()"