itpseq.Sample.get_counts_ratio#

Sample.get_counts_ratio(pos=None, factor=1000000, exclude_empty=True, **kwargs)[source]#

Outputs the result of get_counts for the sample and its reference and add extra columns: the normalized averages and the sample/reference ratio.

The average is normalized for a fixed number of counts (1 million by default).

If the sample does not have a reference, this will not compute a ratio.

Parameters:
  • pos (str, optional) – Position to consider when counting the reads (see get_counts).

  • factor (float, optional) – The number of reads used to normalize the counts.

  • exclude_empty (bool, optional) – Exclude the rows with incomplete peptides.

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

Return type:

DataFrame

Examples

Get the counts, average counts and ratio for each motif in the E-P-A sites
>>> sample.get_counts_ratio(pos='E:A')
        noa.1     noa.2     noa.3  sample.1  sample.2  sample.3           noa        sample     ratio
 m*  445141.0  256474.0  142811.0  254850.0  107060.0  258338.0  89401.143052  75644.325430  0.846123
 mS   91268.0   62794.0   35692.0   54993.0   20419.0   50959.0  20378.661544  15329.317262  0.752224
  m   72454.0   49090.0   33596.0   52640.0   17860.0   34748.0  16741.602393  12675.370806  0.757118
..        ...       ...       ...       ...       ...       ...           ...           ...       ...
WMM       NaN       2.0       2.0       1.0       NaN       8.0      0.741297      1.658007  2.236630
WMW       NaN       1.0       2.0       2.0       NaN       2.0      0.557864      0.698816  1.252663
MWW       NaN       NaN       2.0       NaN       4.0       2.0      0.748862      1.261906  1.685098
[8842 rows x 9 columns]