Last active
October 11, 2020 10:20
-
-
Save monogenea/ddfa611631a757f281ac095a7745463b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove expression features with > 50% zero-valued expression levels | |
is_expressed = np.apply_along_axis(lambda x: np.mean(x == 0) < .5, arr=matrix, axis=0) | |
matrix = matrix[:,is_expressed.tolist()] | |
# Log2-transform | |
matrix = np.log2(matrix.to_numpy() + 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment