Skip to content
ASAP-CRNPublic

About

Pip-installable sc/sn RNA-seq processing scripts, synced from sc-rnaseq-wf/docker/sc_tools

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

sc-tools

Pip-installable copy of the ASAP PMDBS sc/sn RNA-seq processing scripts from sc-rnaseq-wf/docker/sc_tools.

Do not edit src/sc_tools/, requirements*.txt or entry-points.txt by hand. They are regenerated by sync.py. Make changes upstream in sc-rnaseq-wf.

Install

pip install git+https://github.com/ASAP-CRN/sc-tools.git
pip install "sc-tools[mmc] @ git+https://github.com/ASAP-CRN/sc-tools.git"   # + Allen cell_type_mapper for sc-mmc

Dependencies are pinned to match the sc_tools Docker image. GPU builds of jax/torch need to be installed separately, the same way the Dockerfile does.

Usage

Each upstream script is a console command named sc-<script-name> (underscores become hyphens), and each one takes the same arguments as the Docker version:

upstream script command
prep_metadata sc-prep-metadata
merge_and_plot_qc sc-merge-and-plot-qc
filter sc-filter
mmc sc-mmc
process sc-process
transcriptional_phenotype sc-transcriptional-phenotype
integrate_scvi sc-integrate-scvi
label_scanvi sc-label-scanvi
clustering_umap sc-clustering-umap
add_harmony sc-add-harmony
artifact_metrics sc-artifact-metrics
plot_groups_and_feats sc-plot-groups-and-feats
annotate (sc-tools only) sc-annotate

You can also call them as modules (python -m sc_tools.process ...) or import them (from sc_tools.helpers import score_cell_cycle).

Syncing

python sync.py ../sc-rnaseq-wf    # path to a local sc-rnaseq-wf checkout

sync.py makes these changes to the upstream code:

  • It copies scripts/main/* and scripts/utility/helpers.py to src/sc_tools/*.py.
  • It replaces sys.path.append("/opt/scripts/utility") / from helpers import with from sc_tools.helpers import.
  • It changes /opt/resources/*.txt paths to point at the copies bundled in the package.
  • It wraps each if __name__ == "__main__": block in a cli() function so the script can be a console entry point.
  • It takes the version from build.env (SC_TOOLS_VERSION) and records the upstream commit in sc_tools.__upstream_commit__.

The script stops with an error if the upstream code has a shape it doesn't recognise, for example a new /opt/ path.

.github/workflows/sync.yml runs the sync every week, on manual dispatch, or on a repository_dispatch event of type sc-tools-updated. It opens a PR whenever the output changes.

About

Pip-installable sc/sn RNA-seq processing scripts, synced from sc-rnaseq-wf/docker/sc_tools

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages