Esempio n. 1
0
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_
Esempio n. 2
0
 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)
Esempio n. 3
0
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_
Esempio n. 4
0
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_
Esempio n. 5
0
 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)
Esempio n. 6
0
 def allseqs(records):
     yield compute_cigar(reference, reference)
     for record in records:
         print(record)
         yield record
Esempio n. 7
0
 def allseqs(records):
     yield compute_cigar(reference, reference)
     for record in records:
         yield record