|
| 1 | +process PROSEG { |
| 2 | + tag "$meta.id" |
| 3 | + label 'process_high' |
| 4 | + |
| 5 | + container "nf-core/proseg:1.1.8" |
| 6 | + |
| 7 | + input: |
| 8 | + tuple val(meta), path(transcripts) |
| 9 | + |
| 10 | + output: |
| 11 | + tuple val(meta), path("cell-polygons.geojson.gz"), emit: cell_polygons_2d |
| 12 | + path("expected-counts.csv.gz"), emit: expected_counts |
| 13 | + path("cell-metadata.csv.gz"), emit: cell_metadata |
| 14 | + path("transcript-metadata.csv.gz"), emit: transcript_metadata |
| 15 | + path("gene-metadata.csv.gz"), emit: gene_metadata |
| 16 | + path("rates.csv.gz"), emit: rates |
| 17 | + path("cell-polygons-layers.geojson.gz"), emit: cell_polygons_layers |
| 18 | + path("cell-hulls.geojson.gz"), emit: cell_hulls |
| 19 | + path("versions.yml"), emit: versions |
| 20 | + |
| 21 | + when: |
| 22 | + task.ext.when == null || task.ext.when |
| 23 | + |
| 24 | + script: |
| 25 | + // Exit if running this module with -profile conda / -profile mamba |
| 26 | + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { |
| 27 | + error "PROSEG module does not support Conda. Please use Docker / Singularity / Podman instead." |
| 28 | + } |
| 29 | + def args = task.ext.args ?: '' |
| 30 | + def prefix = task.ext.prefix ?: "${meta.id}" |
| 31 | + def platform = preset ? "${params.preset}" : "" |
| 32 | + |
| 33 | + // check for preset values |
| 34 | + if (!(platform in ['xenium', 'cosmx', 'merscope'])) { |
| 35 | + error "${platform} is an invalid platform (preset) type. Please specify xenium, cosmx, or merscope" |
| 36 | + } |
| 37 | + |
| 38 | + """ |
| 39 | + proseg \\ |
| 40 | + --${preset} \\ |
| 41 | + ${transcripts} \\ |
| 42 | + --nthreads ${task.cpus} \\ |
| 43 | + --output-expected-counts expected-counts.csv.gz \\ |
| 44 | + --output-cell-metadata cell-metadata.csv.gz \\ |
| 45 | + --output-transcript-metadata transcript-metadata.csv.gz \\ |
| 46 | + --output-gene-metadata gene-metadata.csv.gz \\ |
| 47 | + --output-rates rates.csv.gz \\ |
| 48 | + --output-cell-polygons cell-polygons.geojson.gz \\ |
| 49 | + --output-cell-polygon-layers cell-polygons-layers.geojson.gz \\ |
| 50 | + --output-cell-hulls cell-hulls.geojson.gz \\ |
| 51 | + ${args} |
| 52 | +
|
| 53 | + cat <<-END_VERSIONS > versions.yml |
| 54 | + "${task.process}": |
| 55 | + proseg: \$(proseg --version | sed 's/proseg //') |
| 56 | + END_VERSIONS |
| 57 | + """ |
| 58 | + |
| 59 | + stub: |
| 60 | + // Exit if running this module with -profile conda / -profile mamba |
| 61 | + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { |
| 62 | + error "PROSEG module does not support Conda. Please use Docker / Singularity / Podman instead." |
| 63 | + } |
| 64 | + def args = task.ext.args ?: '' |
| 65 | + def prefix = task.ext.prefix ?: "${meta.id}" |
| 66 | + |
| 67 | + """ |
| 68 | + touch expected-counts.csv.gz |
| 69 | + touch cell-metadata.csv.gz |
| 70 | + touch transcript-metadata.csv.gz |
| 71 | + touch gene-metadata.csv.gz |
| 72 | + touch rates.csv.gz |
| 73 | + touch cell-polygons.geojson.gz |
| 74 | + touch cell-polygons-layers.geojson.gz |
| 75 | + touch cell-hulls.geojson.gz |
| 76 | +
|
| 77 | + cat <<-END_VERSIONS > versions.yml |
| 78 | + "${task.process}": |
| 79 | + proseg: \$(proseg --version | sed 's/proseg //') |
| 80 | + END_VERSIONS |
| 81 | + """ |
| 82 | +} |
0 commit comments