bioin.motif.consensus_motif

bioin.motif.consensus_motif(motifs)[source]

Compute the consensus string of a set of k-mers motifs.

Parameters:motifs (list) – list of strings, a set of k-mers motifs.
Returns:String, a consensus string of motifs.

Examples

Takes a list of strings motifs as input and then return the string that contain the most frequent element of each column of the matrix.

>>> motifs = ['AACGTA', 'CCCGTT', 'CACCTT', 'GGATTA', 'TTCCGG']
>>> consensus = consensus_motif(motifs)
>>> consensus
    'CACCTA'