From ed5594bee3eb38874cb282d288bc22ab6262a73e Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Tue, 5 Jul 2022 13:28:57 +0200 Subject: [PATCH] Bump version of kallistobustools/count (#1834) * Bump version of kallistobustools/count * Trying to update the entire call of kbtools for scrnaseq * Improved tests for kallistobustools/count * Add memory, remove workflow as this is passed as args now * Update modules/kallistobustools/count/main.nf Co-authored-by: Gregor Sturm * adding missing value * workflow properly chained together * changing --workflow to ext.args * fix intron channel * fixed checking whether filename is empty or not * bump indentation * fixed if else * Fix linting Co-authored-by: Gregor Sturm Co-authored-by: Felipe Marques de Almeida --- modules/kallistobustools/count/main.nf | 20 ++++++------ tests/modules/kallistobustools/count/main.nf | 24 +++++++++----- .../kallistobustools/count/nextflow.config | 2 +- tests/modules/kallistobustools/count/test.yml | 31 +++++++++---------- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/modules/kallistobustools/count/main.nf b/modules/kallistobustools/count/main.nf index d674aece..10840da6 100644 --- a/modules/kallistobustools/count/main.nf +++ b/modules/kallistobustools/count/main.nf @@ -2,10 +2,10 @@ process KALLISTOBUSTOOLS_COUNT { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? 'bioconda::kb-python=0.26.3' : null) + conda (params.enable_conda ? 'bioconda::kb-python=0.27.2' : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/kb-python:0.26.3--pyhdfd78af_0' : - 'quay.io/biocontainers/kb-python:0.26.3--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/kb-python:0.27.2--pyhdfd78af_0' : + 'quay.io/biocontainers/kb-python:0.27.2--pyhdfd78af_0' }" input: tuple val(meta), path(reads) @@ -13,7 +13,6 @@ process KALLISTOBUSTOOLS_COUNT { path t2g path t1c path t2c - val workflow_mode val technology output: @@ -24,10 +23,10 @@ process KALLISTOBUSTOOLS_COUNT { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def cdna = t1c ? "-c1 $t1c" : '' - def introns = t2c ? "-c2 $t2c" : '' + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def cdna = t1c ? "-c1 $t1c" : '' + def introns = t2c ? "-c2 $t2c" : '' """ kb \\ count \\ @@ -36,12 +35,11 @@ process KALLISTOBUSTOOLS_COUNT { -g $t2g \\ $cdna \\ $introns \\ - --workflow $workflow_mode \\ -x $technology \\ $args \\ -o ${prefix}.count \\ - ${reads[0]} \\ - ${reads[1]} + ${reads.join( " " )} \\ + -m ${task.memory.toGiga()}G cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/tests/modules/kallistobustools/count/main.nf b/tests/modules/kallistobustools/count/main.nf index 6e6be03d..1dd55cb3 100644 --- a/tests/modules/kallistobustools/count/main.nf +++ b/tests/modules/kallistobustools/count/main.nf @@ -2,23 +2,31 @@ nextflow.enable.dsl = 2 +include { KALLISTOBUSTOOLS_REF } from '../../../../modules/kallistobustools/ref/main.nf' include { KALLISTOBUSTOOLS_COUNT } from '../../../../modules/kallistobustools/count/main.nf' workflow test_kallistobustools_count { input = [ [id:'test'], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_10x_1_fastq_gz'], checkIfExists: true), + [ + file(params.test_data['homo_sapiens']['illumina']['test_10x_1_fastq_gz'], checkIfExists: true), file(params.test_data['homo_sapiens']['illumina']['test_10x_2_fastq_gz'], checkIfExists: true) ] ] - index = file("https://github.com/FloWuenne/test-datasets/blob/scrnaseq/reference/kallistobustools/kb_ref.idx?raw=true", checkIfExists: true) - t2g = file("https://raw.githubusercontent.com/FloWuenne/test-datasets/scrnaseq/reference/kallistobustools/t2g.txt", checkIfExists: true) - t1c = [] - t2c = [] - workflow = "standard" - technology = "10XV3" + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) + sc_workflow = "standard" + technology = "10XV3" - KALLISTOBUSTOOLS_COUNT ( input, index, t2g, t1c, t2c, workflow, technology ) + KALLISTOBUSTOOLS_REF(fasta, gtf, sc_workflow) + KALLISTOBUSTOOLS_COUNT ( + input, + KALLISTOBUSTOOLS_REF.out.index, + KALLISTOBUSTOOLS_REF.out.t2g, + KALLISTOBUSTOOLS_REF.out.cdna_t2c.ifEmpty{ [] }, // when empty the module doesn't run unless something is passed. + KALLISTOBUSTOOLS_REF.out.intron_t2c.ifEmpty{ [] }, // when empty the module doesn't run unless something is passed. + technology + ) } diff --git a/tests/modules/kallistobustools/count/nextflow.config b/tests/modules/kallistobustools/count/nextflow.config index eb4e20bd..eacd1e3a 100644 --- a/tests/modules/kallistobustools/count/nextflow.config +++ b/tests/modules/kallistobustools/count/nextflow.config @@ -3,7 +3,7 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } withName: KALLISTOBUSTOOLS_COUNT { - ext.args = '--cellranger -m 1' + ext.args = '--cellranger -m 1 --workflow standard' } } diff --git a/tests/modules/kallistobustools/count/test.yml b/tests/modules/kallistobustools/count/test.yml index 664e9fa6..57009617 100644 --- a/tests/modules/kallistobustools/count/test.yml +++ b/tests/modules/kallistobustools/count/test.yml @@ -1,36 +1,33 @@ - name: kallistobustools count test_kallistobustools_count - command: nextflow run ./tests/modules/kallistobustools/count -entry test_kallistobustools_count -c ./tests/config/nextflow.config -c ./tests/modules/kallistobustools/count/nextflow.config + command: nextflow run ./tests/modules/kallistobustools/count -entry test_kallistobustools_count -c ./tests/config/nextflow.config -c ./tests/modules/kallistobustools/count/nextflow.config tags: - - kallistobustools/count - kallistobustools + - kallistobustools/count files: + - path: output/kallistobustools/cdna.fa + - path: output/kallistobustools/kb_ref_out.idx + - path: output/kallistobustools/t2g.txt - path: output/kallistobustools/test.count/10x_version3_whitelist.txt md5sum: 3d36d0a4021fd292b265e2b5e72aaaf3 - path: output/kallistobustools/test.count/counts_unfiltered/cellranger/barcodes.tsv - md5sum: 8f734732c46f52c4d1c025bfe4134bd2 + md5sum: 8a41142de30df61fbb9551b29dd05a83 - path: output/kallistobustools/test.count/counts_unfiltered/cellranger/genes.tsv - md5sum: fbebf995a3de568db8ac028cd0c5d993 + md5sum: 1b31f05f9b20a4c0ac3e07b9e3ff3a14 - path: output/kallistobustools/test.count/counts_unfiltered/cellranger/matrix.mtx - md5sum: 4847bae27c41961496d504bcfe9890ba + md5sum: 5b7bff2d19fc90168733f4ac812c7d7b - path: output/kallistobustools/test.count/counts_unfiltered/cells_x_genes.barcodes.txt - md5sum: cafdf96423987e3d9e807cdc16139541 + md5sum: 8d7ef602416818a598f5680a707756a7 - path: output/kallistobustools/test.count/counts_unfiltered/cells_x_genes.genes.txt - md5sum: 52d0627aaf0418bebe3ef75ad77da53f + md5sum: fe6d5501923867b514a0447aa4b4995f - path: output/kallistobustools/test.count/counts_unfiltered/cells_x_genes.mtx - md5sum: d05e1582385ba5f215fa73c470343c06 + md5sum: 0a84dc5a7570b5821da4eef6b5769a0c - path: output/kallistobustools/test.count/inspect.json - md5sum: d3d23063f3fc07f7fbd24748aa4271a9 + md5sum: b853330f160e06fc8af170a837384ef5 - path: output/kallistobustools/test.count/kb_info.json - contains: - - "kallisto" - path: output/kallistobustools/test.count/matrix.ec - md5sum: cd8340e3fb78d74ad85fabdbe0a778f0 - path: output/kallistobustools/test.count/output.bus - md5sum: f4702922bd0c142e34b3680c2251426a + md5sum: f5d8efa83f107826824292cbbdb4e37b - path: output/kallistobustools/test.count/output.unfiltered.bus - md5sum: e38f99748e598e33fe035b89e7c89fb5 + md5sum: dcbc651dc64eb38ae14e0b90795b30d2 - path: output/kallistobustools/test.count/run_info.json - contains: - - "n_targets" - path: output/kallistobustools/test.count/transcripts.txt - md5sum: 6d583083eaf6ca81e409332a40d2e74c