+ added small script for the evaluation of the first vmatch round
authorfabio <fabio@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Thu, 17 Apr 2008 14:26:06 +0000 (14:26 +0000)
committerfabio <fabio@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Thu, 17 Apr 2008 14:26:06 +0000 (14:26 +0000)
git-svn-id: http://svn.tuebingen.mpg.de/ag-raetsch/projects/QPalma@8573 e1793c9e-67f9-0310-80fc-b846ff1f7b36

scripts/createAlignmentFileFromPrediction.py
scripts/createNewDataset.py
scripts/evaluateVmatch.py [new file with mode: 0644]

index a8fdb18..78f7ebe 100644 (file)
@@ -78,8 +78,10 @@ def writePredictions(fname,allPositions):
       tExonSizes,tStarts, tEnds) = alignment 
 
       new_line = '%d\t%d\t%s\t%s\t%s\t%d\t%d\t%d\t%d\t%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s\n' %\
-      (id,chr,strand,seq,q1,start_pos,qStart,qEnd,tStart,tEnd,num_exons,str(qExonSizes)[1:-1],str(qStarts)[1:-1],str(qEnds)[1:-1],\
-      str(tExonSizes)[1:-1],str(tStarts)[1:-1],str(tEnds)[1:-1])
+      (id,chr,strand,seq,q1,start_pos,qStart,qEnd,tStart,tEnd,num_exons,\
+      str(qExonSizes)[1:-1].replace(' ',''),str(qStarts)[1:-1].replace(' ',''),\
+      str(qEnds)[1:-1].replace(' ',''),str(tExonSizes)[1:-1].replace(' ',''),\
+      str(tStarts)[1:-1].replace(' ',''),str(tEnds)[1:-1].replace(' ',''))
 
       out_fh.write(new_line)
 
index adcfeb8..85a2529 100644 (file)
@@ -7,7 +7,7 @@ from compile_dataset import compile_d
 
 #filtered_fn = '/fml/ag-raetsch/share/projects/qpalma/solexa/allFilteredReads_20_03_2008'
 
-filtered_fn = '/fml/ag-raetsch/share/projects/qpalma/solexa/splicedReads'
+filtered_fn = '/fml/ag-raetsch/share/projects/qpalma/solexa/allReads.pipeline.perm'
 remapped_fn = '/fml/ag-raetsch/share/projects/qpalma/solexa/map.vm_05_04_2008_tmp'
 
 compile_d(Conf.gff_fn,Conf.dna_flat_fn,filtered_fn,remapped_fn,Conf.tmp_dir,'dataset_remapped_test_new',True)
diff --git a/scripts/evaluateVmatch.py b/scripts/evaluateVmatch.py
new file mode 100644 (file)
index 0000000..1fd6432
--- /dev/null
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import sys
+import pdb
+import os
+import os.path
+
+
+def compare_alignments(aln1,aln2):
+   return 
+   
+
+def compare_all_alignments(reads_fn,vmatch_result_dir):
+   read_positions = {}
+
+   vmatch_correct_ctr = 0
+
+   for line in open(reads_fn):
+      line = line.strip()
+      slist = line.split()
+      id = int(slist[0])
+      start_pos = int(slist[10])
+      end_pos = int(slist[13])
+
+      read_positions[id] = (start_pos,end_pos)
+
+   for line in open(vmatch_result_dir):
+      line = line.strip()
+      slist = line.split()
+   
+      id = int(slist[0])
+      vmatch_start_pos = int(slist[2])
+
+      start_pos,end_pos = read_positions[id]
+
+      if vmatch_start_pos == start_pos:
+         vmatch_correct_ctr += 1
+   
+
+if __name__ == '__main__':
+   reads_fn          = ''
+   vmatch_result_dir = ''
+