comparison parse_aln.py @ 16:0e820310d4dc draft

Uploaded
author petr-novak
date Wed, 04 Sep 2019 06:45:18 -0400
parents 3151a72a6671
children
comparison
equal deleted inserted replaced
15:3151a72a6671 16:0e820310d4dc
39 action="store") 39 action="store")
40 return parser.parse_args() 40 return parser.parse_args()
41 41
42 42
43 def get_header(f): 43 def get_header(f):
44 aln_header = ". : . : . : . : . : . :" 44 aln_header = " . : . : . : . : . : . :"
45 contig_lead = "******************" 45 contig_lead = "******************"
46 aln_start = -1 46 aln_start = -1
47 while True: 47 while True:
48 line = f.readline() 48 line = f.readline()
49 if not line: 49 if not line:
61 61
62 def segment_start(f): 62 def segment_start(f):
63 pos = f.tell() 63 pos = f.tell()
64 line = f.readline() 64 line = f.readline()
65 # detect next contig or end of file 65 # detect next contig or end of file
66 if "********" in line or line == "": 66 if "********" in line or line == "" or "Number of segment pairs = " in line:
67 segment = False 67 segment = False
68 else: 68 else:
69 segment = True 69 segment = True
70 f.seek(pos) 70 f.seek(pos)
71 return segment 71 return segment