def get_read_pos_info(line): read = Read.from_str(line) pos_array = [(read.RNAME, read.POS)] if "SA" in read.tags: for SA_read in read.SA_reads: pos_array.append((SA_read.RNAME, SA_read.POS)) return read.QNAME, pos_array
def gather_result(q, pipe, has_tag=None): for line in pipe: read = Read.from_str(line) if type(has_tag) == list: flag = True for tag in has_tag: if not tag in read.tags: flag = False break if flag: q.put(read) elif type(has_tag) == str: if has_tag in read.tags: q.put(read) else: q.put(read)