From bb2d8a2417cbb33c4289627ea7d9a89a9a6e6873 Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 9 Mar 2026 12:34:01 +0100 Subject: [PATCH 1/2] update pre-commit and prettier settings according to template 3.5.1 --- .pre-commit-config.yaml | 26 ++++++++++++++++++++------ .prettierignore | 3 +++ .prettierrc.yml | 5 +++++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e9f0e1..d06777a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,10 +4,24 @@ repos: hooks: - id: prettier additional_dependencies: - - prettier@3.2.5 - - - repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: "3.0.3" + - prettier@3.6.2 + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 hooks: - - id: editorconfig-checker - alias: ec + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + exclude: | + (?x)^( + .*ro-crate-metadata.json$| + modules/nf-core/.*| + subworkflows/nf-core/.*| + .*\.snap$ + )$ + - id: end-of-file-fixer + exclude: | + (?x)^( + .*ro-crate-metadata.json$| + modules/nf-core/.*| + subworkflows/nf-core/.*| + .*\.snap$ + )$ diff --git a/.prettierignore b/.prettierignore index edd29f0..dd749d4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,4 +10,7 @@ testing/ testing* *.pyc bin/ +.nf-test/ ro-crate-metadata.json +modules/nf-core/ +subworkflows/nf-core/ diff --git a/.prettierrc.yml b/.prettierrc.yml index c81f9a7..07dbd8b 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -1 +1,6 @@ printWidth: 120 +tabWidth: 4 +overrides: + - files: "*.{md,yml,yaml,html,css,scss,js,cff}" + options: + tabWidth: 2 From efc8a31fdf6d4182ffa0232dda8f9034e461be3f Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 9 Mar 2026 12:34:42 +0100 Subject: [PATCH 2/2] run `pre-commit run --all-files` --- docs/output.md | 2 - modules/local/dmsanalysis/templates/aa_seq.R | 1 - .../templates/possible_mutations.R | 58 +++++++++---------- .../dmsanalysis/templates/process_gatk.R | 1 - .../fitness/fitness_experimental_design.nf | 2 +- .../templates/dimsum_experimentalDesign.R | 9 ++- .../fitness/templates/find_syn_mutation.R | 2 +- .../fitness/templates/fitness_calculation.R | 36 ++++++------ .../local/fitness/templates/merge_counts.R | 12 ++-- .../local/gatk/templates/gatk_to_fitness.R | 1 - .../templates/counts_per_cov_heatmap.R | 1 - .../templates/global_position_biases_cov.R | 3 - .../local/visualization/templates/logdiff.R | 2 - modules/local/visualization/visualization.nf | 2 +- subworkflows/local/calculatefitness.nf | 11 ++-- .../utils_nfcore_deepmutscan_pipeline/main.nf | 1 - workflows/deepmutscan.nf | 4 +- 17 files changed, 66 insertions(+), 82 deletions(-) diff --git a/docs/output.md b/docs/output.md index dfbbbef..8b10a3d 100644 --- a/docs/output.md +++ b/docs/output.md @@ -75,7 +75,6 @@ This directory is created during the second series of steps of the pipeline, fea Output files - `library_QC/` - - `counts_heatmap.pdf`: a complete heatmap of absolute mutant counts, stratified by mutant amino acid (Y-axis) per position (X-axis) ![Count heatmap](images/library_QC_counts_heatmap.png) @@ -104,7 +103,6 @@ This directory is created during the final series of steps of the pipeline, feat Output files - `fitness/` - - `counts_merged.tsv`: summarised gene variant counts across all input and output samples - `default_results/fitness_estimation_count_correlation.pdf`: pair-wise replicate variant count scatterplots and correlations between all specified samples ![Variant count correlation(s)](images/fitness_estimation_count_correlation.png) diff --git a/modules/local/dmsanalysis/templates/aa_seq.R b/modules/local/dmsanalysis/templates/aa_seq.R index a865280..9e759cd 100644 --- a/modules/local/dmsanalysis/templates/aa_seq.R +++ b/modules/local/dmsanalysis/templates/aa_seq.R @@ -63,4 +63,3 @@ writeLines( f ) close(f) - diff --git a/modules/local/dmsanalysis/templates/possible_mutations.R b/modules/local/dmsanalysis/templates/possible_mutations.R index 15275b9..13a0702 100644 --- a/modules/local/dmsanalysis/templates/possible_mutations.R +++ b/modules/local/dmsanalysis/templates/possible_mutations.R @@ -2,14 +2,14 @@ # ------------------------------------------------------------------------------ # Script: Generate Programmed Codon Variants -# Description: Generates all possible programmed codon mutations for a given +# Description: Generates all possible programmed codon mutations for a given # wild-type sequence based on a specified mutagenesis strategy. -# Input: +# Input: # - wt_seq_input: Wild-type sequence (string or path to FASTA file). # - start_stop_pos: Target sequence range format "start-stop". # - mutagenesis_type: Strategy ('nnk', 'nns', 'nnh', 'nnn', 'nnk_nns', 'nnk_nns_nnh', 'custom'). -# - custom_codon_library_path: Path to custom library. Automatically detects -# if the file is a global list ("AAA, AAC...") or a position-wise CSV +# - custom_codon_library_path: Path to custom library. Automatically detects +# if the file is a global list ("AAA, AAC...") or a position-wise CSV # (requires a "Position" header). # - output_file: Desired name/path for the output CSV. # Output: A CSV file containing all possible mutated codons per position. @@ -20,12 +20,12 @@ suppressMessages(library(methods)) generate_possible_variants <- function(wt_seq_input, start_stop_pos, mutagenesis_type, custom_codon_library_path, output_file) { - + # Parse the start and stop positions from the input format "start-stop" positions <- unlist(strsplit(start_stop_pos, "-")) start_pos <- as.numeric(positions[1]) stop_pos <- as.numeric(positions[2]) - + # Load sequence from file or process as a direct string if (file.exists(wt_seq_input)) { seq_data <- Biostrings::readDNAStringSet(filepath = wt_seq_input) @@ -33,11 +33,11 @@ generate_possible_variants <- function(wt_seq_input, start_stop_pos, mutagenesis } else { wt_seq <- Biostrings::DNAString(wt_seq_input) } - + # Extract the target coding sequence coding_seq <- Biostrings::subseq(wt_seq, start = start_pos, end = stop_pos) coding_seq <- as.character(coding_seq) - + # Predefined codon dictionaries nnk_codons <- c('AAG', 'AAT', 'ATG', 'ATT', 'AGG', 'AGT', 'ACG', 'ACT', 'TAG', 'TAT', 'TTG', 'TTT', 'TGG', 'TGT', 'TCG', 'TCT', 'GAG', 'GAT', 'GTG', 'GTT', 'GGG', 'GGT', 'GCG', 'GCT', 'CAG', 'CAT', 'CTG', 'CTT', 'CGG', 'CGT', 'CCG', 'CCT') nns_codons <- c('AAG', 'AAC', 'ATG', 'ATC', 'AGG', 'AGC', 'ACG', 'ACC', 'TAG', 'TAC', 'TTG', 'TTC', 'TGG', 'TGC', 'TCG', 'TCC', 'GAG', 'GAC', 'GTG', 'GTC', 'GGG', 'GGC', 'GCG', 'GCC', 'CAG', 'CAC', 'CTG', 'CTC', 'CGG', 'CGC', 'CCG', 'CCC') @@ -50,37 +50,37 @@ generate_possible_variants <- function(wt_seq_input, start_stop_pos, mutagenesis is_position_wise <- FALSE position_lookup <- list() custom_codons <- NULL - + if (mutagenesis_type == "custom") { if (!file.exists(custom_codon_library_path) || is.null(custom_codon_library_path)) { stop("Custom codons file must be provided and valid when using 'custom' mutagenesis_type.") } - + # Auto-detect format by inspecting the first line first_line <- readLines(custom_codon_library_path, n = 1) - + if (grepl("Position", first_line, ignore.case = TRUE)) { # Format 1: Position-wise CSV file is_position_wise <- TRUE - + # Read line-by-line instead of read.csv to avoid strict column matching errors lines <- readLines(custom_codon_library_path) - + # Loop through lines, skipping the header (index 1) for (line in lines[-1]) { # Skip empty lines - if (trimws(line) == "") next - + if (trimws(line) == "") next + # Split the line by commas parts <- trimws(unlist(strsplit(line, ","))) - + # The first part is the position, everything else are the codons pos_idx <- parts[1] codon_vec <- parts[-1] - + # Remove any accidental empty strings (e.g., from trailing commas) codon_vec <- codon_vec[codon_vec != ""] - + position_lookup[[pos_idx]] <- codon_vec } } else { @@ -89,19 +89,19 @@ generate_possible_variants <- function(wt_seq_input, start_stop_pos, mutagenesis custom_codons <- trimws(custom_codons) } } - + # Helper function to split a DNA sequence into nucleotide triplets split_into_codons <- function(seq) { # Note: Double escaping is required for Perl regular expressions here return(strsplit(seq, "(?<=.{3})", perl = TRUE)[[1]]) } - + wt_codons <- split_into_codons(coding_seq) - + # Initialize dataframe to store final variant results # Note: \$ escaping is maintained for Nextflow compatibility result <- data.frame(Codon_Number = integer(), wt_codon = character(), Variant = character(), stringsAsFactors = FALSE) - + # Helper function to determine the target codon list per position get_codon_list <- function(wt_codon, codon_index) { if (mutagenesis_type == "nnk") { @@ -137,24 +137,24 @@ generate_possible_variants <- function(wt_seq_input, start_stop_pos, mutagenesis stop("Invalid mutagenesis_type. Choose from 'nnk', 'nns', 'nnh', 'nnn', 'nnk_nns', 'nnk_nns_nnh', or 'custom'.") } } - + # Iterate over each wild-type codon to assign programmed variants for (i in seq_along(wt_codons)) { wt_codon <- wt_codons[i] codon_list <- get_codon_list(wt_codon, i) - + # Skip iteration if no custom codons were assigned to this specific position - if (is.null(codon_list)) next - + if (is.null(codon_list)) next + # Filter out the wild-type codon from the mutation list possible_variants <- codon_list[codon_list != wt_codon] - + for (variant in possible_variants) { # Note: \$ escaping is maintained for Nextflow compatibility result <- rbind(result, data.frame(Codon_Number = i, wt_codon = wt_codon, Variant = variant, stringsAsFactors = FALSE)) } } - + write.csv(result, output_file, row.names = FALSE) } @@ -162,7 +162,7 @@ generate_possible_variants <- function(wt_seq_input, start_stop_pos, mutagenesis # Main Execution Block (Nextflow variable substitution) # ------------------------------------------------------------------------------ -# Replaces bash if/else logic. If Nextflow omits the optional file, +# Replaces bash if/else logic. If Nextflow omits the optional file, # it passes "/NULL", which R translates to an actual NULL object. custom_lib_arg <- if ("$custom_codon_library" == "/NULL") { NULL diff --git a/modules/local/dmsanalysis/templates/process_gatk.R b/modules/local/dmsanalysis/templates/process_gatk.R index 5f5ddb0..6abc053 100644 --- a/modules/local/dmsanalysis/templates/process_gatk.R +++ b/modules/local/dmsanalysis/templates/process_gatk.R @@ -362,4 +362,3 @@ writeLines( f ) close(f) - diff --git a/modules/local/fitness/fitness_experimental_design.nf b/modules/local/fitness/fitness_experimental_design.nf index 368cec4..22bb19c 100644 --- a/modules/local/fitness/fitness_experimental_design.nf +++ b/modules/local/fitness/fitness_experimental_design.nf @@ -16,4 +16,4 @@ process EXPDESIGN_FITNESS { script: template 'dimsum_experimentalDesign.R' -} \ No newline at end of file +} diff --git a/modules/local/fitness/templates/dimsum_experimentalDesign.R b/modules/local/fitness/templates/dimsum_experimentalDesign.R index 7a97b64..66a9be6 100644 --- a/modules/local/fitness/templates/dimsum_experimentalDesign.R +++ b/modules/local/fitness/templates/dimsum_experimentalDesign.R @@ -11,14 +11,14 @@ make_dimsum_experimental_design <- function(samplesheet_csv, out_path = "experim # tolerate missing file2 column (single-end) if (!"file2" %in% names(ss)) ss\$file2 <- "" - + required <- c("sample", "type", "replicate", "file1", "file2") missing <- setdiff(required, names(ss)) if (length(missing) > 0) stop("Samplesheet missing columns: ", paste(missing, collapse = ", ")) # coerce types ss\$replicate <- as.integer(ss\$replicate) - + # ---- derive sample_name strategy ---- # If only one biological sample present (e.g. one protein), use "input1", "output2", ... # If multiple biological samples present, prefix with 'sample' to avoid collisions: @@ -38,11 +38,11 @@ make_dimsum_experimental_design <- function(samplesheet_csv, out_path = "experim selection_replicate <- ifelse(ss\$type == "output", 1L, NA_integer_) # assume one technical batch technical_replicate <- rep(1L, nrow(ss)) - + pair1 <- basename(ss\$file1) # keep empty string for single-end / missing file2 pair2 <- ifelse(is.na(ss\$file2) | ss\$file2 == "", "", basename(ss\$file2)) - + ed <- data.frame( sample_name = sample_name, experiment_replicate = experiment_replicate, @@ -93,4 +93,3 @@ writeLines( f ) close(f) - diff --git a/modules/local/fitness/templates/find_syn_mutation.R b/modules/local/fitness/templates/find_syn_mutation.R index d9441b0..a0ee07a 100644 --- a/modules/local/fitness/templates/find_syn_mutation.R +++ b/modules/local/fitness/templates/find_syn_mutation.R @@ -38,7 +38,7 @@ pick_synonymous_wt_from_range <- function(wt_fasta, counts_merged_tsv, pos_range df <- utils::read.delim(counts_merged_tsv, sep = "\\t", header = TRUE, stringsAsFactors = FALSE, check.names = FALSE) if (!"nt_seq" %in% names(df)) stop("counts_merged_tsv must have a 'nt_seq' column.") - + df\$nt_seq <- toupper(df\$nt_seq) keep_len <- nchar(df\$nt_seq) == wt_len if (!any(keep_len)) stop("No sequences match WT window length (", wt_len, ").") diff --git a/modules/local/fitness/templates/fitness_calculation.R b/modules/local/fitness/templates/fitness_calculation.R index 30df046..07d8d11 100644 --- a/modules/local/fitness/templates/fitness_calculation.R +++ b/modules/local/fitness/templates/fitness_calculation.R @@ -85,7 +85,7 @@ aggregate_by_aa <- function(merged.counts) { "stop" = rep(NA, nrow(merged.counts))) merged.counts\$wt[which(merged.counts\$nt_ham == 0)] <- TRUE merged.counts\$stop[which(merged.counts\$'mut_aa' == "*")] <- TRUE - + ## aggregate counts of variants which are identical on the aa (but not nt) level ## exception: wildtype ones ## thereby shrinking the matrix @@ -146,9 +146,9 @@ calc_raw_fitness <- function(merged.counts, exp.design) { tmp.output.counts[which(tmp.output.counts == 0 & tmp.input.counts != 0)] <- 1 ### take logs - tmp.wt.log.ratio <- log(tmp.output.counts[which(merged.counts\$wt == TRUE)] / + tmp.wt.log.ratio <- log(tmp.output.counts[which(merged.counts\$wt == TRUE)] / tmp.input.counts[which(merged.counts\$wt == TRUE)]) - tmp.fitness <- log(tmp.output.counts / + tmp.fitness <- log(tmp.output.counts / tmp.input.counts) - tmp.wt.log.ratio ### uncertain values to NA @@ -176,7 +176,7 @@ rescale_and_summarize <- function(merged.counts, reps) { ### fetch the key counts tmp.wt.fitness <- merged.counts[which(merged.counts\$aa_ham == 0),ncol(merged.counts) - reps] tmp.stop.fitness <- merged.counts[which(merged.counts\$stop == TRUE),ncol(merged.counts) - reps] - + ### rescale tmp.wt.fitness.med <- median(tmp.wt.fitness, na.rm = TRUE) tmp.stop.fitness.med <- median(tmp.stop.fitness, na.rm = TRUE) @@ -185,8 +185,8 @@ rescale_and_summarize <- function(merged.counts, reps) { lm.rescale <- lm(c(0, -1) ~ c(tmp.wt.fitness.med, tmp.stop.fitness.med)) merged.counts[,ncol(merged.counts)] <- merged.counts[,ncol(merged.counts) - reps] * lm.rescale\$coefficients[[2]] + lm.rescale\$coefficients[[1]] rm(tmp.wt.fitness, tmp.stop.fitness, - tmp.wt.fitness.med, tmp.stop.fitness.med, lm.rescale) - + tmp.wt.fitness.med, tmp.stop.fitness.med, lm.rescale) + ## if only WT mutants are available: lower peak determined by bimodal distribution fitting }else if(!is.na(tmp.wt.fitness.med) & is.na(tmp.stop.fitness.med)){ tmp.peaks <- sort(density_peaks(x = merged.counts[,ncol(merged.counts) - reps])) @@ -194,7 +194,7 @@ rescale_and_summarize <- function(merged.counts, reps) { merged.counts[,ncol(merged.counts)] <- merged.counts[,ncol(merged.counts) - reps] * lm.rescale\$coefficients[[2]] + lm.rescale\$coefficients[[1]] rm(tmp.wt.fitness, tmp.stop.fitness, tmp.wt.fitness.med, tmp.stop.fitness.med, lm.rescale, tmp.peaks) - + ## if only STOP mutants are available: higher peak determined by bimodal distribution fitting }else if(is.na(tmp.wt.fitness.med) & !is.na(tmp.stop.fitness.med)){ tmp.peaks <- sort(density_peaks(x = merged.counts[,ncol(merged.counts) - reps])) @@ -202,7 +202,7 @@ rescale_and_summarize <- function(merged.counts, reps) { merged.counts[,ncol(merged.counts)] <- merged.counts[,ncol(merged.counts) - reps] * lm.rescale\$coefficients[[2]] + lm.rescale\$coefficients[[1]] rm(tmp.wt.fitness, tmp.stop.fitness, tmp.wt.fitness.med, tmp.stop.fitness.med, lm.rescale, tmp.peaks) - + ## if neither WT nor STOP mutants are available: both peak determined by bimodal distribution fitting }else if(is.na(tmp.wt.fitness.med) & is.na(tmp.stop.fitness.med)){ tmp.peaks <- sort(density_peaks(x = merged.counts[,ncol(merged.counts) - reps])) @@ -220,11 +220,11 @@ rescale_and_summarize <- function(merged.counts, reps) { "fitness sd" = rep(NA, nrow(merged.counts))) if(reps == 1){ - + merged.counts\$'mean fitness' <- merged.counts[,ncol(merged.counts) - 2] - + }else if(reps > 1){ - + merged.counts\$'mean fitness' <- apply(merged.counts[,c(ncol(merged.counts) - 1 - reps):c(ncol(merged.counts) - 2)], 1, mean, @@ -255,7 +255,7 @@ run_fitness_estimation <- function(counts_path, output_path) { ## 1. Import key files ## ######################### - + merged.counts <- read.table(counts_path, sep = "\t", header = TRUE, check.names = FALSE) exp.design <- read.table(design_path, sep = "\t", header = TRUE, check.names = FALSE) wt.seq <- DNAString(as.character(read.table(wt_seq_path))) @@ -284,7 +284,7 @@ run_fitness_estimation <- function(counts_path, fitness_res <- calc_raw_fitness(merged.counts, exp.design) merged.counts <- fitness_res\$merged.counts reps <- fitness_res\$reps - + ## 4. Fitness and error refinements ## ###################################### merged.counts <- rescale_and_summarize(merged.counts, reps) @@ -295,7 +295,7 @@ run_fitness_estimation <- function(counts_path, ## export write.table(merged.counts, output_path, col.names = TRUE, row.names = FALSE, quote = FALSE, sep = "\t", na = "") - + invisible(merged.counts) } @@ -326,9 +326,9 @@ run_fitness_estimation <- function(counts_path, # [6] BiocGenerics_0.54.0 generics_0.1.4 # # loaded via a namespace (and not attached): -# [1] httr_1.4.7 compiler_4.5.1 R6_2.6.1 tools_4.5.1 -# [5] GenomeInfoDbData_1.2.14 rstudioapi_0.17.1 crayon_1.5.3 UCSC.utils_1.4.0 -# [9] jsonlite_2.0.0 +# [1] httr_1.4.7 compiler_4.5.1 R6_2.6.1 tools_4.5.1 +# [5] GenomeInfoDbData_1.2.14 rstudioapi_0.17.1 crayon_1.5.3 UCSC.utils_1.4.0 +# [9] jsonlite_2.0.0 @@ -361,5 +361,3 @@ writeLines( f ) close(f) - - diff --git a/modules/local/fitness/templates/merge_counts.R b/modules/local/fitness/templates/merge_counts.R index d812c82..9373233 100644 --- a/modules/local/fitness/templates/merge_counts.R +++ b/modules/local/fitness/templates/merge_counts.R @@ -91,11 +91,11 @@ if (n_out > 0) { # Write Output utils::write.table( - out, - file = "counts_merged.tsv", - sep = "\\t", - row.names = FALSE, - col.names = TRUE, + out, + file = "counts_merged.tsv", + sep = "\\t", + row.names = FALSE, + col.names = TRUE, quote = FALSE ) @@ -114,4 +114,4 @@ writeLines( ), f ) -close(f) \ No newline at end of file +close(f) diff --git a/modules/local/gatk/templates/gatk_to_fitness.R b/modules/local/gatk/templates/gatk_to_fitness.R index 1b53908..5498c13 100644 --- a/modules/local/gatk/templates/gatk_to_fitness.R +++ b/modules/local/gatk/templates/gatk_to_fitness.R @@ -96,4 +96,3 @@ writeLines( f ) close(f) - diff --git a/modules/local/visualization/templates/counts_per_cov_heatmap.R b/modules/local/visualization/templates/counts_per_cov_heatmap.R index 5ba5ee2..77518b7 100644 --- a/modules/local/visualization/templates/counts_per_cov_heatmap.R +++ b/modules/local/visualization/templates/counts_per_cov_heatmap.R @@ -185,4 +185,3 @@ writeLines( f ) close(f) - diff --git a/modules/local/visualization/templates/global_position_biases_cov.R b/modules/local/visualization/templates/global_position_biases_cov.R index 48a23ba..0a2fda1 100644 --- a/modules/local/visualization/templates/global_position_biases_cov.R +++ b/modules/local/visualization/templates/global_position_biases_cov.R @@ -119,6 +119,3 @@ writeLines( f ) close(f) - - - diff --git a/modules/local/visualization/templates/logdiff.R b/modules/local/visualization/templates/logdiff.R index a69d5a0..752e574 100644 --- a/modules/local/visualization/templates/logdiff.R +++ b/modules/local/visualization/templates/logdiff.R @@ -113,5 +113,3 @@ writeLines( f ) close(f) - - diff --git a/modules/local/visualization/visualization.nf b/modules/local/visualization/visualization.nf index 0062367..e2cd4eb 100644 --- a/modules/local/visualization/visualization.nf +++ b/modules/local/visualization/visualization.nf @@ -148,7 +148,7 @@ process VISUALIZATION_LOGDIFF { task.ext.when == null || task.ext.when script: - template 'logdiff.R' + template 'logdiff.R' stub: """ diff --git a/subworkflows/local/calculatefitness.nf b/subworkflows/local/calculatefitness.nf index 7106ff2..367e92d 100644 --- a/subworkflows/local/calculatefitness.nf +++ b/subworkflows/local/calculatefitness.nf @@ -59,7 +59,7 @@ workflow CALCULATEFITNESS { // 4. Find Synonymous Mutations // Prepare inputs (broadcast logic) def ch_fasta_path = ch_fasta.map { it[1] } // strip meta - + FIND_SYNONYMOUS_MUTATION( MERGE_COUNTS.out.merged_counts, ch_fasta_path.combine(MERGE_COUNTS.out.merged_counts).map { it[0] }, @@ -69,7 +69,7 @@ workflow CALCULATEFITNESS { // 5. Align Channels for Fitness Calculation - + // Key counts and WT by biological sample name def ch_counts_keyed_d = MERGE_COUNTS.out.merged_counts .map { smp, counts -> tuple(smp.sample as String, smp, counts) } @@ -109,16 +109,16 @@ workflow CALCULATEFITNESS { ch_versions = ch_versions.mix(FITNESS_HEATMAP.out.versions) // 7. Run DiMSum (optional based on params inside subworkflow or handled by control logic) - // Note: Logic checking for 'params.dimsum' needs to be handled. + // Note: Logic checking for 'params.dimsum' needs to be handled. // Since subworkflows inherit params, we can check params.dimsum here. - + if (params.dimsum) { log.warn(""" '--dimsum true' only works together with '--fitness true' and is currently (30 Oct 2025) NOT supported on ARM processors. Use AMD/x86_64 systems for DiMSum execution. """) - + RUN_DIMSUM( ch_run_counts_d, ch_run_wt_d, @@ -131,4 +131,3 @@ workflow CALCULATEFITNESS { fitness_estimation = FITNESS_CALCULATION.out.fitness_estimation versions = ch_versions } - diff --git a/subworkflows/local/utils_nfcore_deepmutscan_pipeline/main.nf b/subworkflows/local/utils_nfcore_deepmutscan_pipeline/main.nf index fca70b3..22c83bc 100644 --- a/subworkflows/local/utils_nfcore_deepmutscan_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_deepmutscan_pipeline/main.nf @@ -275,4 +275,3 @@ def methodsDescriptionText(mqc_methods_yaml) { return description_html.toString() } - diff --git a/workflows/deepmutscan.nf b/workflows/deepmutscan.nf index 44c5955..761fc8a 100644 --- a/workflows/deepmutscan.nf +++ b/workflows/deepmutscan.nf @@ -225,7 +225,7 @@ workflow DEEPMUTSCAN { ch_possible_mut_for_proc, // path(possible_mutations) -- N ch_aa_seq_for_proc, // path(aa_seq) -- N ch_min_counts_for_proc // val(min_counts) -- N - ) + ) annotated_variantCounts_ch = DMSANALYSIS_PROCESS_GATK.out.processed_variantCounts.map { meta, a, b, c, d -> tuple(meta, a) } variantCounts_filtered_by_library_ch = DMSANALYSIS_PROCESS_GATK.out.processed_variantCounts.map { meta, a, b, c, d -> tuple(meta, b) } @@ -298,7 +298,7 @@ workflow DEEPMUTSCAN { // Execution of fitness subworkflow, if --fitness true if (params.fitness) { - + CALCULATEFITNESS ( GATK_GATKTOFITNESS.out.fitness_input, // Input vom vorherigen Schritt ch_samplesheet_csv, // Pfad zum Samplesheet