biopython v1.71.0 Bio.NeuralNetwork.Gene.Schema.Schema

Deal with motifs that have ambiguity characters in it.

This motif class allows specific ambiguity characters and tries to speed up finding motifs using regular expressions.

This is likely to be a replacement for the Schema representation, since it allows multiple ambiguity characters to be used.

Link to this section Summary

Functions

Initialize with ambiguity information

Return a listing of all unambiguous letters allowed in motifs

Encode the passed motif as a regular expression pattern object

Return the location of ambiguous items in the motif

Return all non-overlapping motif matches in the query string

Return the number of ambiguous letters in a given motif

Find the number of non-overlapping times motif occurs in query

Link to this section Functions

Initialize with ambiguity information.

Arguments:

  • ambiguity_info - A dictionary which maps letters in the motifs to the ambiguous characters which they might represent. For example, {‘R’ : ‘AG’} specifies that Rs in the motif can match an A or a G. All letters in the motif must be represented in the ambiguity_info dictionary.
Link to this function all_unambiguous()

Return a listing of all unambiguous letters allowed in motifs.

Encode the passed motif as a regular expression pattern object.

Arguments:

  • motif - The motif we want to encode. This should be a string.

Returns: A compiled regular expression pattern object that can be used for searching strings.

Link to this function find_ambiguous()

Return the location of ambiguous items in the motif.

This just checks through the motif and compares each letter against the ambiguity information. If a letter stands for multiple items, it is ambiguous.

Return all non-overlapping motif matches in the query string.

This utilizes the regular expression findall function, and will return a list of all non-overlapping occurrences in query that match the ambiguous motif.

Link to this function num_ambiguous()

Return the number of ambiguous letters in a given motif.

Find the number of non-overlapping times motif occurs in query.