bioin.motif.count_with_pseudocount¶
-
bioin.motif.count_with_pseudocount(motifs)[source]¶ Count the number of nucleotides (4 types: ACGT) column wise from a motifs matrix, then add 1 to each position, i.e. pseudocount.
Parameters: motifs – 2D matrix, matrix of motifs in genome. Returns: dictionary, the count matrix of Motifs with pseudocounts as a dictionary of lists. Examples
Takes a list of strings motifs as input and returns the pseudocount matrix of motifs (as a dictionary of lists.)
>>> motifs = ['AACGTA', 'CCCGTT', 'CACCTT', 'GGATTA', 'TTCCGG'] >>> pseudocounts_dict = count_with_pseudocount(motifs) >>> pseudocounts_dict {'A': [2, 3, 2, 1, 1, 3], 'C': [3, 2, 5, 3, 1, 1], 'G': [2, 2, 1, 3, 2, 2], 'T': [2, 2, 1, 2, 5, 3]}