orthrus.preprocessing namespace¶
Submodules¶
orthrus.preprocessing.batch_corrections module¶
-
class
orthrus.preprocessing.batch_corrections.Harmony¶ Bases:
object-
fit_transform(X, y)¶ A wrapper of Harmony algorithm implmented in harmonypy package see: https://github.com/slowkow/harmonypy
- Parameters
X (ndarray of shape (m, n))) – array of data, with m the number of observations in R^n.
y (ndarray of shape (m)) – vector of labels for the data. Assumed to be discrete; string or
labels are handled cleanly. (other) –
- Returns
Modified data matrix.
- Return type
(ndarray of shape (m, n)))
-
-
class
orthrus.preprocessing.batch_corrections.Limma¶ Bases:
object-
fit_transform(X, y)¶ A pure numpy implementation of the code found at:
https://github.com/chichaumiau/removeBatcheffect/blob/master/limma.py
based on our weak understanding of what the patsy package does and following along with the example in the link above. Their data comes from
https://github.com/brentp/combat.py
Note that we don’t have the capability to include an assumed model effect in the covariance_matrix as in Chichau’s version, but our approach is only to remove batch factors, then apply machine learning algo’s to the result. Making an initial assumption of a linear model in the phenotypes in preprocessing stage may not be appropriate depending on the machine learning tools used later in the pipeline.
- Parameters
X (ndarray of shape (m, n))) – array of data, with m the number of observations in R^n.
y (ndarray of shape (m)) – vector of labels for the data. Assumed to be discrete; string or
labels are handled cleanly. (other) –
- Returns
Modified data matrix.
- Return type
(ndarray of shape (m, n)))
There are options in the original limma.removeBatchEffect() code and corresponding limma_chichau() function (see in calcom/utils/limma.py) which aren’t implemented in this version.
-
orthrus.preprocessing.normalizations module¶
-
class
orthrus.preprocessing.normalizations.LogNormalizer¶ Bases:
object-
fit(X, y=None)¶
-
fit_transform(X, y=None)¶
-
transform(X)¶ Applies element wise log to the data. Any values that are negative infinity are set to zero after applying log.
- Parameters
X (ndarray of shape (m, n))) – array of data, with m the number of observations in R^n.
- Returns
Modified data matrix.
- Return type
(ndarray of shape (m, n)))
-