Sample mutations from MSA position-specific distributions
This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.
View sourceGenerator that samples mutations from MSA position-specific distributions.This generator computes empirical probability distributions for each position
in a multiple sequence alignment, then mutates proposal sequences by sampling
from these distributions.
Configuration object for MSAGenerator.This class defines configuration parameters for the MSA generator, which samples
mutations from position-specific probability distributions derived from a multiple
sequence alignment.
>>> from proto_language.generator import MSAGenerator, MSAGeneratorConfig>>> from proto_language.core import Segment>>> from proto_tools.entities.msa import MSA>>> config = MSAGeneratorConfig(... msa=MSA(aligned_sequences=["MVLS", "AVLS", "MVLS"]),... num_mutations=1,... )>>> gen = MSAGenerator(config)>>> segment = Segment(sequence="MVLS", sequence_type="protein")>>> gen.assign(segment)>>> gen.sample() # Position 0 has 2/3 chance of M, 1/3 chance of A