bioin.motif.count_motif¶
-
bioin.motif.count_motif(motifs)[source]¶ Count the number of nucleotides (4 types: ACGT) column wise from a motifs matrix.
Parameters: motifs (list) – list of DNA strings, stack to constitute of the motifs matrix in genome. Returns: Dictionary, the count of each nucleotides in each column of the motifs matrix. Examples
Takes a list of strings motifs as input and returns the count matrix of motifs (as a dictionary of lists.)
>>> motifs = ['AACGTA', 'CCCGTT', 'CACCTT', 'GGATTA', 'TTCCGG'] >>> counts_dict = count_motif(motifs) >>> counts_dict {'A': [1, 2, 1, 0, 0, 2], 'C': [2, 1, 4, 2, 0, 0], 'G': [1, 1, 0, 2, 1, 1], 'T': [1, 1, 0, 1, 4, 2]}