msmu._tools._dea.PermutationTest
Dea
Dea()
Class to perform Differential Expression Analysis (DEA) using permutation tests. This class is used to compare two groups of data (control and experimental) and calculate statistics such as median differences, fold changes, and p-values.
de_available
property
writable
de_available
Check if DEA is available based on the number of samples in control and experimental groups. Returns True if DEA is available, False otherwise.
PermutationTest
PermutationTest(ctrl_arr, expr_arr, n_resamples, force_resample, fdr)
Bases: Dea
Class to perform permutation tests on two groups of data (control and experimental). Parameters
ctrl_arr : np.ndarray Array of control group data (n_features x n_samples_ctrl). expr_arr : np.ndarray Array of experimental group data (n_features x n_samples_expr). n_resamples : int Number of resamples for the permutation test. force_resample : bool If True, forces resampling even if the number of resamples exceeds the number of combinations.
Attributes
ctrl_arr : np.ndarray Control group data. expr_arr : np.ndarray Experimental group data. possible_combination_count : int Total number of possible combinations of control and experimental samples. permutation_method : str Method used for permutation (exact or randomised). n_resamples : int Number of resamples for the permutation test. force_resample : bool If True, forces resampling even if the number of resamples exceeds the number of combinations.
PermutationTestResult
dataclass
PermutationTestResult(permutation_method, statistic, ctrl, expr, features, median_ctrl, median_expr, pct_ctrl, pct_expr, log2fc, p_value, q_value, fc_pct_1, fc_pct_5)
Data class to hold the results of a permutation test. Attributes: - permutation_method: Method used for permutation (exact or randomised). - statistic: The statistic used for the test (e.g., t-test, wilcoxon, median_diff). - features: Array of feature names (e.g., proteins, ptm sites). - median_ctrl: Median values for control group. - median_expr: Median values for experimental group. - pct_ctrl: Percentage of non-missing values in control group. - pct_expr: Percentage of non-missing values in experimental group. - log2fc: Log2 fold change values. - p_value: P-values for the permutation test. - fc_pct_1: log2fc cutoff at 1%. - fc_pct_5: log2fc cutoff at 5%.