diffxpy.api.test.t_test

diffxpy.api.test.t_test(data: Union[anndata._core.anndata.AnnData, anndata._core.raw.Raw, numpy.ndarray, scipy.sparse.csr.csr_matrix, batchglm.models.base.input.InputDataBase], grouping, gene_names: Optional[Union[numpy.ndarray, list]] = None, sample_description: Optional[pandas.core.frame.DataFrame] = None, is_logged: bool = False, is_sig_zerovar: bool = True)

Perform Welch’s t-test for differential expression between two groups on adata object for each gene.

Parameters
  • data – Array-like, or anndata.Anndata object containing observations. Input data matrix (observations x features) or (cells x genes).

  • grouping

    str, array

    • column in data.obs/sample_description which contains the split of observations into the two groups.

    • array of length num_observations containing group labels

  • gene_names – optional list/array of gene names which will be used if data does not implicitly store these

  • sample_description – optional pandas.DataFrame containing sample annotations

  • is_logged – Whether data is already logged. If True, log-fold changes are computed as fold changes on this data. If False, log-fold changes are computed as log-fold changes on this data.

  • is_sig_zerovar – Whether to assign p-value of 0 to a gene which has zero variance in both groups but not the same mean. If False, the p-value is set to np.nan.