Skip to content

Dimred datasets preprocessing - #289

Closed
lazappi wants to merge 5 commits into
openproblems-bio:masterfrom
lazappi:dimred-datasets-preprocessing
Closed

Dimred datasets preprocessing#289
lazappi wants to merge 5 commits into
openproblems-bio:masterfrom
lazappi:dimred-datasets-preprocessing

Conversation

@lazappi

@lazappi lazappi commented Mar 30, 2021

Copy link
Copy Markdown
Member

Submission type

This submission modifies the dimensionality reduction (2D) task to include pre-processing steps in the data loaders (See #279). These should store a higher dimensional embedding in adata.obsm['X_input'] which is then used as the input for (most) methods.

  • Add a preprocessing.py function that has pre-processing functions (one currently)
  • Added that pre-processing function to the existing data loaders
  • Modified the existing methods to use the pre-computed higher-dimensional embedding as input
    • PHATE is an exception, wasn't sure if that was appropriate so skipped for now but should probably discuss before merging
  • Updated the API and README to describe the change

Testing

  • This submission was written on a forked copy of SingleCellOpenProblems
  • GitHub Actions "Run Benchmark" tests are passing on this base branch of this pull request (include link to passed test: ) PENDING
  • If this pull request is not ready for review (including passing the "Run Benchmark" tests), I will open this PR as a draft (click on the down arrow next to the "Create Pull Request" button)

Submission guidelines

  • This submission follows the guidelines in our Contributing document
  • I have checked to ensure there aren't other open Pull Requests for the same update/change

lazappi and others added 5 commits March 30, 2021 16:48
* Performs basic pre-processing using the standard scanpy workflow
  * Normalise by total counts
  * Log transform
  * Calculate (max) 1000 HVGs
  * Calculate 50 PCs
* Add this function to the existing dataset loaders
Methods should now assume there is a adata.obsm['X_input'] slot which
should be the input for (most) methods
@lazappi

lazappi commented Mar 30, 2021

Copy link
Copy Markdown
Member Author

Thinking about this a bit more I'm actually wondering if it is better to do this on the methods level rather than the datasets level? We could still have a preprocessing.py file with the functions but call them as part of a method rather than a data loader.

CONS: Pre-processing would be run multiple times (maybe bad if there are many methods), more work to add methods
PROS: More flexible in which methods can handle which pre-processing, less work to add datasets

The results at the end should be the same so I guess it depends which the core members would prefer and is most consistent with what is being done for other tasks.

@cramirezs

Copy link
Copy Markdown

Thinking about this a bit more I'm actually wondering if it is better to do this on the methods level rather than the datasets level? We could still have a preprocessing.py file with the functions but call them as part of a method rather than a data loader.

This is what I was referring to with "... we just put the preprocessing in each method version as sqrt_umap, log1p_umap, etc." in #279. I guess it depends on how costly this step will be. I am not sure if talking about parallelization makes sense (I haven't used AWS).

@LuckyMD

LuckyMD commented Mar 30, 2021

Copy link
Copy Markdown
Collaborator

So far we have converged on preprocessing as part of methods if possible in openproblems.

@lazappi

lazappi commented Mar 31, 2021

Copy link
Copy Markdown
Member Author

Based on @LuckyMD's comments in a couple of places it seems like moving the pre-processing to the method layer would be more consistent with other tasks.

I will close this now, move some things around and start a new PR.

@lazappi lazappi closed this Mar 31, 2021
@lazappi lazappi mentioned this pull request Mar 31, 2021
5 tasks
@lazappi
lazappi deleted the dimred-datasets-preprocessing branch April 11, 2022 08:48
rcannood added a commit that referenced this pull request Sep 4, 2024
rcannood added a commit that referenced this pull request Sep 4, 2024
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