-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small fixes #25
Small fixes #25
Conversation
If global set_output = pandas we are mixing numpy arrays with pandas and get errors.
@@ -72,7 +73,9 @@ def _get_norm_factors(self, X: Numeric2D) -> Numeric1D: | |||
:param X: Expression raw count matrix (n_samples, n_features) | |||
""" | |||
X = remove_zero_genes(X) | |||
lib_size = LibrarySize().fit_transform(X) | |||
# Make sure that global set_config(transform_output="pandas") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary? It's kind off ugly to break the intended sklearn logic.
@@ -72,7 +73,9 @@ def _get_norm_factors(self, X: Numeric2D) -> Numeric1D: | |||
:param X: Expression raw count matrix (n_samples, n_features) | |||
""" | |||
X = remove_zero_genes(X) | |||
lib_size = LibrarySize().fit_transform(X) | |||
# Make sure that global set_config(transform_output="pandas") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary? It's kind off ugly to break the intended sklearn logic. @mzganec, have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you find this approach better?
lib_size = LibrarySize().fit_transform(X)
...
return upper_quartiles / np.array(lib_size).flatten()
@JureZmrzlikar If we go with this solution, we need to fix effective_lib_size
in transform
as well.
lib_size = LibrarySize().fit_transform(X)
effective_lib_size = np.array(lib_size).flatten() * factors
No description provided.