From dd37ef23f4a2859d3c0fa1d3e80f9fe6e4ace59a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jul 2026 18:38:44 +0000 Subject: [PATCH 1/2] chore(deps) pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/snakemake/snakefmt: v2.0.1 → v2.0.3](https://github.com/snakemake/snakefmt/compare/v2.0.1...v2.0.3) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ba96fe0..112c61a3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: args: [--py39-plus] - repo: https://github.com/snakemake/snakefmt - rev: v2.0.1 + rev: v2.0.3 hooks: - id: snakefmt From 2071863823aea7212c25ae407b51e135426e5f10 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jul 2026 18:39:04 +0000 Subject: [PATCH 2/2] ci: auto fixes from pre-commit hooks for more information, see https://pre-commit.ci --- workflow/Snakefile | 40 +++++++++---------- workflow/rules/assignment.smk | 36 ++++++++--------- workflow/rules/assignment/hybridFWDRead.smk | 10 ++--- workflow/rules/assignment/mapping_bbmap.smk | 26 ++++++------ workflow/rules/assignment/mapping_bwa.smk | 28 ++++++------- workflow/rules/assignment/mapping_exact.smk | 8 ++-- workflow/rules/assignment/mapping_pbmm2.smk | 14 +++---- workflow/rules/assignment/preprocessing.smk | 6 +-- workflow/rules/assignment/statistic.smk | 16 ++++---- workflow/rules/experiment/assigned_counts.smk | 32 +++++++-------- workflow/rules/experiment/counts.smk | 22 +++++----- .../experiment/counts/counts_demultiplex.smk | 16 ++++---- .../counts/counts_merge_ngmerge.smk | 4 +- .../rules/experiment/counts/counts_noUMI.smk | 8 ++-- .../experiment/counts/counts_onlyFWD.smk | 4 +- .../counts/counts_onlyFWDWithUMI.smk | 4 +- .../rules/experiment/counts/counts_umi.smk | 12 +++--- workflow/rules/experiment/preprocessing.smk | 10 ++--- workflow/rules/experiment/statistic.smk | 4 +- .../experiment/statistic/assigned_counts.smk | 16 ++++---- .../rules/experiment/statistic/bc_overlap.smk | 12 +++--- .../experiment/statistic/correlation.smk | 28 ++++++------- .../rules/experiment/statistic/counts.smk | 28 ++++++------- workflow/rules/qc_report.smk | 8 ++-- 24 files changed, 196 insertions(+), 196 deletions(-) diff --git a/workflow/Snakefile b/workflow/Snakefile index f8d729ce..1e7cf3cb 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -63,8 +63,8 @@ include: "rules/common.smk" rule all: """ -General all rule to get all output files for MPRAsnakeflow (default rule). -""" + General all rule to get all output files for MPRAsnakeflow (default rule). + """ input: ## report getAssignmentConfig_helper( @@ -183,8 +183,8 @@ General all rule to get all output files for MPRAsnakeflow (default rule). rule all_qc_report: """ -All rule to generate QC reports. -""" + All rule to generate QC reports. + """ input: getAssignmentConfig_helper(["results/assignment/{assignment}/qc_report.{config}.html"]), getOutputProjectConditionAssignmentConfig_helper( @@ -194,8 +194,8 @@ All rule to generate QC reports. rule all_assignments: """ -All rule to get all output files for the assignments workflow. -""" + All rule to get all output files for the assignments workflow. + """ input: getAssignmentConfig_helper( [ @@ -213,8 +213,8 @@ All rule to get all output files for the assignments workflow. rule all_experiments: """ -All rule to get all output files for the experiment workflow. -""" + All rule to get all output files for the experiment workflow. + """ input: # stats BC nucleotide composition getOutputProjectConditionReplicateType_helper( @@ -306,8 +306,8 @@ All rule to get all output files for the experiment workflow. rule all_experiments_counts_stats: """ -All rule to get count statistics of the experiment workflow. -""" + All rule to get count statistics of the experiment workflow. + """ input: getOutputProjectConditionReplicateType_helper( ["results/experiments/{project}/statistic/counts.freqUMIs.{condition}.{replicate}.{type}.txt"] @@ -328,8 +328,8 @@ All rule to get count statistics of the experiment workflow. rule all_bc_overlap_statistic: """ -All rule to get BC overlap statistic of the experiment workflow. -""" + All rule to get BC overlap statistic of the experiment workflow. + """ input: getOutputProjectConfig_helper( ["results/experiments/{project}/statistic/bc_overlap.counts.{config}.tsv"], @@ -345,8 +345,8 @@ All rule to get BC overlap statistic of the experiment workflow. rule all_experiments_assignments: """ -All rule to get assigned counts for experiment workflow. -""" + All rule to get assigned counts for experiment workflow. + """ input: getOutputProjectConditionAssignmentConfig_helper( [ @@ -359,8 +359,8 @@ All rule to get assigned counts for experiment workflow. rule all_experiments_assignments_statistic: """ -All rule to get assigned counts statistic for experiment workflow. -""" + All rule to get assigned counts statistic for experiment workflow. + """ input: getOutputProjectConditionAssignmentConfig_helper( [ @@ -382,8 +382,8 @@ All rule to get assigned counts statistic for experiment workflow. rule all_stats_BCNucleotideComposition: """ -All rule to get BC nucleotide composition of the experiment workflow. -""" + All rule to get BC nucleotide composition of the experiment workflow. + """ input: getOutputProjectConditionReplicateType_helper( ["results/experiments/{project}/statistic/counts/BCNucleotideComposition.{condition}.{replicate}.{type}.tsv.gz"] @@ -392,8 +392,8 @@ All rule to get BC nucleotide composition of the experiment workflow. rule all_variants: """ -All rule to get variant effects of the experiment workflow. -""" + All rule to get variant effects of the experiment workflow. + """ input: getOutputVariants_helper( ["results/experiments/{project}/statistic/variants/{assignment}/{config}/correlation_variantTable.tsv"], diff --git a/workflow/rules/assignment.smk b/workflow/rules/assignment.smk index 39f8fa05..c1f230a5 100644 --- a/workflow/rules/assignment.smk +++ b/workflow/rules/assignment.smk @@ -14,9 +14,9 @@ include: "assignment/statistic.smk" rule assignment_check_design: """ -Check if the design file is correct and no duplicated sequences are present (FWD and reverse). -Also check if no duplicated headers and no illegal characters in header. -""" + Check if the design file is correct and no duplicated sequences are present (FWD and reverse). + Also check if no duplicated headers and no illegal characters in header. + """ input: design=lambda wc: config["assignments"][wc.assignment]["design_file"], script=getScript("assignment/check_design_file.py"), @@ -57,11 +57,11 @@ Also check if no duplicated headers and no illegal characters in header. rule assignment_fastq_split: """ -Split the fastq files into n files for parallelisation. -n is given by split_read in the configuration file. + Split the fastq files into n files for parallelisation. + n is given by split_read in the configuration file. -Runs only if the design file is correct. -""" + Runs only if the design file is correct. + """ input: fastq=lambda wc: getAssignmentRead( wc.assignment, @@ -105,8 +105,8 @@ Runs only if the design file is correct. rule assignment_attach_idx: """ -Extract the index sequence and add it to the header. -""" + Extract the index sequence and add it to the header. + """ input: read="results/assignment/{assignment}/fastq/splits/{read}.split{split}.fastq.gz", BC="results/assignment/{assignment}/fastq/splits/BC.split{split}.fastq.gz", @@ -138,8 +138,8 @@ Extract the index sequence and add it to the header. rule assignment_merge_NGmerge: """ -Merge the FWD, REV and BC fastq files into one using NGmerge. -""" + Merge the FWD, REV and BC fastq files into one using NGmerge. + """ input: FWD="results/assignment/{assignment}/fastq/splits/FWD.split{split}.BCattached.fastq.gz", REV="results/assignment/{assignment}/fastq/splits/REV.split{split}.BCattached.fastq.gz", @@ -170,8 +170,8 @@ Merge the FWD, REV and BC fastq files into one using NGmerge. rule assignment_merge_fastqjoin: """ -Merge the FWD, REV and BC fastq files into one using fastq-join. -""" + Merge the FWD, REV and BC fastq files into one using fastq-join. + """ input: FWD="results/assignment/{assignment}/fastq/splits/FWD.split{split}.BCattached.fastq.gz", REV="results/assignment/{assignment}/fastq/splits/REV.split{split}.BCattached.fastq.gz", @@ -201,8 +201,8 @@ include: "assignment/mapping_pbmm2.smk" rule assignment_collectBCs: """ -Get the barcodes. -""" + Get the barcodes. + """ input: lambda wc: ( "results/assignment/{assignment}/BCs/barcodes.pbmm2.tsv" @@ -234,9 +234,9 @@ Get the barcodes. rule assignment_filter: """ -Filter the barcodes file based on the config given in the config-file. -FIXME: Limitation is that oligos cannot have a name ambiguous or other. -""" + Filter the barcodes file based on the config given in the config-file. + FIXME: Limitation is that oligos cannot have a name ambiguous or other. + """ input: assignment="results/assignment/{assignment}/barcodes_incl_other.tsv.gz", script=getScript("assignment/filterAssignmentTsv.py"), diff --git a/workflow/rules/assignment/hybridFWDRead.smk b/workflow/rules/assignment/hybridFWDRead.smk index db7afdd5..6d8947fa 100644 --- a/workflow/rules/assignment/hybridFWDRead.smk +++ b/workflow/rules/assignment/hybridFWDRead.smk @@ -6,8 +6,8 @@ This sankefile will extract the BC and FWD read from the hybrid read. rule assignment_hybridFWDRead_get_reads_by_length: """ -Get the barcode and read from the FWD read using fixed length -""" + Get the barcode and read from the FWD read using fixed length + """ input: fastq=lambda wc: ( "results/assignment/{assignment}/fastq/FWD.trimmed.fastq.gz" @@ -44,9 +44,9 @@ Get the barcode and read from the FWD read using fixed length rule assignment_hybridFWDRead_get_reads_by_cutadapt: """ -Get the barcode and read from the FWD read using cutadapt. -Uses the paired end mode of cutadapt to write the FWD and BC read. -""" + Get the barcode and read from the FWD read using cutadapt. + Uses the paired end mode of cutadapt to write the FWD and BC read. + """ input: lambda wc: ( "results/assignment/{assignment}/fastq/FWD.trimmed.fastq.gz" diff --git a/workflow/rules/assignment/mapping_bbmap.smk b/workflow/rules/assignment/mapping_bbmap.smk index f5866efa..bb5146f6 100644 --- a/workflow/rules/assignment/mapping_bbmap.smk +++ b/workflow/rules/assignment/mapping_bbmap.smk @@ -20,8 +20,8 @@ rule assignment_mapping_bbmap: """ -Map the reads to the reference and sort unsing bwa mem -""" + Map the reads to the reference and sort unsing bwa mem + """ input: reads=lambda wc: getMappingRead(wc.assignment), check="results/assignment/{assignment}/design_check.done", @@ -46,18 +46,18 @@ Map the reads to the reference and sort unsing bwa mem rule assignment_mapping_bbmap_getBCs: """ -Get the barcodes. + Get the barcodes. -BAM/SAM fields: -- bc_string = $2; -- ref_name = $3; -- alignement_start = $4; -- mapping_quality = $5; -- cigar = $6; -- aligned_sequence = $10; -- edit_distance = $12; -- alignment_score = $13; -""" + BAM/SAM fields: + - bc_string = $2; + - ref_name = $3; + - alignement_start = $4; + - mapping_quality = $5; + - cigar = $6; + - aligned_sequence = $10; + - edit_distance = $12; + - alignment_score = $13; + """ input: "results/assignment/{assignment}/bbmap/merge_split{split}.mapped.bam", output: diff --git a/workflow/rules/assignment/mapping_bwa.smk b/workflow/rules/assignment/mapping_bwa.smk index 95825045..49f27e2a 100644 --- a/workflow/rules/assignment/mapping_bwa.smk +++ b/workflow/rules/assignment/mapping_bwa.smk @@ -1,7 +1,7 @@ rule assignment_mapping_bwa_ref: """ -Create mapping reference for BWA from design file. -""" + Create mapping reference for BWA from design file. + """ input: ref="results/assignment/{assignment}/reference/reference.fa", check="results/assignment/{assignment}/design_check.done", @@ -25,8 +25,8 @@ Create mapping reference for BWA from design file. rule assignment_mapping_bwa: """ -Map the reads to the reference and sort unsing bwa mem -""" + Map the reads to the reference and sort unsing bwa mem + """ input: reads=lambda wc: getMappingRead(wc.assignment), reference="results/assignment/{assignment}/reference/reference.fa", @@ -59,8 +59,8 @@ Map the reads to the reference and sort unsing bwa mem rule assignment_mapping_bwa_getBCs: """ -Get the barcodes. -""" + Get the barcodes. + """ input: "results/assignment/{assignment}/bwa/merge_split{split}.mapped.bam", output: @@ -114,8 +114,8 @@ Get the barcodes. rule assignment_mapping_bwa_getBCs_additional_filter: """ -Get the barcodes with a python script to rescue alignments with 0 mapping quality according to bwa. -""" + Get the barcodes with a python script to rescue alignments with 0 mapping quality according to bwa. + """ input: bam="results/assignment/{assignment}/bwa/merge_split{split}.mapped.bam", script=getScript("assignment/filter_bc_from_bam.py"), @@ -146,8 +146,8 @@ Get the barcodes with a python script to rescue alignments with 0 mapping qualit rule assignment_collect: """ -Collect mapped reads. -""" + Collect mapped reads. + """ input: bams=lambda wc: expand( "results/assignment/{{assignment}}/{mapper}/merge_split{split}.mapped.bam", @@ -169,8 +169,8 @@ Collect mapped reads. rule assignment_idx_bam: """ -Index the BAM file -""" + Index the BAM file + """ input: "results/assignment/{assignment}/aligned_merged_reads.bam", output: @@ -187,8 +187,8 @@ Index the BAM file rule assignment_flagstat: """ -Run samtools flagstat -""" + Run samtools flagstat + """ input: bam="results/assignment/{assignment}/aligned_merged_reads.bam", idx="results/assignment/{assignment}/aligned_merged_reads.bam.bai", diff --git a/workflow/rules/assignment/mapping_exact.smk b/workflow/rules/assignment/mapping_exact.smk index 144622e0..541998a4 100644 --- a/workflow/rules/assignment/mapping_exact.smk +++ b/workflow/rules/assignment/mapping_exact.smk @@ -1,7 +1,7 @@ rule assignment_mapping_exact_reference: """ -Create reference to map the exact design -""" + Create reference to map the exact design + """ input: check="results/assignment/{assignment}/design_check.done", ref="results/assignment/{assignment}/reference/reference.fa", @@ -25,8 +25,8 @@ Create reference to map the exact design rule assignment_mapping_exact: """ -Map the reads to the reference and sort using exact match. -""" + Map the reads to the reference and sort using exact match. + """ input: reads=lambda wc: getMappingRead(wc.assignment), reference="results/assignment/{assignment}/reference/reference_exact.fa", diff --git a/workflow/rules/assignment/mapping_pbmm2.smk b/workflow/rules/assignment/mapping_pbmm2.smk index e85a6b1c..84d8fd71 100644 --- a/workflow/rules/assignment/mapping_pbmm2.smk +++ b/workflow/rules/assignment/mapping_pbmm2.smk @@ -1,7 +1,7 @@ rule assignment_mapping_pbmm2_index: """ -Create pbmm2 index from design reference. -""" + Create pbmm2 index from design reference. + """ input: ref="results/assignment/{assignment}/reference/reference.fa", check="results/assignment/{assignment}/design_check.done", @@ -19,8 +19,8 @@ Create pbmm2 index from design reference. rule assignment_mapping_pbmm2_align: """ -Align long reads (BAM or FASTA) to reference using pbmm2. -""" + Align long reads (BAM or FASTA) to reference using pbmm2. + """ input: reads=lambda wc: config["assignments"][wc.assignment]["long_read_input"], index="results/assignment/{assignment}/reference/reference.fa.mmi", @@ -47,9 +47,9 @@ Align long reads (BAM or FASTA) to reference using pbmm2. rule assignment_mapping_pbmm2_getBCs: """ -Extract barcodes from aligned long reads. Produces the standard -barcode TSV for downstream collection and filtering. -""" + Extract barcodes from aligned long reads. Produces the standard + barcode TSV for downstream collection and filtering. + """ input: bam="results/assignment/{assignment}/pbmm2/aligned.bam", script=getScript("assignment/longread_extract.py"), diff --git a/workflow/rules/assignment/preprocessing.smk b/workflow/rules/assignment/preprocessing.smk index 81f70111..32e413bc 100644 --- a/workflow/rules/assignment/preprocessing.smk +++ b/workflow/rules/assignment/preprocessing.smk @@ -1,8 +1,8 @@ rule assignment_preprocessing_adapter_remove: """ -Remove adapter sequence from the reads (3' or 5'). -Uses cutadapt to trim adapters based on the primer direction. -""" + Remove adapter sequence from the reads (3' or 5'). + Uses cutadapt to trim adapters based on the primer direction. + """ input: reads=lambda wc: config["assignments"][wc.assignment][wc.read], output: diff --git a/workflow/rules/assignment/statistic.smk b/workflow/rules/assignment/statistic.smk index 46510ae0..66a5f72e 100644 --- a/workflow/rules/assignment/statistic.smk +++ b/workflow/rules/assignment/statistic.smk @@ -5,8 +5,8 @@ Rules to create statistics for the assignment workflow. rule assignment_statistic_totalCounts: """ -Statistic of the total (unfiltered counts). -""" + Statistic of the total (unfiltered counts). + """ input: bc="results/assignment/{assignment}/barcodes_incl_other.tsv.gz", script=getScript("assignment/statistic_total_counts.py"), @@ -24,8 +24,8 @@ Statistic of the total (unfiltered counts). rule assignment_statistic_assignedCounts: """ -Statistic of the assigned counts. -""" + Statistic of the assigned counts. + """ input: bc="results/assignment/{assignment}/assignment_barcodes_with_ambiguous.{assignment_config}.tsv.gz", script=getScript("assignment/statistic_total_counts.py"), @@ -43,8 +43,8 @@ Statistic of the assigned counts. rule assignment_statistic_assignment: """ -Statistic of the filtered assignment. -""" + Statistic of the filtered assignment. + """ input: bc="results/assignment/{assignment}/assignment_barcodes_with_ambiguous.{assignment_config}.tsv.gz", script=getScript("assignment/statistic_assignment.R"), @@ -63,8 +63,8 @@ Statistic of the filtered assignment. rule assignment_statistic_quality_metric: """ -Quality metrics of the assignment run -""" + Quality metrics of the assignment run + """ input: assignment="results/assignment/{assignment}/assignment_barcodes.{assignment_config}.tsv.gz", design="results/assignment/{assignment}/reference/reference.fa", diff --git a/workflow/rules/experiment/assigned_counts.smk b/workflow/rules/experiment/assigned_counts.smk index 49cae964..1ef2b9b7 100644 --- a/workflow/rules/experiment/assigned_counts.smk +++ b/workflow/rules/experiment/assigned_counts.smk @@ -5,8 +5,8 @@ rule experiment_assigned_counts_filterAssignment: """ -Use only unique assignments and do sampling if needed. -""" + Use only unique assignments and do sampling if needed. + """ input: assignment=lambda wc: getAssignmentFile(wc.project, wc.assignment), script=getScript("count/samplerer_assignment.py"), @@ -49,8 +49,8 @@ rule experiment_assigned_counts_createAssignmentPickleFile: rule experiment_assigned_counts_assignBarcodes: """ -Assign RNA and DNA barcodes seperately to make the statistic for assigned -""" + Assign RNA and DNA barcodes seperately to make the statistic for assigned + """ input: counts=lambda wc: getFinalCounts(wc.project, wc.config, wc.condition, wc.type, "counts"), association="results/experiments/{project}/assignment/{assignment}.tsv.gz", @@ -80,8 +80,8 @@ Assign RNA and DNA barcodes seperately to make the statistic for assigned rule experiment_assigned_counts_dna_rna_merge: """ -Assign merged RNA/DNA barcodes. Filter BC depending on the min_counts option. -""" + Assign merged RNA/DNA barcodes. Filter BC depending on the min_counts option. + """ input: counts="results/experiments/{project}/counts/{condition}.{replicate}.merged.config.{config}.tsv.gz", association="results/experiments/{project}/assignment/{assignment}.tsv.gz", @@ -125,8 +125,8 @@ Assign merged RNA/DNA barcodes. Filter BC depending on the min_counts option. rule experiment_assigned_counts_make_master_tables: """ -Final master table with all replicates combined. With and without threshold. -""" + Final master table with all replicates combined. With and without threshold. + """ input: counts=lambda wc: expand( "results/experiments/{{project}}/assigned_counts/{{assignment}}/{{config}}/{{condition}}.{replicate}.merged_assigned_counts.tsv.gz", @@ -168,8 +168,8 @@ Final master table with all replicates combined. With and without threshold. rule experiment_assigned_counts_combine_replicates_barcode_output: """ -Combine replictes of assigned barcode counts into one file. -""" + Combine replictes of assigned barcode counts into one file. + """ input: bc_counts=lambda wc: expand( "results/experiments/{project}/assigned_counts/{assignment}/{config}/{condition}.{replicate}.barcode_assigned_counts.tsv.gz", @@ -210,8 +210,8 @@ Combine replictes of assigned barcode counts into one file. rule experiment_assigned_counts_combine_replicates: """ -Combine replicates of master table by summing counts up and using also the average. -""" + Combine replicates of master table by summing counts up and using also the average. + """ input: master_table="results/experiments/{project}/assigned_counts/{assignment}/{config}/{condition}.{allreps_or_threshold}.merged.tsv.gz", script=getScript("count/combine_replicates.py"), @@ -240,8 +240,8 @@ Combine replicates of master table by summing counts up and using also the avera rule experiment_assigned_counts_copy_final_all_files: """ -Will copy final files to the main folder so that it is clear which files to use. -""" + Will copy final files to the main folder so that it is clear which files to use. + """ input: all=lambda wc: "results/experiments/{project}/assigned_counts/{assignment}/{config}/{condition}.allreps.merged.tsv.gz", bc_all=lambda wc: "results/experiments/{project}/assigned_counts/{assignment}/{config}/{condition}.allreps.merged_barcode_assigned_counts.tsv.gz", @@ -261,8 +261,8 @@ Will copy final files to the main folder so that it is clear which files to use. rule experiment_assigned_counts_copy_final_thresh_files: """ -Will copy final files to the main folder so that it is clear which files to use. -""" + Will copy final files to the main folder so that it is clear which files to use. + """ input: thresh=lambda wc: "results/experiments/{project}/assigned_counts/{assignment}/{config}/{condition}.allreps_minThreshold.merged.tsv.gz", bc_thresh=lambda wc: "results/experiments/{project}/assigned_counts/{assignment}/{config}/{condition}.allreps_minThreshold.merged_barcode_assigned_counts.tsv.gz", diff --git a/workflow/rules/experiment/counts.smk b/workflow/rules/experiment/counts.smk index e9bc3b7b..bbae07a7 100644 --- a/workflow/rules/experiment/counts.smk +++ b/workflow/rules/experiment/counts.smk @@ -13,8 +13,8 @@ include: "counts/counts_onlyFWDWithUMI.smk" rule experiment_counts_filter_counts: """ -Filter the counts to BCs only of the correct length (defined in the config file) -""" + Filter the counts to BCs only of the correct length (defined in the config file) + """ input: lambda wc: getRawCounts(wc.project, wc.type), output: @@ -38,9 +38,9 @@ Filter the counts to BCs only of the correct length (defined in the config file) rule experiment_counts_final_counts: """ -Counting BCs. -Discarding PCR duplicates (taking BCxUMI only one time) -""" + Counting BCs. + Discarding PCR duplicates (taking BCxUMI only one time) + """ input: "results/experiments/{project}/counts/{condition}.{replicate}.{type}.filtered_counts.tsv.gz", output: @@ -60,8 +60,8 @@ Discarding PCR duplicates (taking BCxUMI only one time) rule experiment_counts_final_counts_sampler: """ -Creates full + new distribution DNA files -""" + Creates full + new distribution DNA files + """ input: counts="results/experiments/{project}/counts/{condition}.{replicate}.{type}.final_counts.tsv.gz", script=getScript("count/samplerer.py"), @@ -91,10 +91,10 @@ Creates full + new distribution DNA files rule experiment_counts_dna_rna_merge_counts: """ -Merge DNA and RNA counts together. -Is done in two ways. First no not allow zeros in DNA or RNA BCs (RNA and DNA min_counts not zero). -Second with zeros, so a BC can be defined only in the DNA or RNA (RNA or DNA min_counts zero) -""" + Merge DNA and RNA counts together. + Is done in two ways. First no not allow zeros in DNA or RNA BCs (RNA and DNA min_counts not zero). + Second with zeros, so a BC can be defined only in the DNA or RNA (RNA or DNA min_counts zero) + """ input: dna=lambda wc: getFinalCounts(wc.project, wc.config, wc.condition, "DNA", wc.raw_or_assigned), rna=lambda wc: getFinalCounts(wc.project, wc.config, wc.condition, "RNA", wc.raw_or_assigned), diff --git a/workflow/rules/experiment/counts/counts_demultiplex.smk b/workflow/rules/experiment/counts/counts_demultiplex.smk index be22d4d4..b4cc806f 100644 --- a/workflow/rules/experiment/counts/counts_demultiplex.smk +++ b/workflow/rules/experiment/counts/counts_demultiplex.smk @@ -7,8 +7,8 @@ rule experiment_counts_demultiplex_create_index: """ -Create the demultiplexing index file for the experiment. -""" + Create the demultiplexing index file for the experiment. + """ input: experiment_file=lambda wc: config["experiments"][wc.project]["experiment_file"], script=getScript("count/create_demultiplexed_index.py"), @@ -28,8 +28,8 @@ Create the demultiplexing index file for the experiment. checkpoint experiment_counts_demultiplex_BAM_umi: """ -Demultiplexing the data and create demultiplexed bam files per condition. -""" + Demultiplexing the data and create demultiplexed bam files per condition. + """ input: fwd_fastq=lambda wc: getFWDWithIndex(wc.project), rev_fastq=lambda wc: getREVWithIndex(wc.project), @@ -74,8 +74,8 @@ Demultiplexing the data and create demultiplexed bam files per condition. rule experiment_counts_demultiplex_aggregate: """ -Aggregate the demultiplexed bam files per condition. -""" + Aggregate the demultiplexed bam files per condition. + """ input: lambda wc: counts_aggregate_demultiplex_input(wc.project), output: @@ -84,8 +84,8 @@ Aggregate the demultiplexed bam files per condition. rule experiment_counts_demultiplex_mergeTrimReads_BAM_umi: """ -Merge and trim reads in demultiplexed bam files. -""" + Merge and trim reads in demultiplexed bam files. + """ input: demultiplex="results/experiments/{project}/counts/demultiplex.done", script=getScript("count/MergeTrimReadsBAM.py"), diff --git a/workflow/rules/experiment/counts/counts_merge_ngmerge.smk b/workflow/rules/experiment/counts/counts_merge_ngmerge.smk index 2dba2f21..6a17ca8b 100644 --- a/workflow/rules/experiment/counts/counts_merge_ngmerge.smk +++ b/workflow/rules/experiment/counts/counts_merge_ngmerge.smk @@ -5,8 +5,8 @@ rule experiment_counts_merge_NGmerge_template: """ -Template rule to merge paired reads using NGmerge. -""" + Template rule to merge paired reads using NGmerge. + """ log: temp("results/logs/experiment/counts/merge_NGmerge.template.{project}.{condition}.{replicate}.{type}.{split}.log"), conda: diff --git a/workflow/rules/experiment/counts/counts_noUMI.smk b/workflow/rules/experiment/counts/counts_noUMI.smk index d588a3a8..367df6e8 100644 --- a/workflow/rules/experiment/counts/counts_noUMI.smk +++ b/workflow/rules/experiment/counts/counts_noUMI.smk @@ -8,8 +8,8 @@ rule experiment_counts_noUMI_create_BAM: """ -Create a BAM file from FASTQ input, merge FWD and REV read and save UMI in XI flag. -""" + Create a BAM file from FASTQ input, merge FWD and REV read and save UMI in XI flag. + """ input: fwd_fastq=lambda wc: getFWD(wc.project, wc.condition, wc.replicate, wc.type, check_splitting=True, check_trimming=True), rev_fastq=lambda wc: getREV(wc.project, wc.condition, wc.replicate, wc.type, check_splitting=True, check_trimming=True), @@ -64,8 +64,8 @@ use rule experiment_counts_merge_NGmerge_template as experiment_counts_noUMI_mer rule experiment_counts_noUMI_raw_counts: """ -Counting BCsxUMIs from the BAM files. -""" + Counting BCsxUMIs from the BAM files. + """ input: lambda wc: ( expand( diff --git a/workflow/rules/experiment/counts/counts_onlyFWD.smk b/workflow/rules/experiment/counts/counts_onlyFWD.smk index f268d561..270c871b 100644 --- a/workflow/rules/experiment/counts/counts_onlyFWD.smk +++ b/workflow/rules/experiment/counts/counts_onlyFWD.smk @@ -7,8 +7,8 @@ rule experiment_counts_onlyFWD_raw_counts: """ -Getting the BCs from the reads using fixed length. -""" + Getting the BCs from the reads using fixed length. + """ input: lambda wc: getFWD(wc.project, wc.condition, wc.replicate, wc.type, check_splitting=False, check_trimming=True), output: diff --git a/workflow/rules/experiment/counts/counts_onlyFWDWithUMI.smk b/workflow/rules/experiment/counts/counts_onlyFWDWithUMI.smk index 25526be4..502aabd8 100644 --- a/workflow/rules/experiment/counts/counts_onlyFWDWithUMI.smk +++ b/workflow/rules/experiment/counts/counts_onlyFWDWithUMI.smk @@ -8,8 +8,8 @@ rule experiment_counts_onlyFWDUMI_raw_counts: """ -Getting the BCs and UMIs from the reads using fixed length. -""" + Getting the BCs and UMIs from the reads using fixed length. + """ input: fwd_fastq=lambda wc: getFWD( wc.project, wc.condition, wc.replicate, wc.type, check_splitting=False, check_trimming=True diff --git a/workflow/rules/experiment/counts/counts_umi.smk b/workflow/rules/experiment/counts/counts_umi.smk index 0fa8f166..7e97f85b 100644 --- a/workflow/rules/experiment/counts/counts_umi.smk +++ b/workflow/rules/experiment/counts/counts_umi.smk @@ -8,8 +8,8 @@ rule experiment_counts_umi_create_BAM: """ -Create a BAM file from FASTQ input, merge FWD and REV read and save UMI in XI flag. -""" + Create a BAM file from FASTQ input, merge FWD and REV read and save UMI in XI flag. + """ input: fwd_fastq=lambda wc: getFWD(wc.project, wc.condition, wc.replicate, wc.type, check_splitting=True, check_trimming=True), rev_fastq=lambda wc: getREV(wc.project, wc.condition, wc.replicate, wc.type, check_splitting=True, check_trimming=True), @@ -51,8 +51,8 @@ Create a BAM file from FASTQ input, merge FWD and REV read and save UMI in XI fl rule experiment_counts_umi_attach_idx: """ -Attach UMI read to FWD/REV headers before NGmerge. -""" + Attach UMI read to FWD/REV headers before NGmerge. + """ input: read=lambda wc: getExperimentReads( wc.read, @@ -99,8 +99,8 @@ use rule experiment_counts_merge_NGmerge_template as experiment_counts_umi_merge rule experiment_counts_umi_raw_counts: """ -Counting BCsxUMIs from the BAM files. -""" + Counting BCsxUMIs from the BAM files. + """ input: lambda wc: ( expand( diff --git a/workflow/rules/experiment/preprocessing.smk b/workflow/rules/experiment/preprocessing.smk index 6d01ee75..26ce067f 100644 --- a/workflow/rules/experiment/preprocessing.smk +++ b/workflow/rules/experiment/preprocessing.smk @@ -1,8 +1,8 @@ rule experiment_preprocessing_split_reads: """ -Split the fastq files into n files for parallelisation. -n is given by split_read in the configuration file. -""" + Split the fastq files into n files for parallelisation. + n is given by split_read in the configuration file. + """ input: lambda wc: getExperimentReads( wc.read_type, wc.project, wc.condition, wc.replicate, wc.type, check_splitting=False, check_trimming=False @@ -33,8 +33,8 @@ n is given by split_read in the configuration file. rule experiment_preprocessing_trim_reads: """ -Getting the BCs from the reads using cutadapt. -""" + Getting the BCs from the reads using cutadapt. + """ input: reads=lambda wc: getExperimentReads( wc.read_type, wc.project, wc.condition, wc.replicate, wc.type, check_splitting=True, check_trimming=False diff --git a/workflow/rules/experiment/statistic.smk b/workflow/rules/experiment/statistic.smk index e58be934..3485808b 100644 --- a/workflow/rules/experiment/statistic.smk +++ b/workflow/rules/experiment/statistic.smk @@ -20,8 +20,8 @@ include: "statistic/bc_overlap.smk" rule experiment_statistic_quality_metric: """ -Quality metrics of the assignment run -""" + Quality metrics of the assignment run + """ input: barcode="results/experiments/{project}/reporter_experiment.barcode.{condition}.{assignment}.{config}.all.tsv.gz", assignment="results/experiments/{project}/assignment/{assignment}.tsv.gz", diff --git a/workflow/rules/experiment/statistic/assigned_counts.smk b/workflow/rules/experiment/statistic/assigned_counts.smk index ad0a5b0e..f87edc6e 100644 --- a/workflow/rules/experiment/statistic/assigned_counts.smk +++ b/workflow/rules/experiment/statistic/assigned_counts.smk @@ -6,8 +6,8 @@ rule experiment_statistic_assigned_counts_combine_BC_assignment_stats_helper: """ -Combine assigned counts statistic per replicate and modality (DNA and RNA not merged) -""" + Combine assigned counts statistic per replicate and modality (DNA and RNA not merged) + """ input: stats=lambda wc: expand( "results/experiments/{{project}}/statistic/assigned_counts/{{assignment}}/{{condition}}.{replicate}.{type}.{{config}}.statistic.tsv.gz", @@ -38,8 +38,8 @@ Combine assigned counts statistic per replicate and modality (DNA and RNA not me rule experiment_statistic_assigned_counts_combine_BC_assignment_stats: """ -Combined assinged counts statistic per condition (DNA and aRNA not merged) -""" + Combined assinged counts statistic per condition (DNA and aRNA not merged) + """ input: stats=lambda wc: expand( "results/experiments/{{project}}/statistic/assigned_counts/{{assignment}}/helper.{condition}.{{config}}.statistic.tsv.gz", @@ -84,8 +84,8 @@ Combined assinged counts statistic per condition (DNA and aRNA not merged) rule experiment_statistic_assigned_counts_combine_stats_dna_rna_merge: """ -Combine assigned counts statistic per replicate (DNA and RNA merged) -""" + Combine assigned counts statistic per replicate (DNA and RNA merged) + """ input: files=lambda wc: expand( "results/experiments/{{project}}/statistic/assigned_counts/{{assignment}}/{{config}}/{{condition}}.{replicate}.merged_assigned_counts.statistic.tsv.gz", @@ -116,8 +116,8 @@ Combine assigned counts statistic per replicate (DNA and RNA merged) rule experiment_statistic_assigned_counts_combine_stats_dna_rna_merge_all: """ -Combine assigned counts statistic per condition (DNA and RNA merged) -""" + Combine assigned counts statistic per condition (DNA and RNA merged) + """ input: files=lambda wc: expand( "results/experiments/{{project}}/statistic/assigned_counts/{{assignment}}/{{config}}/combined/{condition}.merged_assigned_counts.statistic.tsv.gz", diff --git a/workflow/rules/experiment/statistic/bc_overlap.smk b/workflow/rules/experiment/statistic/bc_overlap.smk index a8cbff69..42ed41b6 100644 --- a/workflow/rules/experiment/statistic/bc_overlap.smk +++ b/workflow/rules/experiment/statistic/bc_overlap.smk @@ -5,8 +5,8 @@ rule experiment_statistic_bc_overlap_run: """ -Get overlap of counts and barcodes between replicates. -""" + Get overlap of counts and barcodes between replicates. + """ input: files=lambda wc: expand( getFinalCounts(wc.project, wc.config, wc.condition, wc.type, wc.raw_or_assigned), @@ -47,8 +47,8 @@ Get overlap of counts and barcodes between replicates. rule experiment_statistic_bc_overlap_combine_counts: """ -Combine overlap BC and count statistic into one file (raw counts). -""" + Combine overlap BC and count statistic into one file (raw counts). + """ input: statistic=lambda wc: expand( "results/experiments/{{project}}/statistic/bc_overlap/counts/overlapBCandCounts.{condition}.{type}.{config}.tsv", @@ -86,8 +86,8 @@ Combine overlap BC and count statistic into one file (raw counts). rule experiment_statistic_bc_overlap_combine_assigned_counts: """ -Combine overlap BC and count statistic into one file (assigned counts). -""" + Combine overlap BC and count statistic into one file (assigned counts). + """ input: statistic=lambda wc: expand( "results/experiments/{{project}}/statistic/bc_overlap/assigned_counts/{{assignment}}/overlapBCandCounts.{condition}.{type}.{{config}}.tsv", diff --git a/workflow/rules/experiment/statistic/correlation.smk b/workflow/rules/experiment/statistic/correlation.smk index 34af6a48..d0b52973 100644 --- a/workflow/rules/experiment/statistic/correlation.smk +++ b/workflow/rules/experiment/statistic/correlation.smk @@ -5,8 +5,8 @@ rule experiment_statistic_correlation_bc_counts: """ -Calculate the correlation of the raw counts for each condition across replicates. -""" + Calculate the correlation of the raw counts for each condition across replicates. + """ input: files=lambda wc: getMergedCounts(wc.project, wc.raw_or_assigned, wc.condition, wc.config)[0], script=getScript("count/plot_perBCCounts_correlation.R"), @@ -70,8 +70,8 @@ Calculate the correlation of the raw counts for each condition across replicates rule experiment_statistic_correlation_bc_counts_hist: """ -Generate histogram and boxplots of the raw counts for each condition across replicates. -""" + Generate histogram and boxplots of the raw counts for each condition across replicates. + """ input: files=lambda wc: getMergedCounts(wc.project, wc.raw_or_assigned, wc.condition, wc.config)[0], script=getScript("count/plot_perBCCounts_stats.R"), @@ -103,8 +103,8 @@ Generate histogram and boxplots of the raw counts for each condition across repl rule experiment_statistic_correlation_combine_bc_raw: """ -Combine the correlation of the raw counts for each condition across replicates into one table. -""" + Combine the correlation of the raw counts for each condition across replicates into one table. + """ input: files=lambda wc: expand( "results/experiments/{{project}}/statistic/barcode/counts/{condition}.{{config}}.barcode.correlation.tsv", @@ -138,8 +138,8 @@ Combine the correlation of the raw counts for each condition across replicates i rule experiment_statistic_correlation_combine_bc_assigned: """ -Combine the correlation of the assigned counts for each condition across replicates into one table. -""" + Combine the correlation of the assigned counts for each condition across replicates into one table. + """ input: files=lambda wc: expand( "results/experiments/{{project}}/statistic/barcode/assigned_counts/{{assignment}}/{condition}.{{config}}.barcode.correlation.tsv", @@ -178,8 +178,8 @@ Combine the correlation of the assigned counts for each condition across replica rule experiment_statistic_correlation_calculate: """ -Calculate the correlation of oligos for each condition across replicates. -""" + Calculate the correlation of oligos for each condition across replicates. + """ input: counts=lambda wc: expand( "results/experiments/{{project}}/assigned_counts/{{assignment}}/{{config}}/{{condition}}.{replicate}.merged_assigned_counts.tsv.gz", @@ -308,8 +308,8 @@ Calculate the correlation of oligos for each condition across replicates. rule experiment_statistic_correlation_hist_box_plots: """ -Generate histogram and boxplots of the oligos for each condition across replicates. -""" + Generate histogram and boxplots of the oligos for each condition across replicates. + """ input: counts=lambda wc: expand( "results/experiments/{{project}}/assigned_counts/{{assignment}}/{{config}}/{{condition}}.{replicate}.merged_assigned_counts.tsv.gz", @@ -367,8 +367,8 @@ Generate histogram and boxplots of the oligos for each condition across replicat rule experiment_statistic_correlation_combine_oligo: """ -Combine the correlation of oligos for each condition across replicates into one table. -""" + Combine the correlation of oligos for each condition across replicates into one table. + """ input: correlation=lambda wc: expand( "results/experiments/{{project}}/statistic/assigned_counts/{{assignment}}/{{config}}/{condition}.correlation.tsv", diff --git a/workflow/rules/experiment/statistic/counts.smk b/workflow/rules/experiment/statistic/counts.smk index 38e66441..dc9ea863 100644 --- a/workflow/rules/experiment/statistic/counts.smk +++ b/workflow/rules/experiment/statistic/counts.smk @@ -8,8 +8,8 @@ include: "counts_common.smk" rule experiment_statistic_counts_frequent_umis: """ -Count the 10 most frequent UMIs per condition, replicate and DNA/RNA. -""" + Count the 10 most frequent UMIs per condition, replicate and DNA/RNA. + """ input: "results/experiments/{project}/counts/{condition}.{replicate}.{type}.filtered_counts.tsv.gz", output: @@ -42,8 +42,8 @@ Count the 10 most frequent UMIs per condition, replicate and DNA/RNA. rule experiment_statistic_counts_barcode_base_composition: """ -Count the nucleotide composition of the barcodes per condition, replicate and DNA/RNA. -""" + Count the nucleotide composition of the barcodes per condition, replicate and DNA/RNA. + """ input: counts="results/experiments/{project}/counts/{condition}.{replicate}.{type}.final_counts.tsv.gz", script=getScript("count/nucleotideCountPerPosition.py"), @@ -85,8 +85,8 @@ Count the nucleotide composition of the barcodes per condition, replicate and DN rule experiment_statistic_counts_table: """ -Count statistic of barcodes and UMIs per condition, replicate and DNA/RNA. -""" + Count statistic of barcodes and UMIs per condition, replicate and DNA/RNA. + """ input: lambda wc: ( "results/experiments/{project}/counts/{condition}.{replicate}.{type}.{countType}_counts.tsv.gz" @@ -129,8 +129,8 @@ Count statistic of barcodes and UMIs per condition, replicate and DNA/RNA. rule experiment_statistic_counts_stats_merge: """ -Merge the count statistic of all replicates and conditions into one table. -""" + Merge the count statistic of all replicates and conditions into one table. + """ input: lambda wc: getCountStats(wc.project, wc.countType), output: @@ -147,8 +147,8 @@ Merge the count statistic of all replicates and conditions into one table. rule experiment_statistic_counts_BC_in_RNA_DNA: """ -Count the number of barcodes shared between RNA and DNA per condition and replicate. -""" + Count the number of barcodes shared between RNA and DNA per condition and replicate. + """ input: dna=lambda wc: statistic_counts_BC_in_RNA_DNA_helper(wc.project, wc.condition, "DNA", wc.countType), rna=lambda wc: statistic_counts_BC_in_RNA_DNA_helper(wc.project, wc.condition, "RNA", wc.countType), @@ -172,8 +172,8 @@ Count the number of barcodes shared between RNA and DNA per condition and replic rule experiment_statistic_counts_BC_in_RNA_DNA_merge: """ -Merge the shared barcodes statistic of all replicates and conditions into one table. -""" + Merge the shared barcodes statistic of all replicates and conditions into one table. + """ input: getBCinRNADNAStats, output: @@ -190,8 +190,8 @@ Merge the shared barcodes statistic of all replicates and conditions into one ta rule experiment_statistic_counts_final: """ -Combine the final count statistic of all replicates and conditions into one table. -""" + Combine the final count statistic of all replicates and conditions into one table. + """ input: counts="results/experiments/{project}/statistic/counts/count_{countType}.tsv", shared="results/experiments/{project}/statistic/counts/BC_in_RNA_DNA_{countType}.tsv", diff --git a/workflow/rules/qc_report.smk b/workflow/rules/qc_report.smk index 4b2e82cd..a0b7fb59 100644 --- a/workflow/rules/qc_report.smk +++ b/workflow/rules/qc_report.smk @@ -3,8 +3,8 @@ import os rule qc_report_assoc: """ -This rule generates the QC report for the assignment. -""" + This rule generates the QC report for the assignment. + """ input: quarto_script=getScript("report/qc_report_assoc.qmd"), design_file=lambda wc: config["assignments"][wc.assignment]["design_file"], @@ -85,8 +85,8 @@ This rule generates the QC report for the assignment. rule qc_report_count: """ -This rule generates the QC report for the count data. -""" + This rule generates the QC report for the count data. + """ input: quarto_script=getScript("report/qc_report_count.qmd"), dna_oligo_coor_min_thre_plot="results/experiments/{project}/statistic/assigned_counts/{assignment}/{config}/{condition}.DNA.pairwise.minThreshold.png",