bioin.replication.faster_symbol_array

bioin.replication.faster_symbol_array(genome, symbol)[source]

A faster calculation method for counting a symbol in genome.

Parameters:
  • genome (str) – a DNA string as the search space.
  • symbol (str) – the single base to query in the search space.
Returns:

Dictionary, a dictionary, position-counts pairs of symbol in each genome sliding window.

Examples

The symbol array for genome equal to “AAAAGGGG” and symbol equal to “A”.

>>> genome = 'AAAAGGGG'
>>> symbol = 'A'
>>> position_symbolcount_dict = symbol_array(genome, symbol)
>>> position_symbolcount_dict
    {0: 4, 1: 3, 2: 2, 3: 1, 4: 0, 5: 1, 6: 2, 7: 3}