def _align(record): records = (record, _rc(record)) if do_revcomp else (record, ) score, ref_, record = max( (aln(ref.value.decode('utf-8'), record) for record in records), key=itemgetter(0)) record_ = compute_cigar(ref_, record, ref_name) return score, record_
def iterate(records): for record in records: if ('CIGAR' in record.annotations and 'position' in record.annotations): yield record else: yield compute_cigar(reference, record, new_style)
def _align(record): records = (record, _rc(record)) if do_revcomp else (record,) score, ref_, record = max( (aln(ref.value.decode('utf-8'), record) for record in records), key=itemgetter(0) ) record_ = compute_cigar(ref_, record, ref_name) return score, record_
def _align(record, aln, ref, ref_name, do_revcomp): records = (record, _rc(record)) if do_revcomp else (record,) score, ref_, record = max( (aln(ref, record) for record in records), key=itemgetter(0) ) record_ = compute_cigar(ref_, record, ref_name) return score, record_
def iterate(records): for record in records: if ('CIGAR' in record.annotations and 'position' in record.annotations): yield record elif reference is not None and len(record) == len(reference): yield compute_cigar(reference, record, new_style=new_style) else: msg = 'provide aligned SeqRecords with their reference or position- and CIGAR-annotated SeqRecords' raise RuntimeError(msg)
def allseqs(records): yield compute_cigar(reference, reference) for record in records: print(record) yield record
def allseqs(records): yield compute_cigar(reference, reference) for record in records: yield record