biopython v1.71.0 Bio.NeuralNetwork.Gene.Motif.MotifFinder

Find motifs in a set of Sequence Records.

Link to this section Summary

Functions

Initialize a finder to get motifs

Add a motif to the given dictionary

Return a dictionary with information on motifs

Find all motifs of the given size in the passed SeqRecords

Find motifs in two sets of records and return the differences

Link to this section Functions

Initialize a finder to get motifs.

Arguments:

  • alphabet_strict - Whether or not motifs should be restricted to having all of there elements within the alphabet of the sequences. This requires that the Sequences have a real alphabet, and that all sequences have the same alphabet.

Add a motif to the given dictionary.

Link to this function _get_motif_dict()

Return a dictionary with information on motifs.

This internal function essentially does all of the hard work for finding motifs, and returns a dictionary containing the found motifs and their counts. This is internal so it can be reused by find_motif_differences.

Find all motifs of the given size in the passed SeqRecords.

Arguments:

  • seq_records - A list of SeqRecord objects which the motifs will be found from.
  • motif_size - The size of the motifs we want to look for.

Returns: A PatternRepository object that contains all of the motifs (and their counts) found in the training sequences).

Link to this function find_differences()

Find motifs in two sets of records and return the differences.

This is used for finding motifs, but instead of just counting up all of the motifs in a set of records, this returns the differences between two listings of seq_records.

Arguments:

  • first_records, second_records - Two listings of SeqRecord objects to have their motifs compared.
  • motif_size - The size of the motifs we are looking for.

Returns: A PatternRepository object that has motifs, but instead of their raw counts, this has the counts in the first set of records subtracted from the counts in the second set.