+ added license text
[qpalma.git] / tests / test_qpalma_prediction.py
index 2830382..f1211d3 100644 (file)
@@ -13,6 +13,8 @@ from Utils import print_prediction
 
 from createAlignmentFileFromPrediction import alignment_reconstruct
 
+from qpalma.sequence_utils import DataAccessWrapper,SeqSpliceInfo
+
 jp = os.path.join
 
 
@@ -96,9 +98,23 @@ class TestQPalmaPrediction(unittest.TestCase):
             print 'size'
             print len(example)
 
-      qp = QPalma(True)
+      # fetch the data needed
+      g_dir    = run['dna_flat_files'] #'/fml/ag-raetsch/share/projects/genomes/A_thaliana_best/genome/'
+      acc_dir  = '/fml/ag-raetsch/home/fabio/tmp/interval_query_files/acc'
+      don_dir  = '/fml/ag-raetsch/home/fabio/tmp/interval_query_files/don'
+
+      g_fmt = 'chr%d.dna.flat'
+      s_fmt = 'contig_%d%s'
+
+      num_chromo = 6
+
+      accessWrapper = DataAccessWrapper(g_dir,acc_dir,don_dir,g_fmt,s_fmt)
+      seqInfo = SeqSpliceInfo(accessWrapper,range(1,num_chromo))
+
+      qp = QPalma(run,seqInfo,True)
       #qp.init_prediction(run,set_name)
-      allPredictions = qp.predict(run,self.prediction_set,param)
+      allPredictions = qp.predict(self.prediction_set,param)
+
       for current_prediction in allPredictions:
          align_str = print_prediction(current_prediction)
          print align_str
@@ -116,6 +132,7 @@ class TestQPalmaPrediction(unittest.TestCase):
          print alignment_reconstruct(current_prediction,numExons)
          #print id,start_pos,predExons
 
+      print 'Problem counter is %d' % qp.problem_ctr 
 
 if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(TestQPalmaPrediction)