ClearMap.Analysis.Tools package¶
Analysis and statistics tools not in standard python packages.
ClearMap.Analysis.Tools.Extrapolate module¶
Method to extend interpolation objects to constantly / linearly extrapolate.
-
extrap1d
(x, y, interpolation='linear', exterpolation='constant')[source]¶ Interpolate on given values and extrapolate outside the given data
Parameters: - x (numpy.array) – x values of the data to interpolate
- y (numpy.array) – y values of the data to interpolate
- interpolation (Optional[str]) – interpolation method, see kind of scipy.interpolate.interp1d, default: “linear”
- exterpolation (Optional[str]) – interpolation method, either “linear” or “constant”
Returns: (function) – inter- and extra-polation function
-
extrap1dFromInterp1d
(interpolator, exterpolation='constant')[source]¶ Extend interpolation function to extrapolate outside the given data
Parameters: - interpolator (function) – interpolating function, see e.g. scipy.interpolate.interp1d
- exterpolation (Optional[str]) – interpolation method, either “linear” or “constant”
Returns: (function) – inter- and extra-polation function
ClearMap.Analysis.Tools.MultipleComparisonCorrection module¶
Correction methods for multiple comparison tests
-
correctPValues
(pvalues, method='BH')[source]¶ Corrects p-values for multiple testing using various methods
Parameters: - pvalues (array) – list of p values to be corrected
- method (Optional[str]) – method to use: BH = FDR = Benjamini-Hochberg, B = FWER = Bonferoni
References
Notes
-
estimateQValues
(pvalues, m=None, pi0=None, verbose=False, lowMemory=False)[source]¶ Estimates q-values from p-values
Parameters: - pvalues (array) – list of p-values
- m (int or None) – number of tests. If None, m = pvalues.size
- pi0 (float or None) – estimate of m_0 / m which is the (true null / total tests) ratio, if None estimation via cubic spline.
- verbose (bool) – print info during execution
- lowMemory (bool) – if true use low memory version
Notes
- The q-value of a particular feature can be described as the expected proportion of false positives among all features as or more extreme than the observed one
- The estimated q-values are increasing in the same order as the p-values
References
- Storey and Tibshirani, 2003
- modified from https://github.com/nfusi/qvalue
ClearMap.Analysis.Tools.StatisticalTests module¶
Some statistics tests not in standard python packages
-
testCramerVonMises2Sample
(x, y)[source]¶ Computes the Cramer von Mises two sample test.
This is a two-sided test for the null hypothesis that 2 independent samples are drawn from the same continuous distribution.
Parameters: - x, y (sequence of 1-D ndarrays) – two arrays of sample observations
- assumed to be drawn from a continuous distribution, sample sizes
- can be different
Returns: (float, float) – T statistic, two-tailed p-value
References
- modified from https://github.com/scipy/scipy/pull/3659