INNER CODE UNIT · Python

_check_seq_lengths_same

sanger-pathogens/ariba · ariba/aln_to_metadata.py:62

    def _check_seq_lengths_same(cls, seqs):
        sequence_lengths = set([len(x) for x in seqs.values()])
        if len(sequence_lengths) > 1:
            raise Error('Input sequences must all be the same length. Cannot continue. Lengths found: ' + ','.join([str(x) for x in sequence_lengths]))
        return len(sequence_lengths) == 1


    @classmethod
    def _insertion_coords(cls, sequence):
        insertions = []
        regex = re.compile('-+')
        for m in regex.finditer(sequence.seq):
             insertions.append(pyfastaq.intervals.Interval(m.span()[0], m.span()[1] - 1))
        return insertions


    @classmethod
    def _make_unpadded_insertion_coords(cls, unpadded_sequences):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…