Mercurial > repos > melissacline > ucsc_cancer_utilities
comparison seg2matrix/CGData/SegToMatrix.py @ 54:59dbe857f5d4
introduce normal_CNV parameter
| author | jingchunzhu |
|---|---|
| date | Thu, 17 Sep 2015 22:03:04 -0700 |
| parents | 8ef79bd0be9a |
| children |
comparison
equal
deleted
inserted
replaced
| 53:7de3db823f90 | 54:59dbe857f5d4 |
|---|---|
| 8 os.system("g++ -fPIC --shared "+ base +"/CsegToMatrix.cc -o "+ base +"/CsegToMatrix.so") | 8 os.system("g++ -fPIC --shared "+ base +"/CsegToMatrix.cc -o "+ base +"/CsegToMatrix.so") |
| 9 | 9 |
| 10 if os.path.exists(libFile): | 10 if os.path.exists(libFile): |
| 11 segLib = ctypes.cdll.LoadLibrary(libFile) | 11 segLib = ctypes.cdll.LoadLibrary(libFile) |
| 12 | 12 |
| 13 | 13 def seg_to_matrix(seg_handle, out_handle, NORMAL_CNV): |
| 14 def seg_to_matrix(seg_handle, out_handle): | |
| 15 """ | 14 """ |
| 16 Turn a segment file into a segmented matrix. | 15 Turn a segment file into a segmented matrix. |
| 17 | 16 |
| 18 seg_handle -- CGData.GenomicSegment object | 17 seg_handle -- CGData.GenomicSegment object |
| 19 out_handle -- File handle to write to | 18 out_handle -- File handle to write to |
| 27 def printback(s): | 26 def printback(s): |
| 28 out_handle.write(s) | 27 out_handle.write(s) |
| 29 return 0 | 28 return 0 |
| 30 | 29 |
| 31 printbackTYPE = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_char_p) | 30 printbackTYPE = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_char_p) |
| 32 segLib.print_matrix(s, t, printbackTYPE(printback)) | 31 segLib.print_matrix(s, t, printbackTYPE(printback), NORMAL_CNV) |
