pycallingcards.tools.diff2group_bysample#

pycallingcards.tools.diff2group_bysample(adata_cc, name1, name2=None, peakname=None, test_method='binomtest', alternative='greater')[source]#

Comapare the peak difference between two groups for a specific peak by sample.

Parameters:
  • adata_cc (AnnData) – Annotated data matrix.

  • name1 (str) – The name of the first group.

  • name2 (Optional[str] (default: None)) – The name of the second group.

  • peakname (Optional[str] (default: None)) – The name of the peak used for comparing.

  • test_method (Optional[Literal['binomtest', 'binomtest2', 'fisher_exact']] (default: 'binomtest')) – [“binomtest”, “binomtest2”,”fisher_exact”]. binomtest uses binomial test, binomtest2 uses binomial test but stands on a different hypothesis of binomtest, fisher_exact uses fisher exact test.

  • alternative (Optional[Literal['two-sided', 'greater']] (default: 'greater')) – [‘two-sided’, ‘greater’]. If it has two samples, ‘two-sided’ is recommended. Otherwise, please use ‘greater’.

Return type:

Union[List[float], float]

Returns:

Pvalue for the specific hypothesis.

Example:

>>> import pycallingcards as cc
>>> adata_cc = cc.datasets.mouse_brd4_data(data="CC")
>>> cc.tl.diff2group_bysample(adata_cc,'F6_Brd4','M6_Brd4','chr1_4196845_4200095','fisher_exact')