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.
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-mmcDependencies 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.
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).
python sync.py ../sc-rnaseq-wf # path to a local sc-rnaseq-wf checkoutsync.py makes these changes to the upstream code:
- It copies
scripts/main/*andscripts/utility/helpers.pytosrc/sc_tools/*.py. - It replaces
sys.path.append("/opt/scripts/utility")/from helpers importwithfrom sc_tools.helpers import. - It changes
/opt/resources/*.txtpaths to point at the copies bundled in the package. - It wraps each
if __name__ == "__main__":block in acli()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 insc_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.