bioin.motif.probability_profile

bioin.motif.probability_profile(text, motif_profile)[source]

Calculate the probability of a string (i.e. text) given a motif profile matrix.

Parameters:
  • text (str) – a text string probability given the profile matrix.
  • motif_profile (dict) – represent the probability of occurence of each nucleotide for each column.
Returns:

Float, the probability of text calculated from profile

Examples

Calculate the probability for the given text string based on the profile matrix.

>>> text = "ACGGGGATTACC"
>>> motif_profile = {'A': [0.2, 0.2, 0.0, 0.0, 0.0, 0.0, 0.9, 0.1, 0.1, 0.1, 0.3, 0.0], 'C': [0.1, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4, 0.1, 0.2, 0.4, 0.6], 'G': [0.0, 0.0, 1.0, 1.0, 0.9, 0.9, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0], 'T': [0.7, 0.2, 0.0, 0.0, 0.1, 0.1, 0.0, 0.5, 0.8, 0.7, 0.3, 0.4]}
>>> pr = (text, motif_profile) # probability
    0.000839808