diff --git a/workflow/Snakefile b/workflow/Snakefile index db25008..a9b32fd 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -6,7 +6,7 @@ from pathlib import Path configfile: "config/config.yaml" -#sample_file = Path.joinpath(Path(".."), Path(config["sample_file"])) +# sample_file = Path.joinpath(Path(".."), Path(config["sample_file"])) sample_file = Path(config["sample_file"]) samples = read_table(sample_file)["sample_name"].tolist() diff --git a/workflow/data/samples/readme_samples.md b/workflow/data/samples/readme_samples.md deleted file mode 100644 index 738e69b..0000000 --- a/workflow/data/samples/readme_samples.md +++ /dev/null @@ -1,4 +0,0 @@ -Put all to be analysed fastq files here -assumed naming convention: -sampleName_R1.fastq.gz -sampleName_R2.fastq.gz diff --git a/workflow/rules/align.smk b/workflow/rules/align.smk index 3d0322e..858837c 100644 --- a/workflow/rules/align.smk +++ b/workflow/rules/align.smk @@ -1,10 +1,10 @@ # mapping of the reads to the reference genome using Burrows-Wheeler Aligner rule bwa_mem: input: - amb="{{reference_path}}/{reference}.fa.amb", - ref="{{reference_path}}/{reference}.fa", - fastq_r1="{{data_path}}/{sample}_R1.fastq.gz", - fastq_r2="{{data_path}}/{sample}_R2.fastq.gz", + amb = Path.joinpath(Path(config["reference_path"]), "{reference}.fa.amb"), + ref = Path.joinpath(Path(config["reference_path"]), "{reference}.fa"), + fastq_r1=Path.joinpath(Path(config["data_path"]), "{sample}_R1.fastq.gz"), + fastq_r2=Path.joinpath(Path(config["data_path"]), "{sample}_R2.fastq.gz"), wildcard_constraints: reference="[A-Za-z0-9]+", output: @@ -36,12 +36,12 @@ rule idx_bam: # creates index for the reference sequence in fasta format rule idx_fasta: input: - "{{reference_path}}/{reference}.fa", + Path.joinpath(Path(config["reference_path"]), "{reference}.fa"), output: - "{{reference_path}}/{reference}.fa.fai", + Path.joinpath(Path(config["reference_path"]), "{reference}.fa.fai"), conda: "../envs/samtools.yaml" - log: - "logs/{{reference_path}}/{reference}/idx_fasta.log", + #log: + # "logs/{{reference_path}}/{reference}/idx_fasta.log", shell: "samtools faidx {input}" diff --git a/workflow/rules/consensus_sequence.smk b/workflow/rules/consensus_sequence.smk index bc28575..f3c89dd 100644 --- a/workflow/rules/consensus_sequence.smk +++ b/workflow/rules/consensus_sequence.smk @@ -18,7 +18,7 @@ rule prepare_for_seq: # creates the consensus sequence rule vcf_to_fasta: input: - ref="{{reference_path}}/{reference}.fa", + ref=Path.joinpath(Path(config["reference_path"]), "{reference}.fa"), vcf="results/sequences/{caller}/{reference}/{sample}.vcf.gz", index="results/sequences/{caller}/{reference}/{sample}.vcf.gz.tbi", output: diff --git a/workflow/rules/reference.smk b/workflow/rules/reference.smk index 2bbe1a3..09b302a 100644 --- a/workflow/rules/reference.smk +++ b/workflow/rules/reference.smk @@ -1,9 +1,9 @@ # downloading the mitochondrial reference genome for mouse, dog and human data rule get_ref: output: - "{{reference_path}}/{reference}.fa", - log: - "logs/{{reference_path}}/{reference}/get_ref.log", + Path.joinpath(Path(config["reference_path"]), "{reference}.fa"), + #log: + # "logs/{{reference_path}}/{reference}/get_ref.log", run: if config["reference"] == "mouse": shell( @@ -22,18 +22,18 @@ rule get_ref: # creates the index for the reference genome rule bwa_idx: input: - "{{reference_path}}/{reference}.fa", + Path.joinpath(Path(config["reference_path"]), "{reference}.fa"), output: - "{{reference_path}}/{reference}.fa.amb", - "{{reference_path}}/{reference}.fa.ann", - "{{reference_path}}/{reference}.fa.bwt", - "{{reference_path}}/{reference}.fa.pac", - "{{reference_path}}/{reference}.fa.sa", + Path.joinpath(Path(config["reference_path"]), "{reference}.fa.amb"), + Path.joinpath(Path(config["reference_path"]), "{reference}.fa.ann"), + Path.joinpath(Path(config["reference_path"]), "{reference}.fa.bwt"), + Path.joinpath(Path(config["reference_path"]), "{reference}.fa.pac"), + Path.joinpath(Path(config["reference_path"]), "{reference}.fa.sa"), wildcard_constraints: reference="[A-Za-z0-9]+", conda: "../envs/bwa.yaml" - log: - "logs/{{reference_path}}/{reference}/bwa_idx.log", + #log: + # "logs/{{reference_path}}/{reference}/bwa_idx.log", shell: "bwa index {input}" diff --git a/workflow/rules/variants_bcftools.smk b/workflow/rules/variants_bcftools.smk index f48a68c..fff6ffb 100644 --- a/workflow/rules/variants_bcftools.smk +++ b/workflow/rules/variants_bcftools.smk @@ -6,8 +6,8 @@ rule call_variants: input: bam="results/mapped/{reference}/{sample}.bam", bamidx="results/mapped/{reference}/{sample}.bam.bai", - ref="{{reference_path}}/{reference}.fa", - index="{{reference_path}}/{reference}.fa.fai", + ref = Path.joinpath(Path(config["reference_path"]), "{reference}.fa"), + index = Path.joinpath(Path(config["reference_path"]), "{reference}.fa.fai"), output: "results/calls_bcftools/{reference}/{sample}.vcf", wildcard_constraints: @@ -24,7 +24,7 @@ rule call_variants: rule normalize_variants: input: vcf="results/calls_bcftools/{reference}/{sample}.vcf.gz", - ref="{{reference_path}}/{reference}.fa", + ref = Path.joinpath(Path(config["reference_path"]), "{reference}.fa"), output: "results/calls_bcftools/{reference}/norm_{sample}.vcf", conda: