Skip to content
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

Merged
merged 5 commits into from
Aug 10, 2023
Merged

Small fixes #25

merged 5 commits into from
Aug 10, 2023

Conversation

JureZmrzlikar
Copy link
Member

No description provided.

@@ -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")
Copy link
Member

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")
Copy link
Member

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.

Copy link

@mzganec mzganec Aug 9, 2023

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

@JureZmrzlikar JureZmrzlikar merged commit 019bf5f into genialis:main Aug 10, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants