Mutation types

Mutation types are Mutation as well as INS, DEL, SUB for substitutions, and SNP for SNPs.

class co.mutation.DEL(pos, size=1)
class co.mutation.INS(pos, new_sequence, replace=False)
Parameters:
  • pos (int) – zero-based insertion index
  • new_sequence (str or Bio.Seq) – insertion sequence
  • replace (bool) – if True, eliminates the original character at the position. Some variant call formats keep the first character of the original sequence in the replacement sequence.
class co.mutation.Mutation(position, size=None, new_sequence='', end=None)

A Mutation(start, size, new_sequence) is similar to the two derived mutations:

DEL(start, size), INS(start, new_sequence)
Parameters:
  • position (int) – start index
  • size (int) – length of deletion
  • new_sequence (str, Component or Bio.Seq) – insertion sequence

Note

Mutation are stored as (position, size) pairs because (start, end) pairs do not allow for unambiguous zero-length mutations (i.e. insertions). It is possible to simulate an insertion by keeping one character of the original sequence, but that would introduce ambiguity to the exact site of the mutated sequence.

new_sequence

Replacement sequence inserted at position.

size

Length of the stretch of original sequence that is deleted at position.

position

Start index of the mutation, zero-based.

end

Computed end coordinate of the deletion. Use with caution.

is_deletion()

True if the size of the deletion is larger than the size of the insertion

is_insertion()

True if the size of the deletion is zero and new_sequence is not empty.

is_substitution()

True if the size of the deletion is equal to the size of the insertion.

new_size

The length of new_sequence

start

Identical to Mutation.position

class co.mutation.SNP(pos, new_nucleotide)
class co.mutation.SUB(pos, new_sequence)