comparison 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
comparison
equal deleted inserted replaced
50:b6f5d2d1b047 51:728eda331f07
33 count =0 33 count =0
34 34
35 while 1: 35 while 1:
36 count = count+1 36 count = count+1
37 #print count 37 #print count
38 line =string.strip(fin.readline()) 38 line =fin.readline()
39 if line =="": 39 if line =="": # end of file
40 break 40 break
41 if count ==1:
42 continue #ignore the first line
43 line = string.strip(line)
44 if line == "": # empty line
45 continue
41 if line[0]=="#": 46 if line[0]=="#":
42 continue 47 continue
43 tmp = string.split(line,"\t") 48 tmp = string.split(line,"\t")
44 if len(tmp)!= 6: 49 if len(tmp)!= 6:
45 continue 50 continue