create#

lightmotif.create(sequences, *, protein=False, name=None)#

Create a new motif from an iterable of sequences.

All sequences must have the same length, and must contain only valid alphabet symbols (ATGCN for nucleotides, ACDEFGHIKLMNPQRSTVWYX for proteins).

Parameters:
  • sequences (iterable of str) – The sequences to use to build the count matrix for the motif.

  • protein (bool) – Pass True to build a protein motif. Defaults to False.

Example

>>> sequences = ["TATAAT", "TATAAA", "TATATT", "TATAAT"]
>>> motif = lightmotif.create(sequences)
Returns:

Motif – The motif corresponding to the given sequences.

Raises:

ValueError – When any of the sequences contain an invalid character, or when the sequence lengths are not consistent.