scverse / scverse/scanpy

Any interest in getting SCTransform up on Scanpy?

Open
#1,643 27 comments 31 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.6k
Forks
779
Avg merge
1d 4h
Merged PRs (30d)
27

Description

  • Additional function parameters / changed functionality / changed defaults?
  • New analysis tool: A simple analysis tool you have been using and are missing in sc.tools?
  • New plotting function: A kind of plot you would like to seein sc.pl?
  • External tools: Do you know an existing package that should go into sc.external.*?
  • Other?

I recently ported SCTransform from R into python. Any interest in getting it onto Scanpy?

The original paper is here. It's a variance-stabilizing transformation that overcomes some key drawbacks of previous, similar methods (e.g. overfitting caused by building regression models from individual genes as opposed to groups of similar genes). It also eliminates the need for pseudocounts, log transformations, or library size normalization.

My code is here.

Implementation notes (from the SCTransformPy README):

  • Poisson regression is done using the statsmodels package and parallelized with multiprocessing.
  • Improved Sheather & Jones bandwidth calculation is implemented by the KDEpy package.
  • Estimating the negative binomial dispersion factor, theta, using MLE was translated from the theta.ml function in R.
  • Pearson residuals are automatically clipped to be non-negative. This ensures that sparsity structure can be preserved in the data. Practically, the results do not change much when allowing for dense, negative values.

Anecdotally, it produces very similar results to the R implementation, though the code itself is still a little rough around the edges. I also have to do more formal quantitative benchmarking to ensure results are similar to those of the original package.

I thought I'd gauge interest here prior to working on making it scanpy-ready.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No Scanpy file, test, or entry point is named; start by reading the linked SCTransformPy README and comparing its Python implementation with the original R package. Establish formal quantitative benchmarks against the R implementation, then determine what Scanpy integration would require and consider the work complete when it is Scanpy-ready with validated matching results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, r
Domain
data, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.