+ added two scripts for the psl2gff step
[qpalma.git] / tools / plot_param.py
index 90bf300..6a43fd5 100644 (file)
@@ -26,7 +26,8 @@ def plot_param(filename,train_with_intronlengthinformation=1):
     """
     assert(Configuration.mode == 'using_quality_scores')
     param = cPickle.load(open(filename))
-    [h,d,a,mmatrix,qualityPlifs] = set_param_palma(param,train_with_intronlengthinformation)
+    [h,d,a,mmatrix,qualityPlifs] =\
+    set_param_palma(param,train_with_intronlengthinformation,None)
 
     # construct the substitution matrix using the last value of qualityPlif
     substmat = numpy.matlib.zeros((1,(Configuration.estPlifs+1)*Configuration.dnaPlifs))
@@ -52,6 +53,9 @@ def plot_param(filename,train_with_intronlengthinformation=1):
     pylab.yticks( numpy.arange(5.5,0,-1), ('-', 'A', 'C', 'G', 'T', 'N') )
     pylab.xlabel('DNA',fontsize=20)
     pylab.ylabel('EST',fontsize=20)
+
+    pylab.savefig('matrix.eps')
+    pylab.clf()
     
     # plot donor and acceptor transformations
     pylab.figure()
@@ -61,23 +65,33 @@ def plot_param(filename,train_with_intronlengthinformation=1):
     pylab.ylabel('transition score',fontsize=20)
     pylab.legend()
 
+    pylab.savefig('donacc.eps')
+    pylab.clf()
+
     # plot intron length transformations
     pylab.figure()
     pylab.plot(h.limits,h.penalties,'k+-')
     pylab.xlabel('intron length',fontsize=20)
     pylab.ylabel('transition score',fontsize=20)
 
+    pylab.savefig('intron_len.eps')
+    pylab.clf()
+
     # plot quality score transformations
     pylab.figure()
     for pos,plif in enumerate(qualityPlifs):
-      #if pos in [1,8,15,22]:
-      #   pylab.plot(plif.limits,plif.penalties,'b^-',hold=True)
+      if pos in [1,8,15,22,7,13,19]:
+      #if pos in [3,9,21]:
+         pylab.plot(plif.limits,plif.penalties,'b^-',hold=True)
 
-      pylab.plot(plif.limits,plif.penalties,'b^-',hold=True)
+      #pylab.plot(plif.limits,plif.penalties,'b^-',hold=True)
     pylab.xlabel('quality value',fontsize=20)
     pylab.ylabel('transition score',fontsize=20)
 
-    pylab.show()
+    pylab.savefig('quality.eps')
+    pylab.clf()
+
+    #pylab.show()
     
 
 if __name__ == '__main__':