Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UNIVERSC module #3485

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 8 additions & 29 deletions modules/nf-core/universc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,32 @@ process UNIVERSC {
exit 1, "UNIVERSC module does not support Conda. Please use Docker / Singularity / Podman instead."
}
container "docker.io/nfcore/universc:1.2.5.1"
if (workflow.containerEngine == 'docker'){
containerOptions = "--privileged"
}
if ( workflow.containerEngine == 'podman'){
containerOptions = "--runtime crun --userns=keep-id --systemd=always"
}
if (workflow.containerEngine == 'singularity'){
containerOptions = "-B /var/tmp --writable-tmpfs"
params.singularity_autoMounts = true
}

input:
tuple val(meta), path(reads)
path reference


output:
tuple val(meta), path("sample-${meta.id}/outs/*"), emit: outs
tuple val(meta), path("${meta.id}/outs/*"), emit: outs
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def sample_arg = meta.samples.unique().join(",")
def reference_name = reference.name
def input_reads = meta.single_end ? "--file $reads" : "-R1 ${reads[0]} -R2 ${reads[1]}"
def args = task.ext.args ?: ''
def sample_arg = meta.samples.unique().join(",")
def input_reads = meta.single_end ? "--file $reads" : "-R1 ${reads[0]} -R2 ${reads[1]}"
"""
universc \\
--id 'sample-${meta.id}' \\
--id '${meta.id}' \\
${input_reads} \\
--technology '${meta.technology}' \\
--chemistry '${meta.chemistry}' \\
--reference ${reference_name} \\
--description ${sample_arg} \\
--reference ${reference} \\
$args
--jobmode "local" \\
--localcores ${task.cpus} \\
--localmem ${task.memory.toGiga()} \\
--per-cell-data \\
$args 1> _log 2> _err

# save log files
echo !! > sample-${meta.id}/outs/_invocation
cp _log sample-${meta.id}/outs/_log
cp _err sample-${meta.id}/outs/_err
--localmem ${task.memory.toGiga()}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -61,7 +41,6 @@ process UNIVERSC {
END_VERSIONS
"""


stub:
"""
mkdir -p "sample-${meta.id}/outs/"
Expand Down
9 changes: 8 additions & 1 deletion tests/modules/nf-core/universc/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

withName: UNIVERSC {
ext.args = ''
ext.args = {
[
meta.technology ? "--technology '${meta.technology}'" : "",
meta.chemistry ? "--chemistry '${meta.chemistry}'" : "",
meta.samples ? "--description ${meta.samples.unique().join(',')}" : "",
"--per-cell-data"
].join(' ').strip()
}
container = "docker.io/nfcore/universc:1.2.5.1"
}

Expand Down
77 changes: 18 additions & 59 deletions tests/modules/nf-core/universc/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,25 @@
tags:
- universc
files:
- path: output/cellranger/genome.filtered.gtf
md5sum: 9dc1a510bbe4438cfc2a74423bf2b2bd
- path: output/cellranger/homo_sapiens_chr22_reference/fasta/genome.fa
md5sum: f315020d899597c1b57e5fe9f60f4c3e
- path: output/cellranger/homo_sapiens_chr22_reference/fasta/genome.fa.fai
md5sum: 3520cd30e1b100e55f578db9c855f685
- path: output/cellranger/homo_sapiens_chr22_reference/genes/genes.gtf
md5sum: c37539d5bdae419bae799165d3f80c53
- path: output/cellranger/homo_sapiens_chr22_reference/reference.json
md5sum: 1f7bf05454cc908bf70cd232ae70b02d
- path: output/cellranger/homo_sapiens_chr22_reference/star/Genome
md5sum: 22102926fadf5890e905ca71b2da3f35
- path: output/cellranger/homo_sapiens_chr22_reference/star/SA
md5sum: bcf3e1a855783105150b46c905465333
- path: output/cellranger/homo_sapiens_chr22_reference/star/SAindex
md5sum: b93fb07d342e6c32a00ebc4311c0ad38
- path: output/cellranger/homo_sapiens_chr22_reference/star/chrLength.txt
md5sum: c81f40f27e72606d7d07097c1d56a5b5
- path: output/cellranger/homo_sapiens_chr22_reference/star/chrName.txt
md5sum: 5ae68a67b70976ee95342a7451cb5af1
- path: output/cellranger/homo_sapiens_chr22_reference/star/chrNameLength.txt
md5sum: b190587cae0531f3cf25552d8aa674db
- path: output/cellranger/homo_sapiens_chr22_reference/star/chrStart.txt
md5sum: bc73df776dd3d5bb9cfcbcba60880519
- path: output/cellranger/homo_sapiens_chr22_reference/star/exonGeTrInfo.tab
md5sum: d04497f69d6ef889efd4d34fe63edcc4
- path: output/cellranger/homo_sapiens_chr22_reference/star/exonInfo.tab
md5sum: 0d560290fab688b7268d88d5494bf9fe
- path: output/cellranger/homo_sapiens_chr22_reference/star/geneInfo.tab
md5sum: a20c70b081f5d83649c48ebbd951cb77
- path: output/cellranger/homo_sapiens_chr22_reference/star/genomeParameters.txt
contains: ["genomeGenerate"]
- path: output/cellranger/homo_sapiens_chr22_reference/star/sjdbInfo.txt
md5sum: 5690ea9d9f09f7ff85b7fd47bd234903
- path: output/cellranger/homo_sapiens_chr22_reference/star/sjdbList.fromGTF.out.tab
md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1
- path: output/cellranger/homo_sapiens_chr22_reference/star/sjdbList.out.tab
md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1
- path: output/cellranger/homo_sapiens_chr22_reference/star/transcriptInfo.tab
md5sum: 6fa11b4d34f4680a1c23dbcea2e050d5
- path: output/cellranger/versions.yml
- path: output/universc/sample-123/outs/_err
- path: output/universc/sample-123/outs/_invocation
- path: output/universc/123/outs/_err
- path: output/universc/123/outs/_invocation
md5sum: adbbbc1027756be9fdeebabf979863e5
- path: output/universc/sample-123/outs/_log
- path: output/universc/sample-123/outs/basic_stats.txt
- path: output/universc/123/outs/_log
- path: output/universc/123/outs/basic_stats.txt
md5sum: 90004df04ec7b65a0dd8d26a08e55fd2
- path: output/universc/sample-123/outs/filtered_feature_bc_matrix.h5
- path: output/universc/sample-123/outs/filtered_feature_bc_matrix/barcodes.tsv.gz
- path: output/universc/sample-123/outs/filtered_feature_bc_matrix/features.tsv.gz
- path: output/universc/sample-123/outs/filtered_feature_bc_matrix/matrix.mtx.gz
- path: output/universc/sample-123/outs/metrics_summary.csv
- path: output/universc/123/outs/filtered_feature_bc_matrix.h5
- path: output/universc/123/outs/filtered_feature_bc_matrix/barcodes.tsv.gz
- path: output/universc/123/outs/filtered_feature_bc_matrix/features.tsv.gz
- path: output/universc/123/outs/filtered_feature_bc_matrix/matrix.mtx.gz
- path: output/universc/123/outs/metrics_summary.csv
md5sum: bba1b122b15698d97a034af61e3fcd59
- path: output/universc/sample-123/outs/molecule_info.h5
- path: output/universc/sample-123/outs/possorted_genome_bam.bam
- path: output/universc/sample-123/outs/possorted_genome_bam.bam.bai
- path: output/universc/sample-123/outs/raw_feature_bc_matrix.h5
- path: output/universc/sample-123/outs/raw_feature_bc_matrix/barcodes.tsv.gz
- path: output/universc/sample-123/outs/raw_feature_bc_matrix/features.tsv.gz
- path: output/universc/sample-123/outs/raw_feature_bc_matrix/matrix.mtx.gz
- path: output/universc/sample-123/outs/web_summary.html
contains: ["sample-123"]
- path: output/universc/123/outs/molecule_info.h5
- path: output/universc/123/outs/possorted_genome_bam.bam
- path: output/universc/123/outs/possorted_genome_bam.bam.bai
- path: output/universc/123/outs/raw_feature_bc_matrix.h5
- path: output/universc/123/outs/raw_feature_bc_matrix/barcodes.tsv.gz
- path: output/universc/123/outs/raw_feature_bc_matrix/features.tsv.gz
- path: output/universc/123/outs/raw_feature_bc_matrix/matrix.mtx.gz
- path: output/universc/123/outs/web_summary.html
contains: ["123"]
- path: output/universc/versions.yml