diff --git a/modules/cellranger/Dockerfile b/modules/cellranger/Dockerfile index 3e52ca6a..266a24ef 100644 --- a/modules/cellranger/Dockerfile +++ b/modules/cellranger/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile to create container with Cell Ranger v6.1.2 +# Dockerfile to create container with Cell Ranger v7.0.0 # Push to nfcore/cellranger: FROM continuumio/miniconda3:4.8.2 diff --git a/modules/cellranger/count/main.nf b/modules/cellranger/count/main.nf index 6a206b6e..7413c990 100644 --- a/modules/cellranger/count/main.nf +++ b/modules/cellranger/count/main.nf @@ -5,7 +5,7 @@ process CELLRANGER_COUNT { if (params.enable_conda) { exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers." } - container "nfcore/cellranger:6.1.2" + container "nfcore/cellranger:7.0.0" input: tuple val(meta), path(reads) diff --git a/modules/cellranger/mkfastq/Dockerfile b/modules/cellranger/mkfastq/Dockerfile index 8660293a..7b6b84ec 100644 --- a/modules/cellranger/mkfastq/Dockerfile +++ b/modules/cellranger/mkfastq/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile to create container with Cell Ranger v6.1.2 and bcl2fastq v2.20.0 +# Dockerfile to create container with Cell Ranger v7.0.0 and bcl2fastq v2.20.0 # Push to nfcore/cellrangermkfastq: FROM continuumio/miniconda3:4.8.2 @@ -17,7 +17,7 @@ RUN apt-get update --allow-releaseinfo-change \ # Copy pre-downloaded bcl2fastq2 and cellranger file ENV BCL2FASTQ2_VER=v2-20-0-linux-x86-64 \ - CELLRANGER_VER=6.1.2 + CELLRANGER_VER=7.0.0 COPY bcl2fastq2-$BCL2FASTQ2_VER.zip /tmp/bcl2fastq2-$BCL2FASTQ2_VER.zip COPY cellranger-$CELLRANGER_VER.tar.gz /opt/cellranger-$CELLRANGER_VER.tar.gz diff --git a/modules/cellranger/mkfastq/main.nf b/modules/cellranger/mkfastq/main.nf index 9c023bca..30c638ea 100644 --- a/modules/cellranger/mkfastq/main.nf +++ b/modules/cellranger/mkfastq/main.nf @@ -5,7 +5,7 @@ process CELLRANGER_MKFASTQ { if (params.enable_conda) { exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers." } - container "nfcore/cellrangermkfastq:6.1.2" + container "nfcore/cellrangermkfastq:7.0.0" input: path bcl diff --git a/modules/cellranger/mkgtf/main.nf b/modules/cellranger/mkgtf/main.nf index 9dc2fe1a..a115706d 100644 --- a/modules/cellranger/mkgtf/main.nf +++ b/modules/cellranger/mkgtf/main.nf @@ -5,7 +5,7 @@ process CELLRANGER_MKGTF { if (params.enable_conda) { exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers." } - container "nfcore/cellranger:6.1.2" + container "nfcore/cellranger:7.0.0" input: path gtf diff --git a/modules/cellranger/mkref/main.nf b/modules/cellranger/mkref/main.nf index 11cf80e3..e1bfebde 100644 --- a/modules/cellranger/mkref/main.nf +++ b/modules/cellranger/mkref/main.nf @@ -5,7 +5,7 @@ process CELLRANGER_MKREF { if (params.enable_conda) { exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers." } - container "nfcore/cellranger:6.1.2" + container "nfcore/cellranger:7.0.0" input: path fasta diff --git a/modules/sexdeterrmine/main.nf b/modules/sexdeterrmine/main.nf new file mode 100644 index 00000000..98c72307 --- /dev/null +++ b/modules/sexdeterrmine/main.nf @@ -0,0 +1,40 @@ +process SEXDETERRMINE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::sexdeterrmine=1.1.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sexdeterrmine:1.1.2--hdfd78af_1': + 'quay.io/biocontainers/sexdeterrmine:1.1.2--hdfd78af_1' }" + + input: + tuple val(meta), path(depth) + path sample_list_file + + output: + tuple val(meta), path("*.json"), emit: json + tuple val(meta), path("*.tsv") , emit: tsv + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def sample_list = sample_list_file ? '-f ${sample_list_file}' : '' + if ("$depth" == "${prefix}.tsv") error "Input depth and output TSV names are the same, set prefix in module configuration to disambiguate!" + + """ + sexdeterrmine \\ + -I $depth \\ + $sample_list \\ + $args \\ + > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sexdeterrmine: \$(echo \$(sexdeterrmine --version 2>&1)) + END_VERSIONS + """ +} diff --git a/modules/sexdeterrmine/meta.yml b/modules/sexdeterrmine/meta.yml new file mode 100644 index 00000000..3f56b0ab --- /dev/null +++ b/modules/sexdeterrmine/meta.yml @@ -0,0 +1,48 @@ +name: "sexdeterrmine" +description: Calculate the relative coverage on the Gonosomes vs Autosomes from the output of samtools depth, with error bars. +keywords: + - sex determination + - genetic sex + - relative coverage + - ancient dna +tools: + - "sexdeterrmine": + description: "A python script carry out calculate the relative coverage of X and Y chromosomes, and their associated error bars, out of capture data." + homepage: "https://github.com/TCLamnidis/Sex.DetERRmine" + documentation: "https://github.com/TCLamnidis/Sex.DetERRmine/README.md" + tool_dev_url: "https://github.com/TCLamnidis/Sex.DetERRmine" + doi: "https://doi.org/10.1038/s41467-018-07483-5" + licence: "['GPL v3']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - depth: + type: file + description: Output from samtools depth (with header) + pattern: "*" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - json: + type: file + description: JSON formatted table of relative coverages on the X and Y, with associated error bars. + pattern: "*.json" + - tsv: + type: file + description: TSV table of relative coverages on the X and Y, with associated error bars. + pattern: "*.tsv" + +authors: + - "@TCLamnidis" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 4aba29fa..0f177f5f 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1855,6 +1855,10 @@ seqwish/induce: - modules/seqwish/induce/** - tests/modules/seqwish/induce/** +sexdeterrmine: + - modules/sexdeterrmine/** + - tests/modules/sexdeterrmine/** + shasum: - modules/shasum/** - tests/modules/shasum/** diff --git a/tests/config/test_data.config b/tests/config/test_data.config index fa7017b1..474927f2 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -232,10 +232,11 @@ params { test2_paired_end_umi_unsorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test2.paired_end.umi_unsorted.bam" test2_paired_end_umi_unsorted_tagged_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test2.paired_end.unsorted_tagged.bam" - mitochon_standin_recalibrated_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/mitochon_standin.recalibrated.sorted.bam" mitochon_standin_recalibrated_sorted_bam_bai = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/mitochon_standin.recalibrated.sorted.bam.bai" + test3_single_end_markduplicates_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test3.single_end.markduplicates.sorted.bam" + test_paired_end_sorted_cram = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram" test_paired_end_sorted_cram_crai = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai" test_paired_end_markduplicates_sorted_cram = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test.paired_end.markduplicates.sorted.cram" diff --git a/tests/modules/cellranger/count/test.yml b/tests/modules/cellranger/count/test.yml index 121d9eea..93e52c4a 100644 --- a/tests/modules/cellranger/count/test.yml +++ b/tests/modules/cellranger/count/test.yml @@ -1,19 +1,65 @@ - name: cellranger count test_cellranger_count - command: nextflow run tests/modules/cellranger/count -entry test_cellranger_count -c tests/config/nextflow.config -c tests/modules/cellranger/count/nextflow.config + command: nextflow run ./tests/modules/cellranger/count -entry test_cellranger_count -c ./tests/config/nextflow.config -c ./tests/modules/cellranger/count/nextflow.config tags: - - cellranger - cellranger/count + - cellranger files: + - path: output/cellranger/genome.filtered.gtf + md5sum: a8b8a7b5039e05d3a9cf9151ea138b5b + - 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.gz + md5sum: d1e05cd46684fa26d852b6bc9f05e31f + - path: output/cellranger/homo_sapiens_chr22_reference/reference.json + md5sum: 8405fd7f527a944eafb9c2909045840b + - path: output/cellranger/homo_sapiens_chr22_reference/star/Genome + md5sum: 897cec2d191945335f8b320438bd9135 + - path: output/cellranger/homo_sapiens_chr22_reference/star/SA + md5sum: 7961129ac5d0e1706105be1d31c6b30c + - path: output/cellranger/homo_sapiens_chr22_reference/star/SAindex + md5sum: dcceb480b30cda93fb8c63ddc339093b + - 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: 9129691eeb4ed0d02b17be879fa3edb0 + - path: output/cellranger/homo_sapiens_chr22_reference/star/exonInfo.tab + md5sum: 209b82f0683efd03e17d2c729676554f + - path: output/cellranger/homo_sapiens_chr22_reference/star/geneInfo.tab + md5sum: 02a8f4575bdfcd4a42b4d8d07f2e9369 + - path: output/cellranger/homo_sapiens_chr22_reference/star/genomeParameters.txt + - path: output/cellranger/homo_sapiens_chr22_reference/star/sjdbInfo.txt + md5sum: 1082ab459363b3f2f7aabcef0979c1ed + - path: output/cellranger/homo_sapiens_chr22_reference/star/sjdbList.fromGTF.out.tab + - path: output/cellranger/homo_sapiens_chr22_reference/star/sjdbList.out.tab + - path: output/cellranger/homo_sapiens_chr22_reference/star/transcriptInfo.tab + md5sum: cedcb5f4e7d97bc548cd5daa022e092c - path: output/cellranger/sample-123/outs/filtered_feature_bc_matrix.h5 + md5sum: f8b6b7cc8248151a98c46d4ebec450c6 + - path: output/cellranger/sample-123/outs/filtered_feature_bc_matrix/barcodes.tsv.gz + - path: output/cellranger/sample-123/outs/filtered_feature_bc_matrix/features.tsv.gz + - path: output/cellranger/sample-123/outs/filtered_feature_bc_matrix/matrix.mtx.gz - path: output/cellranger/sample-123/outs/metrics_summary.csv md5sum: 707df0f101d479d93f412ca74f9c4131 - path: output/cellranger/sample-123/outs/molecule_info.h5 - md5sum: 0e56836ef0725f2ab05f56ca5a71e55b + md5sum: a13bd7425f441c8d0eac8ffc50082996 - path: output/cellranger/sample-123/outs/possorted_genome_bam.bam md5sum: 15441da9cfceea0bb48c8b66b1b860df - path: output/cellranger/sample-123/outs/possorted_genome_bam.bam.bai md5sum: 7c3d49c77016a09535aff61a027f750c - - path: output/cellranger/sample-123/outs/raw_feature_bc_matrix - path: output/cellranger/sample-123/outs/raw_feature_bc_matrix.h5 - md5sum: cdad1cd7b215d7137cf92515e81a8525 + md5sum: a5290f3e300a4070f3d68a0c2e215f54 + - path: output/cellranger/sample-123/outs/raw_feature_bc_matrix/barcodes.tsv.gz + md5sum: 5cc39ef0c7ac85f2b758b164aabf9157 + - path: output/cellranger/sample-123/outs/raw_feature_bc_matrix/features.tsv.gz + md5sum: 07d497c7ce3e22f374af7b2cf9b97d72 + - path: output/cellranger/sample-123/outs/raw_feature_bc_matrix/matrix.mtx.gz + md5sum: bdce94a51f16e22d40301724080b76ee - path: output/cellranger/sample-123/outs/web_summary.html diff --git a/tests/modules/cellranger/mkfastq/test.yml b/tests/modules/cellranger/mkfastq/test.yml index 890f2557..273d8fca 100644 --- a/tests/modules/cellranger/mkfastq/test.yml +++ b/tests/modules/cellranger/mkfastq/test.yml @@ -5,7 +5,6 @@ - cellranger/mkfastq files: - path: output/cellranger/cellranger-tiny-bcl-1/outs/fastq_path/fake_file.fastq.gz - md5sum: d41d8cd98f00b204e9800998ecf8427e - name: cellranger mkfastq test_cellranger_mkfastq_illumina command: nextflow run tests/modules/cellranger/mkfastq -entry test_cellranger_mkfastq_illumina -c tests/config/nextflow.config -c ./tests/modules/cellranger/mkfastq/nextflow.config -stub-run tags: @@ -13,4 +12,3 @@ - cellranger/mkfastq files: - path: output/cellranger/cellranger-tiny-bcl-1/outs/fastq_path/fake_file.fastq.gz - md5sum: d41d8cd98f00b204e9800998ecf8427e diff --git a/tests/modules/cellranger/mkgtf/test.yml b/tests/modules/cellranger/mkgtf/test.yml index 2130afd2..59eb9072 100644 --- a/tests/modules/cellranger/mkgtf/test.yml +++ b/tests/modules/cellranger/mkgtf/test.yml @@ -1,8 +1,8 @@ - name: cellranger mkgtf test_cellranger_mkgtf - command: nextflow run tests/modules/cellranger/mkgtf -entry test_cellranger_mkgtf -c tests/config/nextflow.config -c tests/modules/cellranger/mkgtf/nextflow.config + command: nextflow run ./tests/modules/cellranger/mkgtf -entry test_cellranger_mkgtf -c ./tests/config/nextflow.config -c ./tests/modules/cellranger/mkgtf/nextflow.config tags: - - cellranger - cellranger/mkgtf + - cellranger files: - path: output/cellranger/genome.filtered.gtf md5sum: a8b8a7b5039e05d3a9cf9151ea138b5b diff --git a/tests/modules/cellranger/mkref/test.yml b/tests/modules/cellranger/mkref/test.yml index e40592bb..83ec5f95 100644 --- a/tests/modules/cellranger/mkref/test.yml +++ b/tests/modules/cellranger/mkref/test.yml @@ -1,8 +1,8 @@ - name: cellranger mkref test_cellranger_mkref - command: nextflow run ./tests/modules/cellranger/mkref -entry test_cellranger_mkref -c ./tests/config/nextflow.config -c ./tests/modules/cellranger/mkref/nextflow.config + command: nextflow run ./tests/modules/cellranger/mkref -entry test_cellranger_mkref -c ./tests/config/nextflow.config -c ./tests/modules/cellranger/mkref/nextflow.config tags: - - cellranger - cellranger/mkref + - cellranger files: - path: output/cellranger/homo_sapiens_chr22_reference/fasta/genome.fa md5sum: f315020d899597c1b57e5fe9f60f4c3e @@ -11,7 +11,7 @@ - path: output/cellranger/homo_sapiens_chr22_reference/genes/genes.gtf.gz md5sum: 6d9b5f409bfea95022bc25b9590e194e - path: output/cellranger/homo_sapiens_chr22_reference/reference.json - md5sum: 5d8d1669cd251433505f183e1c9ed6bc + md5sum: 6cc817f0923062e780e6573806840cea - path: output/cellranger/homo_sapiens_chr22_reference/star/Genome md5sum: 22102926fadf5890e905ca71b2da3f35 - path: output/cellranger/homo_sapiens_chr22_reference/star/SA diff --git a/tests/modules/sexdeterrmine/main.nf b/tests/modules/sexdeterrmine/main.nf new file mode 100644 index 00000000..fc777905 --- /dev/null +++ b/tests/modules/sexdeterrmine/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SAMTOOLS_DEPTH } from '../../../modules/samtools/depth/main.nf' +include { SEXDETERRMINE } from '../../../modules/sexdeterrmine/main.nf' + +workflow test_sexdeterrmine { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test3_single_end_markduplicates_sorted_bam'], checkIfExists: true) ] + + SAMTOOLS_DEPTH ( input ) + SEXDETERRMINE ( SAMTOOLS_DEPTH.out.tsv, [] ) +} diff --git a/tests/modules/sexdeterrmine/nextflow.config b/tests/modules/sexdeterrmine/nextflow.config new file mode 100644 index 00000000..4ba3dfe3 --- /dev/null +++ b/tests/modules/sexdeterrmine/nextflow.config @@ -0,0 +1,12 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName:SAMTOOLS_DEPTH { + ext.args = "-H" + } + + withName:SEXDETERRMINE { + ext.prefix = { "${meta.id}_sexdet" } + } +} diff --git a/tests/modules/sexdeterrmine/test.yml b/tests/modules/sexdeterrmine/test.yml new file mode 100644 index 00000000..bb3f701e --- /dev/null +++ b/tests/modules/sexdeterrmine/test.yml @@ -0,0 +1,15 @@ +- name: sexdeterrmine test_sexdeterrmine + command: nextflow run tests/modules/sexdeterrmine -entry test_sexdeterrmine -c tests/config/nextflow.config + tags: + - sexdeterrmine + files: + - path: output/samtools/test.tsv + md5sum: fa2992ca1ea93a6e1b3e838476191935 + - path: output/samtools/versions.yml + md5sum: dbd04b700335c8ad236bd667254c8dd8 + - path: output/sexdeterrmine/sexdeterrmine.json + md5sum: bafb2419bb8630eda29a251c20e97166 + - path: output/sexdeterrmine/test_sexdet.tsv + md5sum: 1cf8a2b97b38353eb97a96ab872dcca9 + - path: output/sexdeterrmine/versions.yml + md5sum: 077361101e8e7997aec3da8a01e59eee diff --git a/tests/test_versions_yml.py b/tests/test_versions_yml.py index 5d0bb39e..7da6707d 100644 --- a/tests/test_versions_yml.py +++ b/tests/test_versions_yml.py @@ -16,9 +16,9 @@ def _get_workflow_names(): # test_config = yaml.safe_load(f.read_text()) test_config = yaml.load(f.read_text(), Loader=yaml.BaseLoader) for workflow in test_config: - # https://github.com/nf-core/modules/pull/1242 - added to cover tests + # https://github.com/nf-core/modules/pull/1242 - added to cover tests # that expect an error and therefore will not generate a versions.yml - if 'exit_code' not in workflow: + if 'exit_code' not in workflow: yield workflow["name"] @@ -56,5 +56,5 @@ def test_ensure_valid_version_yml(workflow_dir): assert len(software_versions), "There must be at least one version emitted." for tool, version in software_versions.items(): assert re.match( - r"^\d+.*", str(version) - ), f"Version number for {tool} must start with a number. " + r"^\d.*|^[a-f0-9]{40}$", str(version) + ), f"Version number for {tool} must start with a number, or be a Git SHA commit id. "