trviz.decomposer

Module Contents

Classes

Decomposer

class trviz.decomposer.Decomposer(mode='DP')
decompose(sequence, motifs, **kwargs)

Decompose sequence into motifs :param sequence: a string of tandem repeat sequence :param motifs: a set of motifs to be used for decomposition :param kwargs: keyword arguments for decomposer :return: decomposed sequence

static _decompose_dp(sequence, motifs, **kwargs) List

Decompose sequence into motifs using dynamic programming

Parameters
  • sequence – a string of VNTR sequence

  • motifs – a list of motif strings composed of nucleotide strings

  • **kwargs

valid keywords are the following: match_score: a score for match mismatch_score: a score for mismatch min_score_threshold: a minimum score of the alignment.

Returns

A list of decomposed motifs

static _build_repeat_finder_hmm(motif, copies=1, has_flanking_sequence=False)
_decompose_hmm(sequence, consensus_motif, **kwargs)

Decompose sequence into motifs using a HMM :param sequence: a string of VNTR sequence :param consensus_motif: A motif sequence :param **kwargs:

  1. repeat_count: If not specified, use estimated repeat count based on the sequence and motif length

  2. has_flanking_sequence: If true, use additional nodes in the HMM to identify flanking regions

  3. verbose

Returns

A list of decomposed motifs