Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [2.5.1] - 2024-02-16

### `Added`

- [#1037](https://github.com/nf-core/eager/issues/1037) Added an option to deactivate the `-sorted` option of bedtools coverage, in case the feature file is not sorted the same way as the fasta file. (♥ Thanks to @IdoBar for reporting, and contributing.)
Comment thread
TCLamnidis marked this conversation as resolved.
Outdated

### `Fixed`

- [#1048](https://github.com/nf-core/eager/issues/1048) `--vcf2genome_outfile` parameter now gets prefixed by the sample_name and suffixed with `.fasta` (i.e. `<sample_name>_<vcf2genome_outfile>.fasta`). This ensures we avoid overwriting the output fasta of one sample with that of another when the option is provided. (♥ Thanks to @MeriamOs for reporting.)
- [#1047](https://github.com/nf-core/eager/issues/1047) Changed the row some statistics were reported in the General Stats table. The File name collision fixed in 2.5.0 (see #1017) caused these statistics to be reported in the wrong row due to an added suffix.
- [#1051](https://github.com/nf-core/eager/issues/1051) An error is now thrown if input BAM files end in `.unmapped.bam`, as that breaks the bam filtering process and empties the bam files in the process. (♥ Thanks to @PCQuilis for reporting.)
Comment thread
TCLamnidis marked this conversation as resolved.
Outdated

### `Dependencies`

### `Deprecated`

## [2.5.0] - Bopfingen - 2023-11-03

### `Added`
Expand Down
2 changes: 2 additions & 0 deletions assets/multiqc_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ extra_fn_clean_exts:
- ".trimmed_stats"
- "_libmerged"
- "_bt2"
- type: "regex"
pattern: "_udg(half|none|full)"
Comment thread
jfy133 marked this conversation as resolved.

top_modules:
- "fastqc":
Expand Down
Binary file modified docs/images/usage/eager2_metromap_complex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions docs/images/usage/eager2_metromap_complex.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/usage/eager2_workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 19 additions & 13 deletions docs/images/usage/eager2_workflow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 12 additions & 3 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ if ( params.bam && !params.single_end ) {
exit 1, "[nf-core/eager] error: bams can only be specified with --single_end. Please check input command."
}

// Do not allow input bams to be suffixed with '.unmapped.bam'
if (params.bam && params.input.endsWith('.unmapped.bam')) {
exit 1, "[nf-core/eager] error: Input BAM file names ending in '.unmapped.bam' are not allowed. Please rename your input BAM(s)."
}

// Validate that skip_collapse is only set to True for paired_end reads!
if (!has_extension(params.input, "tsv") && params.skip_collapse && params.single_end){
exit 1, "[nf-core/eager] error: --skip_collapse can only be set for paired_end samples."
Expand Down Expand Up @@ -379,6 +384,9 @@ ch_input_sample_check
def r2 = file(it[9]).getName()
def bam = file(it[10]).getName()

// Throw error and exit if the input bam has a name ending in '.unmapped.bam'
if (bam.endsWith('.unmapped.bam')) { exit 1, "[nf-core/eager] error: Input BAM file names ending in '.unmapped.bam' are not allowed. Please rename your input BAM(s)." }

[r1, r2, bam]

}
Expand Down Expand Up @@ -2063,13 +2071,14 @@ process bedtools {
tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, path("*")

script:
sorting_of_anno = params.anno_file_is_unsorted ? "" : '-sorted'
Comment thread
TCLamnidis marked this conversation as resolved.
Outdated
"""
## Create genome file from bam header
samtools view -H ${bam} | grep '@SQ' | sed 's#@SQ\tSN:\\|LN:##g' > genome.txt

## Run bedtools
bedtools coverage -nonamecheck -g genome.txt -sorted -a ${anno_file} -b ${bam} | pigz -p ${task.cpus - 1} > "${bam.baseName}".breadth.gz
bedtools coverage -nonamecheck -g genome.txt -sorted -a ${anno_file} -b ${bam} -mean | pigz -p ${task.cpus - 1} > "${bam.baseName}".depth.gz
bedtools coverage -nonamecheck -g genome.txt ${sorting_of_anno} -a ${anno_file} -b ${bam} | pigz -p ${task.cpus - 1} > "${bam.baseName}".breadth.gz
bedtools coverage -nonamecheck -g genome.txt ${sorting_of_anno} -a ${anno_file} -b ${bam} -mean | pigz -p ${task.cpus - 1} > "${bam.baseName}".depth.gz
"""
}

Expand Down Expand Up @@ -2741,7 +2750,7 @@ process vcf2genome {
tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, path("*.fasta.gz")

script:
def out = !params.vcf2genome_outfile ? "${samplename}.fasta" : "${params.vcf2genome_outfile}"
def out = !params.vcf2genome_outfile ? "${samplename}.fasta" : "${samplename}_${params.vcf2genome_outfile}.fasta"
def fasta_head = !params.vcf2genome_header ? "${samplename}" : "${params.vcf2genome_header}"
"""
pigz -d -f -p ${task.cpus} ${vcf}
Expand Down
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ params {
rescale_seqlength = 12

//Bedtools settings
run_bedtools_coverage = false
run_bedtools_coverage = false
anno_file = null
anno_file_is_unsorted = false

//bamUtils trimbam settings
run_trim_bam = false
Expand Down
12 changes: 9 additions & 3 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,12 @@
"description": "Path to GFF or BED file containing positions of features in reference file (--fasta). Path should be enclosed in quotes.",
"fa_icon": "fas fa-file-signature",
"help_text": "Specify the path to a GFF/BED containing the feature coordinates (or any acceptable input for [`bedtools coverage`](https://bedtools.readthedocs.io/en/latest/content/tools/coverage.html)). Must be in quotes.\n"
},
"anno_file_is_unsorted": {
"type": "boolean",
"fa_icon": "fas fa-random",
"description": "Specify if the annotation file provided to --anno_file is not sorted in the same way as the reference fasta file.",
"help_text": "In cases where the annotation file is NOT sorted the same way as the reference fasta, this option should be specified. This will significantly increase the memory usage of bedtools!\n\n> Modifies bedtools parameter: `-sorted`"
}
},
"fa_icon": "fas fa-scroll",
Expand Down Expand Up @@ -1330,9 +1336,9 @@
},
"vcf2genome_outfile": {
"type": "string",
"description": "Specify name of the output FASTA file containing the consensus sequence. Do not include `.vcf` in the file name.",
"description": "Specify the name of the output FASTA file containing the consensus sequence.",
"fa_icon": "fas fa-file-alt",
"help_text": "The name of your requested output FASTA file. Do not include `.fasta` suffix.\n"
"help_text": "The output FASTA file will be named `<sample_name>_<vcf2genome_outfile>.fasta`.\n"
},
"vcf2genome_header": {
"type": "string",
Expand Down Expand Up @@ -1718,7 +1724,7 @@
"maltextract_percentidentity": {
"type": "number",
"description": "Minimum percent identity alignments are required to have to be reported. Recommended to set same as MALT parameter.",
"default": 85.0,
"default": 85,
"fa_icon": "fas fa-id-card",
"help_text": "Minimum percent identity alignments are required to have to be reported. Higher values allows fewer mismatches between read and reference sequence, but therefore will provide greater confidence in the hit. Lower values allow more mismatches, which can account for damage and divergence of a related strain/species to the reference. Recommended to set same as MALT parameter or higher. Default: `85`.\n\nOnly when `--metagenomic_tool malt` is also supplied.\n\n> Modifies MaltExtract parameter: `--minPI`"
},
Expand Down