def __iter__(self): line = self._handle.readline() if not line.startswith(term_tag): read_until(self._handle, term_tag) while 1: yield self.next()
def __iter__(self): line = self._handle.readline() if not line.startswith(term_tag): read_until(self._handle, term_tag) while 1: yield next(self)
def __iter__(self): fp = must_open(self.filename) while True: read_until(fp, "-----") nextline = fp.readline() nextline = fp.readline() if not nextline.strip(): break d = DelLine(nextline) yield d
def __iter__(self): line = self._handle.readline() if not line.startswith(bac_tag): read_until(self._handle, bac_tag) for header, seq in read_block(self._handle, bac_tag): rec = FpcRecord() assert header.startswith(bac_tag) rec.bac_name = header.split('\"')[1] for line in seq: if line.startswith("Map"): rec.ctg_name = line.split('\"')[1] if "Left" in line: rec.map_left = line.split("Left")[1].split()[0] rec.map_left = int(float(rec.map_left)) if "Right" in line: rec.map_right = line.split("Right")[1].split()[0] rec.map_right = int(float(rec.map_right)) if line.startswith("Gel_number"): rec.gel_number = line.split()[-1] if line.startswith("Fp_number"): rec.fp_number = line.split()[-1] if line.startswith("Bands"): rec.bands = line.split()[-1] if line.startswith("match_to_cosmid"): rec.cosmid = line.split('\"')[1] rec.cosmid_match = line.split("_match_")[0] if line.startswith("Positive"): rec.probes.append(line.split('\"')[1]) if line.startswith("Fpc_remark"): rec.remark.append(line.split('\"')[1]) if line.startswith("Creation_date"): rec.cre_date = line.split('_date')[1].strip() if line.startswith("Modified_date"): rec.mod_date = line.split('_date')[1].strip() yield rec
def __init__(self, fh): line = fh.readline().strip() self.id = line.split()[0] if line else None read_until(fh, ">")