diff seg2matrix/mapSegToGeneMatrix.py @ 54:59dbe857f5d4

introduce normal_CNV parameter
author jingchunzhu
date Thu, 17 Sep 2015 22:03:04 -0700
parents 728eda331f07
children bf57076e27b9
line wrap: on
line diff
--- a/seg2matrix/mapSegToGeneMatrix.py	Thu Sep 17 15:38:53 2015 -0700
+++ b/seg2matrix/mapSegToGeneMatrix.py	Thu Sep 17 22:03:04 2015 -0700
@@ -7,12 +7,14 @@
 
 if __name__ == "__main__":
     
-    if len(sys.argv[:])!=4:
-        print "python mapSegToGeneMatrix.py genomicsSegmentIn refGene GeneLevelMatrixOut\n"
+    if len(sys.argv[:])!=5:
+        print "python mapSegToGeneMatrix.py genomicsSegmentIn refGene GeneLevelMatrixOut NORMAL_CNV\n"
         sys.exit()
     refgene = CGData.RefGene.RefGene()
     refgene.load( sys.argv[2] )
 
+    NORMAL_CNV=sys.argv[4]
+
     #* b for cnv 
     probeMapper = CGData.GeneMap.ProbeMapper('b')
 
@@ -74,7 +76,7 @@
         for sample in sample_list:
             list = matrix[samples[sample]][genes[gene]]
             if len(list)==0:
-                average =0
+                average = NORMAL_CNV
             elif len(list)==1:
                 average = list[0]
                 average =round(average,3)