MediatorLocalSequenceMixin

class MediatorLocalSequenceMixin(database, seq_method='refseq', seq_subs=False, seq_aligner=None, seq_force_align=False, seq_refrep='tid', seq_filter_method=None, seq_filter_value=None, **kwargs)[source]

Mixin class for local mediator that handle sequence data.

Mixin class constructor for MediatorLocalSequenceMixin

Parameters
  • database (pmaf.database._metakit.DatabaseSequenceMetabase) – Instance of DatabaseBase and DatabaseSequenceMixin

  • seq_method (str) – Method to process sequences. Can be “refseq” to get sequences as-is or “consensus” to retrieve consensus sequence for multiple matches

  • seq_subs (bool) – Whether mediator should include subs

  • seq_aligner (Optional[pmaf.alignment._multiple._metakit.MultiSequenceAlignerBackboneMetabase]) – Sequence aligner instance of MultiSequenceAlignerBackboneMetabase

  • seq_force_align (bool) – Force MSA using given aligner even if local database client contain pre-aligned sequences that can speed-up “consensus” estimation

  • seq_refrep (str) – Taxonomy lookup level. Can be either “tid” for tids or “rid” for rids

  • seq_filter_method (Optional[str]) – Method to filter sequences from multiple matching identifiers. Can be either “random” or “tab”, which selects sequences with least tab (ongoing development)`

  • seq_filter_value (Optional[str]) – Complementary value for the seq_filter_method.

  • kwargs (Any) – Compatibility

Attributes

SEQ_FILTER_METHODS

client

Current active client that mediator mediates.

configs

All current configs.

state

State of the mediator(client)

Methods

get_identifier_by_sequence(docker, factor, …)

meta private

get_sequence_by_identifier(docker, factor, …)

Get sequence data that matches identifiers in docker within local database client.

reconfig(name, value)

Set config name to value

verify_factor(factor)

Verify/validate compatibility of the current mediator and factor