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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
40 changes: 20 additions & 20 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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(
[
Expand All @@ -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(
Expand Down Expand Up @@ -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"]
Expand All @@ -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"],
Expand All @@ -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(
[
Expand All @@ -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(
[
Expand All @@ -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"]
Expand All @@ -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"],
Expand Down
36 changes: 18 additions & 18 deletions workflow/rules/assignment.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"),
Expand Down
10 changes: 5 additions & 5 deletions workflow/rules/assignment/hybridFWDRead.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
26 changes: 13 additions & 13 deletions workflow/rules/assignment/mapping_bbmap.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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:
Expand Down
28 changes: 14 additions & 14 deletions workflow/rules/assignment/mapping_bwa.smk
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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",
Expand All @@ -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:
Expand All @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions workflow/rules/assignment/mapping_exact.smk
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
Loading
Loading