aertslab / pycisTopic

pycisTopic is a Python module to simultaneously identify cell states and cis-regulatory topics from single cell epigenomics data.
Other
58 stars 12 forks source link

Add pycisTopic images to DockerHub #182

Open massonix opened 2 weeks ago

massonix commented 2 weeks ago

Hi all,

Thanks for this wonderful tool!

We're trying hard to install pycistopic using pip in our cluster (NYGC), but we keep hitting all sorts of errors. We managed to run pySCENIC with singularity as follows:

#!/bin/bash

# This script runs pySCENIC to infer gene regulatory networks (GRN) from scRNAseq data
# See https://pyscenic.readthedocs.io/en/latest/

# Define parameters and parse command line arguments
PATH_WORKING_DIR=$1
SAMPLE=$2
N_CPU=$3
PATH_FEATHER_FILE=${PATH_WORKING_DIR}/tmp/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather
PATH_MOTIF_DB=${PATH_WORKING_DIR}/tmp/motifs-v10nr_clust-nr.hgnc-m0.001-o0.0.tbl
PATH_TF_LIST=${PATH_WORKING_DIR}/tmp/allTFs_hg38.txt
PATH_LOOM_INPUT=${PATH_WORKING_DIR}/tmp/${SAMPLE}_pyscenic_input_corrected.loom
PATH_SAVE_ADJACENCIES=${PATH_WORKING_DIR}/tmp/${SAMPLE}_adj.csv
PATH_SAVE_REGULONS=${PATH_WORKING_DIR}/tmp/${SAMPLE}_reg.csv
PATH_LOOM_OUTPUT=${PATH_WORKING_DIR}/tmp/${SAMPLE}_pyscenic_output.loom

# STEP 1: Run GRNBoost2
singularity run --bind $PATH_WORKING_DIR docker://aertslab/pyscenic:0.12.1 arboreto_with_multiprocessing.py \
    $PATH_LOOM_INPUT \
    $PATH_TF_LIST \
    --output $PATH_SAVE_ADJACENCIES \
    --num_workers $N_CPU

# STEP 2: Create regulons
singularity run --bind $PATH_WORKING_DIR docker://aertslab/pyscenic:0.12.1 pyscenic ctx \
    $PATH_SAVE_ADJACENCIES \
    $PATH_FEATHER_FILE \
    --annotations_fname $PATH_MOTIF_DB \
    --expression_mtx_fname $PATH_LOOM_INPUT \
    --output $PATH_SAVE_REGULONS \
    --mask_dropouts \
    --all_modules \
    --num_workers $N_CPU

# STEP 3: Run AUCell
singularity run --bind $PATH_WORKING_DIR docker://aertslab/pyscenic:0.12.1 pyscenic aucell \
    $PATH_LOOM_INPUT \
    $PATH_SAVE_REGULONS \
    --output $PATH_LOOM_OUTPUT \
    --num_workers $N_CPU

So ideally we'd like to do something similar for pycistopic. We noticed that there are no pycistopic images in DockerHub that we can pull, and instead we're recommended to build our own using podman and singularity:

# Clone repositories (pycisTopic and pycistarget)
git clone https://github.com/aertslab/pycisTopic.git
git clone https://github.com/aertslab/pycistarget.git

# Build image
podman build -t aertslab/pycistopic:latest . -f pycisTopic/Dockerfile

# Export to oci
podman save --format oci-archive --output pycistopic_img.tar localhost/aertslab/pycistopic

# Build to singularity
singularity build pycistopic.sif oci-archive://pycistopic_img.tar

# Add all binding paths where you would need to access
singularity exec -B /lustre1,/staging,/data,/vsc-hard-mounts,/scratch pycistopic.sif ipython3

However, we cannot run Docker or podman in the cluster, so it'd be neat if we could pull the image directly, similar to what we did for pySCENIC. Would that be possible?

Many thanks in advance!

SeppeDeWinter commented 2 days ago

Hi @massonix

Thank you for the suggestion.

In the meantime can you try installing pycistopic via the SCENIC+ repo. The dependencies in this repo are managed better.

Can you let me know wether this works?

$ conda create --name scenicplus python=3.11 -y
$ conda activate scenicplus
$ git clone https://github.com/aertslab/scenicplus
$ cd scenicplus
$ pip install .

All the best,

Seppe