Function init

Source
pub fn init<'py>(_py: Python<'py>, m: &Bound<'_, PyModule>) -> PyResult<()>
Expand description

PyO3 bindings to lightmotif, a library for fast PWM motif scanning.

The API is similar to the Bio.motifs module from Biopython on purpose.

Note: Arbitrary alphabets cannot be configured, as lightmotif uses constant definitions of alphabets that cannot be changed at runtime. The different sequences are treated as nucleotide sequences. To use a protein sequence instead, most classes and functions have a protein keyword True::

    >>> sequences = ["PILFFRLK", "KDMLKEYL", "PFRLTHKL"]
    >>> lightmotif.create(sequences)
    Traceback (most recent call last):
      ...
    ValueError: Invalid symbol in sequence
    >>> lightmotif.create(sequences, protein=True)
    <lightmotif.lib.Motif object at ...>