Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [[1.3.0](https://github.com/sanger-tol/sequencecomposition/releases/tag/1.3.0)] – –

### Enhancements & fixes

- New `--window_size` parameter to select the size of the windows to compute statistics on.
It replaces the `--window_size_info` parameter, which only affected output naming.
- Better validation of the `--selected_fw_output` parameter.

### Parameters

| Old parameter | New parameter |
| -------------------- | --------------- |
| `--window_size_info` | `--window_size` |

> **NB:** Parameter has been **updated** if both old and new parameter information is present. </br> **NB:** Parameter has been **added** if just the new parameter information is present. </br> **NB:** Parameter has been **removed** if new parameter information isn't present.

## [[1.2.1](https://github.com/sanger-tol/sequencecomposition/releases/tag/1.2.1)] – Easter Bells (patch 1) – [2026-05-15]

### Enhancements & fixes
Expand Down
10 changes: 10 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@

process {

withName: "FASTAWINDOWS" {
ext.args = { "-w ${ params.window_size }" }
}

withName: BGZIPTABIX {
ext.prefix = {
def ws = params.window_size as int
def ws_label = (ws % 1000 == 0) ? "${ws.intdiv(1000)}k" : "${ws}bp"
return "${meta.id}.${ws_label}"
}

ext.args2 = { "--preset bed" + (column_numbers ? "" : " --skip-lines 1") }
publishDir = [
path: { "${meta.outdir}/${meta.analysis_subdir}" },
Expand Down
5 changes: 3 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ params {
// Input options
input = null
fasta = null
window_size_info = ".1k"
// keep in sync with the `--window_size` parameter of fasta_windows

// Output options
selected_fw_output = "${projectDir}/assets/fasta_windows.csv"
window_size = 1000

// Boilerplate options
outdir = 'results'
Expand Down
16 changes: 9 additions & 7 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "object",
"fa_icon": "fas fa-terminal",
"description": "Define where the pipeline should find input data and save output data.",
"required": ["outdir", "window_size_info", "selected_fw_output"],
"required": ["outdir", "window_size", "selected_fw_output"],
"properties": {
"fasta": {
"type": "string",
Expand Down Expand Up @@ -41,16 +41,18 @@
"selected_fw_output": {
"type": "string",
"default": "${projectDir}/assets/fasta_windows.csv",
"format": "file-path",
"exists": true,
"description": "Path to comma-separated file containing information about the statistics to select from fasta_windows' output.",
"hidden": true,
"fa_icon": "fas fa-barcode"
},
"window_size_info": {
"type": "string",
"default": ".1k",
"hidden": true,
"description": "String to add to all file names generated by the pipeline. This is meant to reflect the size of the windows fasta_windows is computing statistics on.",
"fa_icon": "fas fa-arrows-alt-h"
"window_size": {
"type": "integer",
"default": 1000,
"description": "Window size (in base pairs) used to partition sequences for calculating per-window statistics",
"fa_icon": "fas fa-chart-bar",
"minimum": 1
},
"email": {
"type": "string",
Expand Down
5 changes: 2 additions & 3 deletions subworkflows/local/fasta_windows.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ workflow FASTA_WINDOWS {
take:
fasta_fai // [file: /path/to/genome.fa, file: /path/to/genome.fai]
output_selection // file: /path/to/fasta_windows.csv
window_size_info // value, used to build meta.id and name files

main:

Expand Down Expand Up @@ -40,7 +39,7 @@ workflow FASTA_WINDOWS {
ch_freq_bed_input = FASTAWINDOWS.out.freq
.combine(ch_config.freq)
.multiMap { meta, freq_file_tsv, column_number, outdir, filename ->
path: [meta + [id: meta.id + "." + filename + window_size_info, analysis_subdir: outdir], freq_file_tsv, meta.max_length]
path: [meta + [id: meta.id + "." + filename, analysis_subdir: outdir], freq_file_tsv, meta.max_length]
column_number: ["1-3,${column_number}", 1, "bedGraph"]
}

Expand All @@ -58,7 +57,7 @@ workflow FASTA_WINDOWS {
.mix(FASTAWINDOWS.out.dinuc.combine(ch_config.dinuc))
.mix(FASTAWINDOWS.out.trinuc.combine(ch_config.trinuc))
.mix(FASTAWINDOWS.out.tetranuc.combine(ch_config.tetranuc))
.map { meta, path, outdir, filename -> [meta + [id: meta.id + "." + filename + window_size_info, analysis_subdir: outdir], path] }
.map { meta, path, outdir, filename -> [meta + [id: meta.id + "." + filename, analysis_subdir: outdir], path] }

// Compress the BED file
ch_tsv_with_seq_length = ch_tsv.map { meta, tsv -> [meta, tsv, meta.max_length] }
Expand Down
1 change: 0 additions & 1 deletion workflows/sequencecomposition.nf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ workflow SEQUENCECOMPOSITION {
FASTA_WINDOWS(
PARAMS_CHECK.out.fasta_fai,
file(params.selected_fw_output, checkExists: true),
params.window_size_info,
)

//
Expand Down
Loading