Mercurial > repos > melissacline > ucsc_cancer_utilities
diff seg2matrix/mapSegToGeneMatrix.py @ 51:728eda331f07
better handle of input
author | jingchunzhu@gmail.com |
---|---|
date | Thu, 17 Sep 2015 14:33:21 -0700 |
parents | 61f03b481b0d |
children | 59dbe857f5d4 |
line wrap: on
line diff
--- a/seg2matrix/mapSegToGeneMatrix.py Tue Aug 25 23:42:17 2015 -0700 +++ b/seg2matrix/mapSegToGeneMatrix.py Thu Sep 17 14:33:21 2015 -0700 @@ -35,9 +35,14 @@ while 1: count = count+1 #print count - line =string.strip(fin.readline()) - if line =="": + line =fin.readline() + if line =="": # end of file break + if count ==1: + continue #ignore the first line + line = string.strip(line) + if line == "": # empty line + continue if line[0]=="#": continue tmp = string.split(line,"\t")