Conversation
| ranksList: list[int], | ||
| runs: int, | ||
| ): | ||
| # Plots FMS when using different Pf2 components comparing the deviance transformed data vs how we usually normalize |
There was a problem hiding this comment.
Shouldn't this be able to reuse code that calculates the FMS?
There was a problem hiding this comment.
I rewrote this as I was thinking to calculate FMS between the factorization results using the deviance transform vs our previous normalization method, not by bootstrapping. In hindsight not sure if this will actually tell us much.
| # Plots FMS when using different Pf2 components | ||
| fmsLists = [] | ||
|
|
||
| for j in range(0, runs, 1): |
There was a problem hiding this comment.
Seems like this should go in a non-figure file. Also, separate calculation from plotting.
| dataX = pf2(X, rank, doEmbedding=False) | ||
|
|
||
| fmsLists = [] | ||
|
|
There was a problem hiding this comment.
Seems like this should go in a non-figure file. Also, separate calculation from plotting.
pf2rnaseq/imports.py
Outdated
|
|
||
| non_y_ij = n_i[:, None] - y_ij | ||
| mu_ij = n_i[:, None] * pi_j[None, :] | ||
| signs = np.sign(y_ij - mu_ij[None, :]) |
There was a problem hiding this comment.
@nbedanova I had an error in my code here. I thought I had passed along the fix, but apparently not. This is now correct, so see if it changes the results.
There was a problem hiding this comment.
Ah ok will redo analysis, thanks!
pf2rnaseq/imports.py
Outdated
| X.obs["condition_unique_idxs"] = X.obs["condition_unique_idxs"].astype("category") | ||
|
|
||
| # Pre-calculate gene means | ||
| X.var["means"] = np.zeros(X.shape[1]) |
There was a problem hiding this comment.
There shouldn't be a need to subtract off the mean with this transformation—it is already centered at the MLE.
There was a problem hiding this comment.
Pull Request Overview
This PR enhances data import functionality by introducing an optional deviance transformation and updates various dependency versions and figure plotting parameters. Key changes include:
- Adding deviance transformation support to the import_Heiser() function with a new prepare_dataset_deviance() helper.
- Updating dependency version constraints in pyproject.toml and adjusting file paths in figure scripts.
- Removing the gating.py module.
Reviewed Changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pyproject.toml | Upgraded Python and dependency versions. |
| pf2rnaseq/imports.py | Added deviance transformation function and adjusted imports. |
| Multiple figure files | Updated rank ranges, file paths, and plotting function parameters. |
| pf2rnaseq/gating.py | File removed. |
|
Fixed suggested changes including moving FMS calculation out of figure files and into plotGeneral. Although perhaps the FMS calculation should instead be moved to the factorization file? Renamed the 50 rank factorization to "/home/nicoleb/C3TAg_50". Fixed docstring. Deleted some files that are from previous analysis that I have not used (ie. CITEseq files). I upgraded packages from main and there was an incompatibility with datashader so also updated that. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
aarmey
left a comment
There was a problem hiding this comment.
Please split this into separate branches and PRs that address one thing. This has gotten too large and unreviewable.
@aarmey Added a few figures to look at deviance transform factorization. When importing the Heiser data using the import_Heiser() function, you can include argument import_Heiser(deviance=True) to use deviance transformation code to prepare the dataset. Default is false and will just do our typical normalization.
"/home/nicoleb/'C3TAg_50" Is the factorization with our typical normalization with rank 50.