Skip to content

Commit

Permalink
Merge branch 'add_pigz' of https://github.com/atrigila/smrnaseq into …
Browse files Browse the repository at this point in the history
…add_pigz
  • Loading branch information
atrigila committed Sep 17, 2024
2 parents 21b5522 + 4d94bfc commit bf7558c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [[#425]](https://github.com/nf-core/smrnaseq/pull/425) - Raise [minimum required NXF version for pipeline](https://github.com/nf-core/smrnaseq/issues/424) - usage of `arity` in some modules now requires this
- [[#426]](https://github.com/nf-core/smrnaseq/pull/426) - Add [nf-core mirtop](https://github.com/nf-core/smrnaseq/issues/417) - replace local `mirtop`
- [[#427]](https://github.com/nf-core/smrnaseq/pull/427) - Add [nf-core pigz uncompress](https://github.com/nf-core/smrnaseq/issues/422) - replace local `mirdeep_pigz`
- [[#429]](https://github.com/nf-core/smrnaseq/pull/429) - Make [saving of intermediate files optional](https://github.com/nf-core/smrnaseq/issues/424) - Allows user to choose whether to save intermediate files or not. Replaces several params that referred to the same such as `params.save_aligned` and `params.save_aligned_mirna_quant`.

## v2.3.1 - 2024-04-18 - Gray Zinc Dalmation Patch

Expand Down
30 changes: 26 additions & 4 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ process {
]
}

withName: 'UNTAR' {
publishDir = [
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

//
// FASTQ_FASTQC_UMITOOLS_FASTP
//
Expand Down Expand Up @@ -110,6 +118,7 @@ process {
publishDir = [
path: { "${params.outdir}/fastqc/raw" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
Expand All @@ -119,6 +128,7 @@ process {
publishDir = [
path: { "${params.outdir}/fastqc/trimmed" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
Expand Down Expand Up @@ -161,6 +171,7 @@ process {
publishDir = [
path: { "${params.outdir}/bowtie_index/genome" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
Expand Down Expand Up @@ -249,27 +260,31 @@ process {
publishDir = [
path: { "${params.outdir}/mirna_quant/reference" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName: 'NFCORE_SMRNASEQ:MIRNA_QUANT:PARSE_.*' {
publishDir = [
path: { "${params.outdir}/mirna_quant/reference" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName: 'NFCORE_SMRNASEQ:MIRNA_QUANT:INDEX_MATURE' {
publishDir = [
path: { "${params.outdir}/bowtie_index/mirna_mature" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName: 'NFCORE_SMRNASEQ:MIRNA_QUANT:INDEX_HAIRPIN' {
publishDir = [
path: { "${params.outdir}/bowtie_index/mirna_hairpin" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
Expand All @@ -278,14 +293,15 @@ process {
path: { "${params.outdir}/mirna_quant/bam/mature" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
enabled: params.save_aligned_mirna_quant
enabled: params.save_intermediates
]
}
withName: 'NFCORE_SMRNASEQ:MIRNA_QUANT:BAM_STATS_MATURE:.*' {
ext.prefix = { "${meta.id}.sorted" }
publishDir = [
path: { "${params.outdir}/mirna_quant/bam/mature" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
Expand All @@ -294,14 +310,15 @@ process {
path: { "${params.outdir}/mirna_quant/bam/hairpin" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
enabled: params.save_aligned_mirna_quant
enabled: params.save_intermediates
]
}
withName: 'NFCORE_SMRNASEQ:MIRNA_QUANT:BAM_STATS_HAIRPIN:.*' {
ext.prefix = { "${meta.id}.sorted" }
publishDir = [
path: { "${params.outdir}/mirna_quant/bam/hairpin" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
Expand All @@ -316,6 +333,7 @@ process {
publishDir = [
path: { "${params.outdir}/mirna_quant/seqcluster" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
ext.args = "-m 1 --min_size 15"
Expand All @@ -326,7 +344,7 @@ process {
path: { "${params.outdir}/mirna_quant/bam/seqcluster" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
enabled: params.save_aligned_mirna_quant
enabled: params.save_intermediates
]
}

Expand Down Expand Up @@ -371,12 +389,16 @@ process {
publishDir = [
path: { "${params.outdir}/genome_quant/bam" },
mode: params.publish_dir_mode,
enabled: params.save_intermediates,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'SAMTOOLS_INDEX' {
ext.args = '-c'
publishDir = [
enabled: params.save_intermediates,
]
}

withName: 'NFCORE_SMRNASEQ:GENOME_QUANT:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*' {
Expand All @@ -392,7 +414,7 @@ process {
path: { "${params.outdir}/genome_quant/bam" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
enabled: params.save_aligned
enabled: params.save_intermediates
]
}

Expand Down
4 changes: 4 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
- [MultiQC](#multiqc) - aggregate report, describing results of the whole pipeline
- [Pipeline information](#pipeline-information) - Report metrics generated during the workflow execution

If `--save_intermediates` is specified, intermediate files generated by each process will be saved in the output directory.

### FastQC

<details markdown="1">
Expand Down Expand Up @@ -102,6 +104,8 @@ MultiQC reports the number of reads that were removed by each of the contaminant
- `sample_mature_hairpin_unmapped.fq.gz`: Unmapped reads against miRNA precursors (hairpins)
- `sample_mature_hairpin_genome.bam`: The aligned BAM file of alignment against that didn't map to the precursor.

If `--save_intermediates` is specified, these files will be placed in this directory.

## SAMtools

[SAMtools](http://samtools.sourceforge.net/) is used for sorting and indexing the output BAM files from Bowtie. In addition, the numbers of features are counted with the `idxstats` option.
Expand Down
4 changes: 4 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ genome: 'GRCh37'

You can also generate such `YAML`/`JSON` files via [nf-core/launch](https://nf-co.re/launch).

## Optional parameters

If `--save_intermediates` is specified, the intermediate files generated in the pipeline will be saved in the output directory.

### Updating the pipeline

When you run the above command, Nextflow automatically pulls the pipeline code from GitHub and stores it as a cached version. When running the pipeline after this, it will always use the cached version if available - even if the pipeline has been updated since. To make sure that you're running the latest version of the pipeline, make sure that you regularly update the cached version of the pipeline:
Expand Down
8 changes: 4 additions & 4 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
params {

// Input options

input = null

// Protocol default (override via config profile - NOT directly via parameter!)
Expand All @@ -28,10 +27,11 @@ params {
mirgenedb_hairpin = null
mirgenedb_gff = null
mirgenedb_species = null
save_aligned = false
save_aligned_mirna_quant = true
bowtie_index = null

// General pipeline configuration
save_intermediates = false

// UMI handling
with_umi = false
// skips umitools extract in FASTQ_FASTQC_UMITOOLS_FASTP subworkflow. Needs to be true for fastq mode in collapsing reads
Expand All @@ -50,7 +50,7 @@ params {
fastp_min_length = 17
fastp_known_mirna_adapters = "$projectDir/assets/known_adapters.fa"
save_trimmed_fail = false
save_merged = true
save_merged = false
skip_fastqc = false
skip_multiqc = false
skip_mirdeep = false
Expand Down
20 changes: 6 additions & 14 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
"default": "custom",
"fa_icon": "fas fa-atom",
"enum": ["custom", "illumina", "nextflex", "qiaseq", "cats"]
},
"save_intermediates": {
"type": "boolean",
"description": "Save all intermediate files (e.g. fastq, bams) to output directory",
"fa_icon": "fas fa-save"
}
}
},
Expand Down Expand Up @@ -185,19 +190,6 @@
"help_text": "Saving generated references means that you can use them for future pipeline runs, reducing processing times.",
"fa_icon": "fas fa-save"
},
"save_aligned": {
"type": "boolean",
"fa_icon": "fas fa-save",
"help_text": "Save aligned reads of initial bowtie mapping.",
"description": "Save aligned reads of initial mapping in bam format."
},
"save_aligned_mirna_quant": {
"type": "boolean",
"fa_icon": "fas fa-save",
"default": true,
"help_text": "Save aligned reads of the bowtie runs in BOWTIE_MAP_MATURE, BOWTIE_MAP_HAIRPIN, and BOWTIE_MAP_SEQCLUSTER.",
"description": "Save aligned reads of miRNA quant subworkflow in bam format."
},
"igenomes_ignore": {
"type": "boolean",
"description": "Do not load the iGenomes reference config.",
Expand Down Expand Up @@ -270,7 +262,7 @@
"save_merged": {
"type": "boolean",
"description": "Save merged reads.",
"default": true
"default": false
},
"phred_offset": {
"type": "integer",
Expand Down

0 comments on commit bf7558c

Please sign in to comment.