itpseq.Sample.DE#

Sample.DE(pos=None, join=False, quiet=True, filter_size=True, multi=True, n_cpus=None, raw=False, _nocache=False, **kwargs)[source]#

Computes the differential expression between the sample and its reference.

Parameters:
  • pos (str) – Ribosome positions to consider to compute the differential expression.

  • join (bool, optional) – If True, joins the DE results back to the original df. Defaults to False.

  • quiet (bool, optional) – If True, suppresses the console output of the pydeseq2 library. Defaults to True.

  • multi (bool, optional) – Whether to compute DE with a specific contrast (cond vs. ref). Defaults to True.

  • n_cpus (int, optional) – The number of CPUs to utilize for parallel processing. Defaults to the total number of available CPUs.

  • filter_size (bool) – Only considers reads for which an amino acid is present in all target positions.

Returns:

DataFrame of the differential expression statistics with a row per motif.

Return type:

DataFrame

Examples

Compute the differential expression for positions E-P
>>> sample.DE('E:P')
        baseMean  log2FoldChange     lfcSE       stat        pvalue          padj  log10pvalue  log10padj
QK   5537.704183        0.778031  0.073280  10.617238  2.477833e-26  7.582170e-24    25.605928  23.120206
VI   6874.891363        0.295160  0.371018   0.795542  4.262985e-01  7.718778e-01     0.370286   0.112451
MY    747.538317        0.263705  0.074294   3.549477  3.859965e-04           NaN     3.413417        NaN
YY   2216.501684        0.259860  0.068213   3.809545  1.392226e-04  6.086018e-03     3.856290   2.215667
WM    200.446070        0.226720  0.111555   2.032371  4.211614e-02           NaN     1.375551        NaN
..           ...             ...       ...        ...           ...           ...          ...        ...
TP  15256.234795       -0.255940  0.061793  -4.141886  3.444618e-05  2.635133e-03     4.462859   2.579197
mK  10824.395771       -0.308538  0.210353  -1.466765  1.424400e-01  4.737680e-01     0.846368   0.324434
EP   8950.363473       -0.321266  0.068514  -4.689045  2.744828e-06  2.799725e-04     5.561485   3.552885
PP  20880.530910       -0.372203  0.078851  -4.720365  2.354220e-06  2.799725e-04     5.628153   3.552885
KK   7645.111411       -0.390365  0.096140  -4.060381  4.899280e-05  2.998359e-03     4.309868   2.523116
[420 rows x 8 columns]