Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
15919fa
Mport the ichorCNA modules
lbeltrame Nov 18, 2025
dbb44da
Port the option handling to the newer ichorCNA modules
lbeltrame Nov 18, 2025
088a8a2
Finish porting to the newer ichorCNA modules
lbeltrame Nov 18, 2025
f3e0c43
Remove local ichorCNA modules
lbeltrame Nov 18, 2025
92f928f
Plumbing to support PoN samples in the samplesheet directly
lbeltrame Nov 19, 2025
d2b7d9f
Remove configuration for modules that no longer exist
lbeltrame Nov 19, 2025
9c2730d
Act defensively when supplying ichorCNA parameters
lbeltrame Nov 20, 2025
33c9287
Convert "string booleans" to proper bools
lbeltrame Nov 20, 2025
a8080e4
Port the remnants of the configuration
lbeltrame Nov 20, 2025
e1cf0a2
Update default in schema
lbeltrame Nov 20, 2025
a4f6770
Convert the workflow to the use of PoN in the samplesheet
lbeltrame Nov 20, 2025
1471bc3
Fix option type
lbeltrame Nov 24, 2025
3af75b6
Don't consume the aligner index after first use
lbeltrame Nov 24, 2025
24f39fe
Use actually the correct file
lbeltrame Nov 25, 2025
d462530
Switch container image to the polars-based CLI tool
lbeltrame Nov 25, 2025
e664f75
Use the right column name
lbeltrame Nov 25, 2025
ba848bc
The quest for the right column ID continues...
lbeltrame Nov 25, 2025
baa1f35
Fix another column namee
lbeltrame Nov 26, 2025
456b6b7
Fix dashes vs underscores
lbeltrame Nov 26, 2025
7653eca
remove all references to pon_path
lbeltrame Dec 2, 2025
ed1cb14
Better error message
lbeltrame Dec 2, 2025
3957a02
Add a trailing "," to args
lbeltrame Dec 2, 2025
0cb46e8
Try to collect all samples for WisecondorX
lbeltrame Dec 10, 2025
674e90d
Update the ichorCNA modules to add the fix for chrX
lbeltrame Dec 10, 2025
7e3bfb0
Actually fix WisecondorX PoN
lbeltrame Dec 10, 2025
d7514a9
CIn signatures: don't plot if there's only one sample (#59)
lbeltrame Dec 10, 2025
9736ba4
Update documentation and CHANGELOG
lbeltrame Dec 10, 2025
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
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Breaking changes

- A new **mandatory** column has been added in the samplesheet, `status`, which can be either `normal` or `tumor` (@lbeltrame, issue #13)
- Option `--pon_path` has been **removed**. Instead, add your normal samples to the samplesheet (same rules as case samples) with the `normal` status
- Due to a bug in ichorCNA with security implications, the syntax of all options regarding ichorCNA chromosome handling (but not the `readcounter` parameters) has changed:
- Specify chromosomes with _identifier only_ (without `chr`)
- Valid values are individual chromosomes, separated by comma (e.g. `1` or `1,2`), ranges using `:` (`1:22`) or a combination of the above (`1:22, X`). If you set `ichorcna_genomestyle`, the right prefix will be appended for you when running the analysis
- `ichorcna_plotylim` now takes a min and max value separated by comma (e.g. `-2,4`)
- All the ichorCNA options that require `TRUE` or `FALSE` now take a boolean `true` or `false`
- Raw R in any ichorCNA option (e.g. `c(1,2)`) is no longer supported and will raise an error.

### New features

- Support the latest version of ichorCNA (@lbeltrame and @SaraPotente, PR #57)
- Update the ichorCNA modules to the latest upstream nf-core versions (@lbeltrame, PR #57)
- PoN support in the samplesheet (@lbeltrame, #13, PR #57)

### Bug fixes

- Don't raise an error if in CIN quantification there is only one sample (#59, @lbeltrame)

## v1.3.1 - "Mori Ranmaru" (2025-11-17)

This release is a hotfix for a regression in size selection that somehow slipped under the radar.
Expand Down
16 changes: 15 additions & 1 deletion assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,22 @@
}
],
"meta": ["gender"]
},
"status": {
"errorMessage": "Status must be either tumor or normal",
"anyOf": [
{
"type": "string",
"enum": ["tumor", "normal"]
},
{
"type": "string",
"maxLength": 0
}
],
"meta": ["status"]
}
},
"anyOf": [{ "required": ["sample", "fastq_1"] }, { "required": ["sample", "bam"] }]
"anyOf": [{ "required": ["sample", "fastq_1", "status"] }, { "required": ["sample", "bam", "status"] }]
}
}
8 changes: 6 additions & 2 deletions bin/compute_signatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ df_activity <- df_activity %>%
readr::write_tsv(df_activity, file = paste0(args$projectname, "_activity.txt"),
quote = "needed")

png(filename="ascat_sc_plot_by_component.png")
plotSampleByComponent(object = cnobj)
# Only plot if samples are > 1
total_samples <- segments %>% pull(sample) %>% unique() %>% length()
png(filename = "ascat_sc_plot_by_component.png")
if (total_samples > 1) {
plotSampleByComponent(object = cnobj)
}
dev.off()


Expand Down
8 changes: 6 additions & 2 deletions bin/correct_logr_ichorcna.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ def main(
),
):

segments = pl.scan_csv(seg, separator="\t")
segments = pl.scan_csv(seg, separator="\t").rename(
{"ID": "sample", "chrom": "chromosome"}
)
ploidy_df = pl.scan_csv(ploidy, separator="\t")

result = (
segments.join(
ploidy_df.select("sample", "Ploidy"), on="sample", how="left"
ploidy_df.select(pl.col("samplename").alias("sample"), "Ploidy"),
on="sample",
how="left",
)
.with_columns(
pl.col("logR_Copy_Number")
Expand Down
70 changes: 35 additions & 35 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -262,50 +262,51 @@ process {
}
}

withName: ICHORCNA_GENERATE_PON {
withName: ICHORCNA_CREATEPON {
publishDir = [
path: { "${params.outdir}/ichorcna/PoN/" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
ext.args = [
"--genomeStyle ${params.ichorcna_genome_style}",
"--genomeBuild ${params.genome}",
"--chrs \"${params.ichorcna_chrs_to_use}\"",
"--maleChrXLogRThres \"${params.ichorcna_male_chrX_logR}\"",
].join(' ')
ext.prefix = { params.pon_name ? "${params.pon_name}" : "PoN" }
"genomeStyle='${params.ichorcna_genome_style}'",
"chrs=\"${params.ichorcna_chrs_to_use}\"",
"minMapScore=${params.ichorcna_min_map_score}",
"fracReadsInChrYForMale=${params.ichorcna_fraction_reads_male}",
"maleChrXLogRThres=${params.ichorcna_male_chrX_logR}",
].join(",\n")
}

withName: RUN_ICHORCNA {
withName: ICHORCNA_RUN {
publishDir = [
path: { "${params.outdir}/ichorcna" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
ext.args = [
"--maxCN ${params.ichorcna_max_cn}",
"--chrTrain \"${params.ichorcna_chrs_to_train}\"",
"--chrs \"${params.ichorcna_chrs_to_use}\"",
"--txnE ${params.ichorcna_txne}",
"--txnStrength ${params.ichorcna_trx_strength}",
"--minMapScore ${params.ichorcna_min_map_score}",
"--fracReadsInChrYForMale ${params.ichorcna_fraction_reads_male}",
"--minSegmentBins ${params.ichorcna_min_segment_bins}",
"--maxFracGenomeSubclone ${params.ichorcna_max_frac_genome_subclone}",
"--maxFracCNASubclone ${params.ichorcna_max_frac_cna_subclone}",
"--includeHOMD ${params.ichorcna_include_homd}",
"--altFracThreshold ${params.ichorcna_alt_frac_threshold}",
"--genomeStyle ${params.ichorcna_genome_style}",
"--plotFileType ${params.ichorcna_plotfiletype}",
"--plotYLim '${params.ichorcna_plotylim}'",
"--normal 'c(${params.ichorcna_normal_states})'",
"--genomeBuild ${params.genome}",
params.ichorcna_estimate_ploidy ? "--ploidy 'c(2, 3, 4, 5)'" : "",
params.ichorcna_estimate_ploidy ? "--estimatePloidy TRUE" : "--estimatePloidy FALSE",
params.ichorcna_estimate_sc ? "--estimateScPrevalence TRUE" : "--estimateScPrevalence FALSE",
params.ichorcna_estimate_sc ? "--scStates 'c(1,3)'" : "--scStates 'c()'",
].join(' ')
"maxCN=${params.ichorcna_max_cn}",
params.ichorcna_genome_style == "UCSC" ? "chrTrain=\"paste0('chr', c(${params.ichorcna_chrs_to_train}))\"" : "chrTrain='c(${params.ichorcna_chrs_to_train})'",
params.ichorcna_genome_style == "UCSC" ? "chrs=\"paste0('chr', c(${params.ichorcna_chrs_to_use}))\"" : "chrs='c(${params.ichorcna_chrs_to_use})'",
params.ichorcna_genome_style == "UCSC" ? "chrNormalize=\"paste0('chr', c(${params.ichorcna_chrs_to_normalize}))\"" : "chrNormalize='c(${params.ichorcna_chrs_to_normalize})'",
"txnE=${params.ichorcna_txne}",
"txnStrength=${params.ichorcna_trx_strength}",
"minMapScore=${params.ichorcna_min_map_score}",
"fracReadsInChrYForMale=${params.ichorcna_fraction_reads_male}",
"minSegmentBins=${params.ichorcna_min_segment_bins}",
"maxFracCNASubclone=${params.ichorcna_max_frac_genome_subclone}",
params.ichorcna_include_homd ? "includeHOMD=TRUE" : "includeHOMD=FALSE",
"altFracThreshold=${params.ichorcna_alt_frac_threshold}",
"genomeStyle='${params.ichorcna_genome_style}'",
"plotFileType='${params.ichorcna_plotfiletype}'",
"plotYLim='c(${params.ichorcna_plotylim})'",
"normal='c(${params.ichorcna_normal_states})'",
"genomeBuild='${params.genome}'",
params.ichorcna_estimate_normal ? "estimateNormal=TRUE" : "estimateNormal=FALSE",
params.ichorcna_estimate_ploidy ? "ploidy='c(2, 3, 4, 5)'" : "ploidy='2'",
params.ichorcna_estimate_ploidy ? "estimatePloidy=TRUE" : "estimatePloidy=FALSE",
params.ichorcna_estimate_sc ? "estimateScPrevalence=TRUE" : "estimateScPrevalence=FALSE",
params.ichorcna_estimate_sc ? "scStates='c(1,3)'" : "scStates='c()'",
].join(",\n") + ", "
}

withName: AGGREGATE_ICHORCNA_TABLE {
Expand Down Expand Up @@ -334,7 +335,7 @@ process {
}

withName: CONCATENATE_QDNASEQ_PLOTS {
publishDir = [
publishDir = [
path: { "${params.outdir}/cn_plots/qdnaseq/" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
Expand Down Expand Up @@ -432,23 +433,23 @@ process {
}

withName: CONCATENATE_BIN_PLOTS {
publishDir = [
publishDir = [
path: { "${params.outdir}/cn_plots/ichorcna" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: CONCATENATE_ASCATSC_PLOTS {
publishDir = [
publishDir = [
path: { "${params.outdir}/cn_plots/ascat_sc" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: CONCATENATE_ASCATSC_REFITTED_PLOTS {
publishDir = [
publishDir = [
path: { "${params.outdir}/cn_plots/ascat_sc_refitted" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
Expand Down Expand Up @@ -534,5 +535,4 @@ process {
].join(' ')
ext.when = params.run_gistic
}

}
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ params {
config_profile_description = 'Minimal test dataset to check pipeline function with ASCAT.sc caller and solid_biopsy subworkflow.'

// Input data
input = 'https://github.com/DIncalciLab/samurai-test-data/raw/refs/heads/master/samplesheet.csv'
input = 'https://github.com/DIncalciLab/samurai-test-data/raw/refs/heads/new-samplesheet-format/samplesheet.csv'

// Genome references
genome = 'hg38'
Expand Down
2 changes: 1 addition & 1 deletion conf/test_ichorcna.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ params {
config_profile_description = 'Minimal test dataset to check pipeline function with ichorCNA caller and liquid_biopsy subworkflow.'

// Input data
input = 'https://github.com/DIncalciLab/samurai-test-data/raw/refs/heads/master/samplesheet.csv'
input = 'https://github.com/DIncalciLab/samurai-test-data/raw/refs/heads/new-samplesheet-format/samplesheet.csv'

// Genome references
genome = 'hg38'
Expand Down
Loading