From 80637b1f22c0d4fb16e7777bcf250462bad42419 Mon Sep 17 00:00:00 2001
From: John Lafin <john.lafin@utsouthwestern.edu>
Date: Thu, 10 Oct 2024 11:22:58 -0500
Subject: [PATCH] Use nf-core container

---
 CHANGES.md                     |  4 ++++
 README.md                      |  3 +++
 astrocyte_pkg.yml              | 10 +++++++++-
 docs/index.md                  |  4 ++++
 workflow/configs/biohpc.config |  8 ++++++++
 workflow/main.nf               |  1 -
 6 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 6f7fb16..72a2602 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,7 @@
+2024-10-10
+
+Enabled containerization with nf-core cellranger image.
+
 2024-06-20
 
 Added support for barnyard reference.
diff --git a/README.md b/README.md
index cfa34ae..b7a9e1d 100755
--- a/README.md
+++ b/README.md
@@ -13,6 +13,9 @@ Output are standard cellranger outputs, including a cell-by-gene matrix in
 both MTX and h5 formats, a summary of the run in an HTML output, and a BAM
 file of aligned reads. These outputs can then be used for downstream analysis.
 
+Note: this workflow runs cellranger-count in a container, and is neither
+provided nor supported by 10x Genomics.
+
 ## Parameters
 
 - Fastq: The fastq files for the sample. Regardless of the files that are
diff --git a/astrocyte_pkg.yml b/astrocyte_pkg.yml
index 4416824..04abe5b 100755
--- a/astrocyte_pkg.yml
+++ b/astrocyte_pkg.yml
@@ -66,9 +66,17 @@ documentation_files:
 # A list of cluster environment modules that this workflow requires to run.
 # Specify versioned module names to ensure reproducibility.
 workflow_modules:
-  - 'cellranger/7.1.0'
   - 'singularity/3.9.9'
 
+  # A list of container images requires to run this workflow.
+# Specify full path and version names to ensure reproducibility.
+# This keyword is required when 'container' is specified in Astrocyte 0.4.1 and above.
+# Singularity supports different registries, please specify the protocol to use.
+# Such as, "docker://", "shub://", "library://", etc. We encourage you to use the GitLab
+# container registry of BioHPC to save and manage your container images.
+workflow_containers:
+  - docker://quay.io/nf-core/cellranger:7.1.0
+
 # A list of parameters used by the workflow, defining how to present them,
 # options etc in the web interface. For each parameter:
 #
diff --git a/docs/index.md b/docs/index.md
index 86081a4..fa3d5b5 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -5,6 +5,10 @@ Chromium single cell gene expression workflows. It accepts fastq.gz files as
 input, which can be generated with the "BICF CellRanger mkfastq" Astrocyte 
 workflow.
 
+Note: this workflow runs cellranger-count in a container, and is neither
+provided nor supported by 10x Genomics.
+
+
 ## Parameters
 
 To run this workflow, you must supply the following parameters:
diff --git a/workflow/configs/biohpc.config b/workflow/configs/biohpc.config
index a668f1d..9c84979 100755
--- a/workflow/configs/biohpc.config
+++ b/workflow/configs/biohpc.config
@@ -3,8 +3,16 @@ process {
     clusterOptions = '--no-kill'
     queue = '512GB,256GB,256GBv1,128GB'
     time = '8h'
+    container = 'docker://quay.io/nf-core/cellranger:7.1.0'
 }
 
+singularity {
+    enabled = true
+    runOptions = '--nv'
+    cacheDir = "${projectDir}/images/singularity"
+}
+
+
 // Overwrite execution report files
 // Required for nextflow version >22.10.0
 
diff --git a/workflow/main.nf b/workflow/main.nf
index edf3b02..9271c58 100755
--- a/workflow/main.nf
+++ b/workflow/main.nf
@@ -20,7 +20,6 @@ params.astrocyte = false
 // Run cellranger count
 process cr_count {
     publishDir "${params.outDir}", mode: 'copy'
-    module 'cellranger/7.1.0'
     module 'singularity/3.9.9'
     errorStrategy 'ignore'
 
-- 
GitLab