itpseq.Replicate.get_counts#

Replicate.get_counts(pos=None, **kwargs)[source]#

Counts the number of reads for each motif or combination of amino-acid/position.

Parameters:
  • pos (str, optional) – Position to consider when counting the reads. If None is passed, then this returns a DataFrame with the counts of each amino-acid per position.

  • kwargs (optional) – Optional parameters to pass to load_data (min_peptide, max_peptide, how, limit, sample)

Returns:

Returns a DataFrame is pos is None, otherwise a Series.

Return type:

Series or DataFrame

Examples

Count the number of reads for each amino-acid/position combination
>>> replicate.get_counts()
           -8         -7         -6  ...        -1         0         1
    2879961.0  2658485.0  2449526.0  ...  793143.0   52640.0       NaN
*         NaN        NaN        NaN  ...       NaN       NaN  910137.0
A         NaN    12240.0    25225.0  ...  111369.0  134995.0  107591.0
..        ...        ...        ...  ...       ...       ...       ...
W         NaN     2686.0     5059.0  ...   17643.0   28095.0   21577.0
Y         NaN     9522.0    19296.0  ...   69671.0   81462.0   93099.0
m    197624.0   221476.0   208959.0  ...  409289.0  740503.0   52640.0
[23 rows x 10 columns]
Count the number of reads for each motif in the E-P-A sites
>>> replicate.get_counts(pos='E:A')