Skip to content
Snippets Groups Projects
Commit b68c11c9 authored by kdc715's avatar kdc715
Browse files

fix log files; change email waiting time to 12:00:00

parent a5062978
No related merge requests found
......@@ -14,6 +14,7 @@ configfile: os.path.join(workflow.basedir,"config","cluster_config.yaml")
INPUT_DIR = config["INPUT_DIR"]
REFERENCE = config["REFERENCE"]
ALTREF = config["ALTREF"]
kraken_db_path = config["kraken_db_path"]
OUTPUT_PATH = config["OUTPUT_PATH"]
WORKFLOW_PATH = config["WORKFLOW_PATH"]
ASSEMBLER = config["ASSEMBLER"]
......@@ -27,8 +28,7 @@ relative_paths = {
POPINS2_BIN := os.path.join(WORKFLOW_PATH,config["POPINS2_BIN"]),
SICKLE := os.path.join(WORKFLOW_PATH,config["SICKLE_BIN"]),
GATB := os.path.join(WORKFLOW_PATH,config["MINIA_BIN"]),
VELVET := os.path.join(WORKFLOW_PATH, config["VELVET_BIN"]),
kraken_db_path := os.path.join(WORKFLOW_PATH, config["kraken_db_path"])
VELVET := os.path.join(WORKFLOW_PATH, config["VELVET_BIN"])
}
......
......@@ -30,8 +30,6 @@ if config["SICKLE"]=="no":
RESULTS_DIR + "/read_numbers.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/unmapped_analysis.log"
benchmark:
"benchmarks/analysis/unmapped_analysis.txt"
resources:
......@@ -76,8 +74,6 @@ if config["SICKLE"]=="no":
RESULTS_DIR + "/read_numbers_no_sickle_after_clean.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/unmapped_analysis_after_clean.log"
benchmark:
"benchmarks/analysis/unmapped_analysis_after_cleaning.txt"
resources:
......@@ -123,8 +119,6 @@ elif config["SICKLE"]=="yes":
RESULTS_DIR + "/read_numbers_before_filter.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/unmapped_analysis_before_filter.log"
benchmark:
"benchmarks/analysis/unmapped_analysis_before_filter.txt"
resources:
......@@ -168,8 +162,6 @@ elif config["SICKLE"]=="yes":
RESULTS_DIR + "/read_numbers_after_filter.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/unmapped_analysis_after_filter.log"
benchmark:
"benchmarks/analysis/unmapped_analysis_after_filter.txt"
resources:
......@@ -214,8 +206,6 @@ elif config["SICKLE"]=="yes":
RESULTS_DIR + "/read_numbers_before_clean_filter.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/unmapped_analysis_before_clean_filter.log"
benchmark:
"benchmarks/analysis/unmapped_analysis_before_clean_filte.txt"
resources:
......@@ -259,8 +249,6 @@ elif config["SICKLE"]=="yes":
RESULTS_DIR + "/read_numbers_after_clean.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/unmapped_analysis_after_clean.log"
benchmark:
"benchmarks/analysis/unmapped_analysis_after_cleaning.txt"
resources:
......@@ -304,8 +292,6 @@ elif config["SICKLE"]=="yes":
RESULTS_DIR + "/read_numbers_after_clean_filter.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/unmapped_analysis_after_clean_filter.log"
benchmark:
"benchmarks/analysis/unmapped_analysis_after_clean_filter.txt"
resources:
......@@ -348,8 +334,6 @@ rule assembly_analysis_table:
RESULTS_DIR + "/analysis_table.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/assembly_analysis_table.log"
benchmark:
"benchmarks/analysis/assembly_analysis_table.txt"
resources:
......@@ -391,8 +375,6 @@ rule assembly_analysis:
gc = RESULTS_DIR + "/gc_content_dist.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/assembly_analysis.log"
benchmark:
"benchmarks/analysis/assembly_analysis.txt"
resources:
......@@ -413,8 +395,6 @@ rule calculate_coverage:
cov = temp(WORK_DIR + "/{sample}/coverage.txt")
conda:
"envs/samtools21.yml"
log:
"logs/analysis/{sample}_calculate_coverage.log"
benchmark:
"benchmarks/analysis/{sample}_calculate_coverage.txt"
resources:
......@@ -456,8 +436,6 @@ rule coverage_analysis:
RESULTS_DIR + "/heatmap_coverage.png"
conda:
"envs/notebooks.yml"
log:
"logs/analysis/coverage_analysis.log"
benchmark:
"benchmarks/analysis/coverage_analysis.txt"
resources:
......
......@@ -20,11 +20,11 @@ rule index_supercontigs:
threads:
threads["single"]
log:
"logs/contigmap/index_supercontigs.log"
err="logs/contigmap/index_supercontigs.err"
benchmark:
"benchmarks/contigmap/index_supercontigs.txt"
shell:
"bwa index {RESULTS_DIR}/supercontigs.fa"
"bwa index {RESULTS_DIR}/supercontigs.fa 2> {log.err}"
if config["remove_contamination"] == 'yes':
......@@ -48,14 +48,14 @@ if config["remove_contamination"] == 'yes':
threads:
threads["multi"]["bwa"]
log:
"logs/contigmap/{sample}_map_supercontigs_clean.log"
err="logs/contigmap/map_supercontigs.err"
benchmark:
"benchmarks/contigmap/{sample}_map_supercontigs_clean.txt"
shell:
"bwa mem -a -Y -t {threads} {RESULTS_DIR}/supercontigs.fa {input.pe1} {input.pe2} "
"> {WORK_DIR}/{wildcards.sample}/contig_mapped_unsorted.sam;"
"bwa mem -a -Y -t {threads} {RESULTS_DIR}/supercontigs.fa {input.se} | awk '$1 !~ /@/' "
">> {WORK_DIR}/{wildcards.sample}/contig_mapped_unsorted.sam;"
"> {WORK_DIR}/{wildcards.sample}/contig_mapped_unsorted.sam 2>> {log.err};"
"bwa mem -a -Y -t {threads} {RESULTS_DIR}/supercontigs.fa {input.se} 2>> {log.err} | "
"awk '$1 !~ /@/' >> {WORK_DIR}/{wildcards.sample}/contig_mapped_unsorted.sam"
elif config["remove_contamination"] == 'no':
......@@ -78,14 +78,14 @@ elif config["remove_contamination"] == 'no':
threads:
threads["multi"]["bwa"]
log:
"logs/contigmap/{sample}_map_supercontigs.log"
err="logs/contigmap/{sample}_map_supercontigs.err"
benchmark:
"benchmarks/contigmap/{sample}_map_supercontigs.txt"
shell:
"bwa mem -a -Y -t {threads} {RESULTS_DIR}/supercontigs.fa {input.pe1} {input.pe2} "
"> {WORK_DIR}/{wildcards.sample}/contig_mapped_unsorted.sam;"
"bwa mem -a -Y -t {threads} {RESULTS_DIR}/supercontigs.fa {input.se} | awk '$1 !~ /@/' "
">> {WORK_DIR}/{wildcards.sample}/contig_mapped_unsorted.sam;"
"> {WORK_DIR}/{wildcards.sample}/contig_mapped_unsorted.sam 2>> {log.err};"
"bwa mem -a -Y -t {threads} {RESULTS_DIR}/supercontigs.fa {input.se} 2>> {log.err} | "
"awk '$1 !~ /@/' >> {WORK_DIR}/{wildcards.sample}/contig_mapped_unsorted.sam"
################################################################################
......@@ -102,11 +102,11 @@ rule name_sort_unsorted:
threads:
threads["multi"]["samtools"]
log:
"logs/contigmap/{sample}_name_sort_unsorted.log"
err="logs/contigmap/{sample}_name_sort_unsorted.err"
benchmark:
"benchmarks/contigmap/{sample}_name_sort_unsorted.txt"
shell:
"samtools sort -n -@ {threads} -m {resources.mem_mb} -o {output} {input}"
"samtools sort -n -@ {threads} -m {resources.mem_mb}M -o {output} {input} 2> {log.err}"
################################################################################
......@@ -124,7 +124,8 @@ if config["remove_contamination"] == 'yes':
threads:
threads["single"]
log:
"logs/contigmap/{sample}_contaminate_removed_remap_merge_set_mate.log"
out="logs/contigmap/{sample}_contaminate_removed_remap_merge_set_mate.out",
err="logs/contigmap/{sample}_contaminate_removed_remap_merge_set_mate.err"
benchmark:
"benchmarks/contigmap/{sample}_contaminate_removed_remap_merge_set_mate.txt"
shell:
......@@ -132,6 +133,7 @@ if config["remove_contamination"] == 'yes':
" --prefix {WORK_DIR} "
" --sample {wildcards.sample} "
" -o merged.bam "
" > {log.out} 2> {log.err} "
elif config["remove_contamination"] == 'no':
......@@ -148,14 +150,16 @@ elif config["remove_contamination"] == 'no':
threads:
threads["single"]
log:
"logs/contigmap/{sample}_remap_merge_set_mate.log"
out="logs/contigmap/{sample}_remap_merge_set_mate.out",
err="logs/contigmap/{sample}_remap_merge_set_mate.err"
benchmark:
"benchmarks/contigmap/{sample}_remap_merge_set_mate.txt"
shell:
"{POPINS2_BIN} merge-bams non_ref.bam contig_mapped.bam"
" --prefix {WORK_DIR} "
" --sample {wildcards.sample} "
" -o merged.bam "
" -o merged.bam "
" > {log.out} 2> {log.err} "
################################################################################
......@@ -172,11 +176,11 @@ rule coordinate_sort_unsorted:
threads:
threads["multi"]["samtools"]
log:
"logs/contigmap/{sample}_coordinate_sort_unsorted.log"
err="logs/contigmap/{sample}_coordinate_sort_unsorted.err"
benchmark:
"benchmarks/contigmap/{sample}_coordinate_sort_unsorted.txt"
shell:
"samtools sort -@ {threads} -m {resources.mem_mb} -o {output} {input}"
"samtools sort -@ {threads} -m {resources.mem_mb}M -o {output} {input} 2> {log.err}"
rule index_sorted:
......@@ -192,8 +196,8 @@ rule index_sorted:
threads:
threads["single"]
log:
"logs/contigmap/{sample}_index_sorted.log"
err="logs/contigmap/{sample}_index_sorted.err"
benchmark:
"benchmarks/contigmap/{sample}_index_sorted.txt"
shell:
"samtools index {input}"
\ No newline at end of file
"samtools index {input} 2> {log.err}"
\ No newline at end of file
......@@ -36,7 +36,8 @@ if config["SICKLE"]=="no":
threads:
threads["single"]
log:
"logs/crop_remapped/{sample}_crop_remapped.log"
out="logs/crop_remapped/{sample}_crop_remapped.out",
err="logs/crop_remapped/{sample}_crop_remapped.err"
benchmark:
"benchmarks/crop_remapped/{sample}_crop_remapped.txt"
shell:
......@@ -46,6 +47,7 @@ if config["SICKLE"]=="no":
" --sample {wildcards.sample}"
" --min-qual {params.q}"
" --min-read-len {params.l}"
" > {log.out} 2> {log.err}"
rule popins2_sort:
input:
......@@ -61,11 +63,11 @@ if config["SICKLE"]=="no":
threads:
threads["multi"]["samtools"]
log:
"logs/crop_remapped/{sample}_sort.log"
err="logs/crop_remapped/{sample}_sort.err"
benchmark:
"benchmarks/crop_remapped/{sample}_sort.txt"
shell:
"samtools sort -n -@ {threads} -m {resources.mem_mb} -o {output} {input.mates}"
"samtools sort -n -@ {threads} -m {resources.mem_mb}M -o {output} {input.mates} 2> {log.err}"
elif config["SICKLE"]=="yes":
......@@ -88,7 +90,8 @@ elif config["SICKLE"]=="yes":
threads:
threads["single"]
log:
"logs/crop_remapped/{sample}_crop_remapped_sickle.log"
out="logs/crop_remapped/{sample}_crop_remapped_sickle.out",
err="logs/crop_remapped/{sample}_crop_remapped_sickle.err"
benchmark:
"benchmarks/crop_remapped/{sample}_crop_remapped_sickle.txt"
shell:
......@@ -96,6 +99,7 @@ elif config["SICKLE"]=="yes":
"{POPINS2_BIN} crop-unmapped {input}"
" --prefix {WORK_DIR} "
" --sample {wildcards.sample}"
" > {log.out} 2> {log.err}"
rule popins2_sort:
input:
......@@ -111,11 +115,11 @@ elif config["SICKLE"]=="yes":
threads:
threads["multi"]["samtools"]
log:
"logs/crop_remapped/{sample}_sort_sickle.log"
err="logs/crop_remapped/{sample}_sort_sickle.err"
benchmark:
"benchmarks/crop_remapped/{sample}_sort_sickle.txt"
shell:
"samtools sort -n -@ {threads} -m {resources.mem_mb} -o {output} {input.mates}"
"samtools sort -n -@ {threads} -m {resources.mem_mb}M -o {output} {input.mates} 2> {log.err}"
rule popins2_sickle:
input:
......@@ -138,15 +142,18 @@ elif config["SICKLE"]=="yes":
threads:
threads["single"]
log:
"logs/crop_remapped/{sample}_sickle.log"
out="logs/crop_remapped/{sample}_sickle.out",
err="logs/crop_remapped/{sample}_sickle.err"
benchmark:
"benchmarks/crop_remapped/{sample}_sickle.txt"
shell:
"{SICKLE}"
" pe -q {params.q} -l {params.l} -x -n -t sanger"
" -f {input.pair_1} -r {input.pair_2}"
" -o {output.pair_1} -p {output.pair_2} -s {output.single};"
" -o {output.pair_1} -p {output.pair_2} -s {output.single}"
" > {log.out} 2> {log.err}; "
"{SICKLE}"
" se -q {params.q} -l {params.l} -x -n -t sanger"
" -f {input.single} -o {output.temp_single};"
" -f {input.single} -o {output.temp_single}"
" >> {log.out} 2>> {log.err}; "
"cat {output.temp_single} >> {output.single}"
\ No newline at end of file
......@@ -35,16 +35,18 @@ if config["SICKLE"]=="no":
threads:
threads["single"]
log:
"logs/crop_unmapped/{sample}_crop_unmapped.log"
out="logs/crop_unmapped/{sample}_crop_unmapped.out",
err="logs/crop_unmapped/{sample}_crop_unmapped.err"
benchmark:
"benchmarks/crop_unmapped/{sample}_crop_unmapped.txt"
shell:
"mkdir -p {WORK_DIR}/{wildcards.sample}; "
"mkdir -p {OUTPUT_PATH}/{WORK_DIR}/{wildcards.sample}; "
"{POPINS2_BIN} crop-unmapped {input}"
" --prefix {WORK_DIR} "
" --sample {wildcards.sample}"
" --min-qual {params.q}"
" --min-read-len {params.l}"
" > {log.out} 2> {log.err}"
rule popins2_sort:
input:
......@@ -60,11 +62,11 @@ if config["SICKLE"]=="no":
threads:
threads["multi"]["samtools"]
log:
"logs/crop_unmapped/{sample}_sort.log"
err="logs/crop_unmapped/{sample}_sort.err"
benchmark:
"benchmarks/crop_unmapped/{sample}_sort.txt"
shell:
"samtools sort -n -@ {threads} -m {resources.mem_mb} -o {output} {input.mates}"
"samtools sort -n -@ {threads} -m {resources.mem_mb}M -o {output} {input.mates} 2> {log.err}"
elif config["SICKLE"]=="yes":
......@@ -87,7 +89,8 @@ elif config["SICKLE"]=="yes":
threads:
threads["single"]
log:
"logs/crop_unmapped/{sample}_crop_unmapped_sickle.log"
out="logs/crop_unmapped/{sample}_crop_unmapped_sickle.out",
err="logs/crop_unmapped/{sample}_crop_unmapped_sickle.err"
benchmark:
"benchmarks/crop_unmapped/{sample}_crop_unmapped_sickle.txt"
shell:
......@@ -95,6 +98,7 @@ elif config["SICKLE"]=="yes":
"{POPINS2_BIN} crop-unmapped {input}"
" --prefix {WORK_DIR} "
" --sample {wildcards.sample}"
" > {log.out} 2> {log.err}"
rule popins2_sort:
input:
......@@ -110,11 +114,11 @@ elif config["SICKLE"]=="yes":
conda:
"envs/samtools.yml"
log:
"logs/crop_unmapped/{sample}_sort_sickle.log"
err="logs/crop_unmapped/{sample}_sort_sickle.err"
benchmark:
"benchmarks/crop_unmapped/{sample}_sort_sickle.txt"
shell:
"samtools sort -n -@ {threads} -m {resources.mem_mb} -o {output} {input.mates}"
"samtools sort -n -@ {threads} -m {resources.mem_mb}M -o {output} {input.mates} 2> {log.err}"
rule popins2_sickle:
input:
......@@ -136,15 +140,19 @@ elif config["SICKLE"]=="yes":
threads:
threads["single"]
log:
"logs/crop_unmapped/{sample}_sickle.log"
out="logs/crop_unmapped/{sample}_sickle.out",
err="logs/crop_unmapped/{sample}_sickle.err"
benchmark:
"benchmarks/crop_unmapped/{sample}_sickle.txt"
shell:
"{SICKLE}"
" pe -q {params.q} -l {params.l} -x -n -t sanger"
" -f {input.pair_1} -r {input.pair_2}"
" -o {output.pair_1} -p {output.pair_2} -s {output.single};"
" -o {output.pair_1} -p {output.pair_2} -s {output.single}"
" > {log.out} 2> {log.err}; "
"{SICKLE}"
" se -q {params.q} -l {params.l} -x -n -t sanger"
" -f {input.single} -o {output.temp_single};"
"cat {output.temp_single} >> {output.single}"
\ No newline at end of file
" -f {input.single} -o {output.temp_single}"
" >> {log.out} 2>> {log.err}; "
"cat {output.temp_single} >> {output.single}"
\ No newline at end of file
......@@ -12,13 +12,15 @@ rule sort_vcf:
threads:
threads["single"]
log:
"logs/genotype/sort_vcf.log"
out="logs/genotype/sort_vcf.out",
err="logs/genotype/sort_vcf.err"
benchmark:
"benchmarks/genotype/sort_vcf.txt"
shell:
"bcftools sort {input.ins} "
" --output-file {output}"
" --output-type v"
" > {log.out} 2> {log.err}"
rule popins2_genotype:
......@@ -32,7 +34,8 @@ rule popins2_genotype:
threads:
threads["single"]
log:
"logs/genotype/{sample}_genotype.log"
out="logs/genotype/{sample}_genotype.out",
err="logs/genotype/{sample}_genotype.err"
benchmark:
"benchmarks/genotype/{sample}_genotype.txt"
shell:
......@@ -42,6 +45,7 @@ rule popins2_genotype:
" --contigs {rules.popins2_merge_contigs.output.supercontigs} "
" --reference {REFERENCE} "
" {wildcards.sample} "
" > {log.out} 2> {log.err}"
rule merge_vcfs:
......@@ -57,11 +61,14 @@ rule merge_vcfs:
threads:
threads["single"]
log:
"logs/genotype/merge_vcfs.log"
out="logs/genotype/merge_vcfs.out",
err="logs/genotype/merge_vcfs.err"
benchmark:
"benchmarks/genotype/merge_vcfs.txt"
shell:
"bcftools merge {input}"
" --output {output} "
" --output-type z"
" --no-index "
\ No newline at end of file
" --no-index "
" > {log.out} 2> {log.err}"
\ No newline at end of file
......@@ -27,7 +27,8 @@ rule kraken_map:
threads:
threads["multi"]["kraken"]
log:
"logs/kraken/{sample}_kraken_map.log"
out="logs/kraken/{sample}_kraken_map.out",
err="logs/kraken/{sample}_kraken_map.err"
benchmark:
"benchmarks/kraken/{sample}_kraken_map.txt"
shell:
......@@ -40,7 +41,8 @@ rule kraken_map:
--output {output.single_output} \
--classified-out {output.c_single} \
--unclassified-out {output.u_single} \
{input.fq};
{input.fq} \
> {log.out} 2> {log.err};
kraken2 --memory-mapping \
--db {kraken_db_path} \
--threads {threads} \
......@@ -48,7 +50,8 @@ rule kraken_map:
--output {output.paired_output} \
--classified-out {WORK_DIR}/{wildcards.sample}/contaminate_info/cseqs#.fq \
--unclassified-out {WORK_DIR}/{wildcards.sample}/contaminate_info/useqs#.fq \
--paired {input.p1} {input.p2}
--paired {input.p1} {input.p2} \
>> {log.out} 2>> {log.err}
"""
rule obtain_classified_human_reads:
......@@ -71,7 +74,8 @@ rule obtain_classified_human_reads:
threads:
threads["single"]
log:
"logs/kraken/{sample}_obtain_classified_human_reads.log"
out="logs/kraken/{sample}_obtain_classified_human_reads.out",
err="logs/kraken/{sample}_obtain_classified_human_reads.err"
benchmark:
"benchmarks/kraken/{sample}_obtain_classified_human_reads.txt"
shell:
......@@ -82,7 +86,8 @@ rule obtain_classified_human_reads:
--single_fq {input.single_fq} \
--paired_fq1 {input.paired_fq1} \
--paired_fq2 {input.paired_fq2} \
--output_prefix {WORK_DIR}/{wildcards.sample}/contaminate_info
--output_prefix {WORK_DIR}/{wildcards.sample}/contaminate_info \
> {log.out} 2> {log.err}
"""
rule index_ref:
......@@ -102,11 +107,11 @@ rule index_ref:
threads:
threads["single"]
log:
"logs/kraken/index_ref.log"
err="logs/kraken/index_ref.err"
benchmark:
"benchmarks/kraken/index_ref.txt"
shell:
"bwa index {input.ref}"
"bwa index {input.ref} 2> {log.err}"
rule bwa_remap_classified_human:
input:
......@@ -125,13 +130,15 @@ rule bwa_remap_classified_human:
threads:
threads["multi"]["bwa"]
log:
"logs/kraken/{sample}_bwa_remap_classified_human.log"
err="logs/kraken/{sample}_bwa_remap_classified_human.err"
benchmark:
"benchmarks/kraken/{sample}_bwa_remap_classified_human.txt"
shell:
"""
bwa mem -t {threads} -M -R "@RG\\tID:{wildcards.sample}\\tPL:ILLUMINA\\tSM:{wildcards.sample}" {input.ref} {input.single} > {output.remapped_sam};
bwa mem -t {threads} -M {input.ref} {input.fq1} {input.fq2} | awk '$1 !~ /@/' >> {output.remapped_sam}
bwa mem -t {threads} -M -R "@RG\\tID:{wildcards.sample}\\tPL:ILLUMINA\\tSM:{wildcards.sample}" \
{input.ref} {input.single} > {output.remapped_sam} 2>> {log.err};
bwa mem -t {threads} -M {input.ref} {input.fq1} {input.fq2} 2>> {log.err} | \
awk '$1 !~ /@/' >> {output.remapped_sam}
"""
rule samtools_remap_classified_human:
......@@ -148,13 +155,13 @@ rule samtools_remap_classified_human:
threads:
threads["multi"]["samtools"]
log:
"logs/kraken/{sample}_samtools_remap_classified_human.log"
err="logs/kraken/{sample}_samtools_remap_classified_human.err"
benchmark:
"benchmarks/kraken/{sample}_samtools_remap_classified_human.txt"
shell:
"""
samtools view -Sb {input.sam} > {output.remapped_unsorted};
samtools sort -@ {threads} -m {resources.mem_mb} -o {output.remapped_bam} {output.remapped_unsorted}
samtools view -Sb {input.sam} > {output.remapped_unsorted} 2> {log.err};
samtools sort -@ {threads} -m {resources.mem_mb}M -o {output.remapped_bam} {output.remapped_unsorted} 2>> {log.err}
"""
rule index_reads:
......@@ -170,12 +177,12 @@ rule index_reads:
threads:
threads["single"]
log:
"logs/kraken/{sample}_index_reads.log"
err="logs/kraken/{sample}_index_reads.err"
benchmark:
"benchmarks/kraken/{sample}_index_reads.txt"
shell:
"""
samtools index {input.bam}
samtools index {input.bam} 2> {log.err}
"""
rule crop_remapped:
......@@ -193,7 +200,8 @@ rule crop_remapped:
threads:
threads["single"]
log:
"logs/kraken/{sample}_crop_remapped.log"
out="logs/kraken/{sample}_crop_remapped.out",
err="logs/kraken/{sample}_crop_remapped.err"
benchmark:
"benchmarks/kraken/{sample}_crop_remapped.txt"
shell:
......@@ -204,6 +212,7 @@ rule crop_remapped:
" -se remapped_single.fastq"
" --prefix {WORK_DIR}"
" --noSampleInfo"
" > {log.out} 2> {log.err}"
rule remapping_samsort_mates:
......@@ -219,11 +228,11 @@ rule remapping_samsort_mates:
threads:
threads["multi"]["samtools"]
log:
"logs/kraken/{sample}_remapping_samsort_mates.log"
err="logs/kraken/{sample}_remapping_samsort_mates.err"
benchmark:
"benchmarks/kraken/{sample}_remapping_samsort_mates.txt"
shell:
"samtools sort -n -@ {threads} -m {resources.mem_mb} -o {output} {input}"
"samtools sort -n -@ {threads} -m {resources.mem_mb}M -o {output} {input} 2> {log.err}"
rule merge_set_mate:
......@@ -238,7 +247,8 @@ rule merge_set_mate:
threads:
threads["single"]
log:
"logs/kraken/{sample}_merge_set_mate.log"
out="logs/kraken/{sample}_merge_set_mate.out",
err="logs/kraken/{sample}_merge_set_mate.err"
benchmark:
"benchmarks/kraken/{sample}_merge_set_mate.txt"
shell:
......@@ -246,6 +256,7 @@ rule merge_set_mate:
" --prefix {WORK_DIR} "
" --sample {wildcards.sample} "
" -o remapped_non_ref.bam"
" > {log.out} 2> {log.err}"
rule contaminate_removed:
......@@ -273,6 +284,7 @@ rule contaminate_removed:
"""
cat {input.single} {input.u_single} > {output.single_clean};
cat {input.p1} {input.u_p1} > {output.p1_clean};
cat {input.p2} {input.u_p2} > {output.p2_clean}
cat {input.p2} {input.u_p2} > {output.p2_clean};
echo "Contaminates removed for {wildcards.sample}" >> {log}
"""
......@@ -25,7 +25,8 @@ rule popins2_merge_contigs:
params:
k = config["k_merge"]
log:
"logs/merge/merge_contigs.log"
out="logs/merge/merge_contigs.out",
err="logs/merge/merge_contigs.err"
benchmark:
"benchmarks/merge/merge_contigs.txt"
shell:
......@@ -36,3 +37,4 @@ rule popins2_merge_contigs:
" -r {WORK_DIR}"
" -p {RESULTS_DIR}/supercontigs"
" -di"
" > {log.out} 2> {log.err}"
......@@ -16,13 +16,14 @@ if config["SICKLE"]=="yes":
threads:
threads["multi"]["minia"]
log:
"logs/{assemblr}/{sample}_sickle_clean.log"
out="logs/{assemblr}/{sample}_sickle_clean.out",
err="logs/{assemblr}/{sample}_sickle_clean.err"
benchmark:
"benchmarks/{assemblr}/{sample}_sickle_clean.txt"
shell:
"mkdir -p {WORK_DIR}/{wildcards.sample}/assembly/;"
"{GATB} --nb-cores {threads} -1 {input.pair_1} -2 {input.pair_2} -s {input.single}"
" -o {WORK_DIR}/{wildcards.sample}/assembly/assembly --no-scaffolding;"
" -o {WORK_DIR}/{wildcards.sample}/assembly/assembly --no-scaffolding > {log.out} 2> {log.err};"
"cp {WORK_DIR}/{wildcards.sample}/assembly/assembly_final.contigs.fa {WORK_DIR}/{wildcards.sample}/{wildcards.assemblr}.contigs.fa;"
"rm -r {WORK_DIR}/{wildcards.sample}/assembly/"
......@@ -43,13 +44,14 @@ if config["SICKLE"]=="yes":
threads:
threads["multi"]["minia"]
log:
"logs/{assemblr}/{sample}_sickle.log"
out="logs/{assemblr}/{sample}_sickle.out",
err="logs/{assemblr}/{sample}_sickle.err"
benchmark:
"benchmarks/{assemblr}/{sample}_sickle.txt"
shell:
"mkdir -p {WORK_DIR}/{wildcards.sample}/assembly/;"
"{GATB} --nb-cores {threads} -1 {input.pair_1} -2 {input.pair_2} -s {input.single}"
" -o {WORK_DIR}/{wildcards.sample}/assembly/assembly --no-scaffolding;"
" -o {WORK_DIR}/{wildcards.sample}/assembly/assembly --no-scaffolding > {log.out} 2> {log.err};"
"cp {WORK_DIR}/{wildcards.sample}/assembly/assembly_final.contigs.fa {WORK_DIR}/{wildcards.sample}/{wildcards.assemblr}.contigs.fa;"
"rm -r {WORK_DIR}/{wildcards.sample}/assembly/"
......@@ -70,13 +72,14 @@ elif config["SICKLE"]=="no":
threads:
threads["multi"]["minia"]
log:
"logs/{assemblr}/{sample}_clean.log"
out="logs/{assemblr}/{sample}_clean.out",
err="logs/{assemblr}/{sample}_clean.err"
benchmark:
"benchmarks/{assemblr}/{sample}_clean.txt"
shell:
"mkdir -p {WORK_DIR}/{wildcards.sample}/assembly/;"
"{GATB} --nb-cores {threads} -1 {input.pair_1} -2 {input.pair_2} -s {input.single}"
" -o {WORK_DIR}/{wildcards.sample}/assembly/assembly --no-scaffolding;"
" -o {WORK_DIR}/{wildcards.sample}/assembly/assembly --no-scaffolding > {log.out} 2> {log.err};"
"cp {WORK_DIR}/{wildcards.sample}/assembly/assembly_final.contigs.fa {WORK_DIR}/{wildcards.sample}/{wildcards.assemblr}.contigs.fa;"
"rm -r {WORK_DIR}/{wildcards.sample}/assembly/"
......@@ -97,12 +100,13 @@ elif config["SICKLE"]=="no":
threads:
threads["multi"]["minia"]
log:
"logs/{assemblr}/{sample}.log"
out="logs/{assemblr}/{sample}.out",
err="logs/{assemblr}/{sample}.err"
benchmark:
"benchmarks/{assemblr}/{sample}.txt"
shell:
"mkdir -p {WORK_DIR}/{wildcards.sample}/assembly/;"
"{GATB} --nb-cores {threads} -1 {input.pair_1} -2 {input.pair_2} -s {input.single}"
" -o {WORK_DIR}/{wildcards.sample}/assembly/assembly --no-scaffolding;"
" -o {WORK_DIR}/{wildcards.sample}/assembly/assembly --no-scaffolding > {log.out} 2> {log.err};"
"cp {WORK_DIR}/{wildcards.sample}/assembly/assembly_final.contigs.fa {WORK_DIR}/{wildcards.sample}/{wildcards.assemblr}.contigs.fa;"
"rm -r {WORK_DIR}/{wildcards.sample}/assembly/"
......@@ -15,7 +15,8 @@ if config["remove_contamination"] == 'yes':
threads:
threads["single"]
log:
"logs/position/{sample}_remap_find_locations.log"
out="logs/position/{sample}_remap_find_locations.out",
err="logs/position/{sample}_remap_find_locations.err"
benchmark:
"benchmarks/position/{sample}_remap_find_locations.txt"
shell:
......@@ -23,6 +24,7 @@ if config["remove_contamination"] == 'yes':
" -n remapped_non_ref.bam "
" --prefix {WORK_DIR} "
" --reference {REFERENCE} "
" > {log.out} 2> {log.err}"
elif config["remove_contamination"] == 'no':
......@@ -39,13 +41,15 @@ elif config["remove_contamination"] == 'no':
threads:
threads["single"]
log:
"logs/position/{sample}_find_locations.log"
out="logs/position/{sample}_find_locations.out",
err="logs/position/{sample}_find_locations.err"
benchmark:
"benchmarks/position/{sample}_find_locations.txt"
shell:
"{POPINS2_BIN} find-locations {wildcards.sample}"
" --prefix {WORK_DIR} "
" --reference {REFERENCE} "
" --reference {REFERENCE} "
" > {log.out} 2> {log.err}"
################################################################################
......@@ -61,13 +65,15 @@ rule popins2_merge_locations:
threads:
threads["single"]
log:
"logs/position/merge_locations.log"
out="logs/position/merge_locations.out",
err="logs/position/merge_locations.err"
benchmark:
"benchmarks/position/merge_locations.txt"
shell:
"{POPINS2_BIN} merge-locations "
" --prefix {WORK_DIR} "
" --locations {RESULTS_DIR}/locations.txt "
" > {log.out} 2> {log.err}"
rule popins2_place_refalign:
......@@ -87,7 +93,8 @@ rule popins2_place_refalign:
threads:
threads["single"]
log:
"logs/position/place_refalign.log"
out="logs/position/place_refalign.out",
err="logs/position/place_refalign.err"
benchmark:
"benchmarks/position/place_refalign.txt"
shell:
......@@ -99,6 +106,7 @@ rule popins2_place_refalign:
" --contigs {rules.popins2_merge_contigs.output.supercontigs} "
" --reference {REFERENCE} "
" --readLength {params.readlen} "
" > {log.out} 2> {log.err}"
rule popins2_place_splitalign:
......@@ -114,7 +122,8 @@ rule popins2_place_splitalign:
threads:
threads["single"]
log:
"logs/position/{sample}_place_splitalign.log"
out="logs/position/{sample}_place_splitalign.out",
err="logs/position/{sample}_place_splitalign.err"
benchmark:
"benchmarks/position/{sample}_place_splitalign.txt"
shell:
......@@ -124,6 +133,7 @@ rule popins2_place_splitalign:
" --reference {REFERENCE} "
" --readLength {params.readlen} "
" {wildcards.sample} "
" > {log.out} 2> {log.err}"
rule popins2_place_finish:
......@@ -137,11 +147,13 @@ rule popins2_place_finish:
threads:
threads["single"]
log:
"logs/position/place_finish.log"
out="logs/position/place_finish.out",
err="logs/position/place_finish.err"
benchmark:
"benchmarks/position/place_finish.txt"
shell:
"{POPINS2_BIN} place-finish "
" --prefix {WORK_DIR} "
" --insertions {rules.popins2_place_refalign.output.vcf}"
" --reference {REFERENCE} "
\ No newline at end of file
" --reference {REFERENCE} "
" > {log.out} 2> {log.err}"
\ No newline at end of file
......@@ -17,13 +17,14 @@ if config["SICKLE"]=="yes":
threads:
threads["single"]
log:
"logs/{assemblr}/{sample}_sickle_clean.log"
out="logs/{assemblr}/{sample}_sickle_clean.out",
err="logs/{assemblr}/{sample}_sickle_clean.err"
benchmark:
"benchmarks/{assemblr}/{sample}_sickle_clean.txt"
shell:
"mkdir {WORK_DIR}/{wildcards.sample}/assembly/;"
"{VELVET}/velveth {WORK_DIR}/{wildcards.sample}/assembly/ {params.kmerlength} -short -fastq {input.single} -shortPaired -fastq -separate {input.pair_1} {input.pair_2};"
"{VELVET}/velvetg {WORK_DIR}/{wildcards.sample}/assembly/ -exp_cov auto -cov_cutoff 2 -max_coverage 100 -scaffolding no;"
"{VELVET}/velveth {WORK_DIR}/{wildcards.sample}/assembly/ {params.kmerlength} -short -fastq {input.single} -shortPaired -fastq -separate {input.pair_1} {input.pair_2} > {log.out} 2> {log.err};"
"{VELVET}/velvetg {WORK_DIR}/{wildcards.sample}/assembly/ -exp_cov auto -cov_cutoff 2 -max_coverage 100 -scaffolding no >> {log.out} 2>> {log.err};"
"mv {WORK_DIR}/{wildcards.sample}/assembly/contigs.fa {WORK_DIR}/{wildcards.sample}/{wildcards.assemblr}.contigs.fa;"
"rm -r {WORK_DIR}/{wildcards.sample}/assembly/"
......@@ -46,13 +47,14 @@ if config["SICKLE"]=="yes":
threads:
threads["single"]
log:
"logs/{assemblr}/{sample}_sickle.log"
out="logs/{assemblr}/{sample}_sickle.out",
err="logs/{assemblr}/{sample}_sickle.err"
benchmark:
"benchmarks/{assemblr}/{sample}_sickle.txt"
shell:
"mkdir {WORK_DIR}/{wildcards.sample}/assembly/;"
"{VELVET}/velveth {WORK_DIR}/{wildcards.sample}/assembly/ {params.kmerlength} -short -fastq {input.single} -shortPaired -fastq -separate {input.pair_1} {input.pair_2};"
"{VELVET}/velvetg {WORK_DIR}/{wildcards.sample}/assembly/ -exp_cov auto -cov_cutoff 2 -max_coverage 100 -scaffolding no;"
"{VELVET}/velveth {WORK_DIR}/{wildcards.sample}/assembly/ {params.kmerlength} -short -fastq {input.single} -shortPaired -fastq -separate {input.pair_1} {input.pair_2} > {log.out} 2> {log.err};"
"{VELVET}/velvetg {WORK_DIR}/{wildcards.sample}/assembly/ -exp_cov auto -cov_cutoff 2 -max_coverage 100 -scaffolding no >> {log.out} 2>> {log.err};"
"mv {WORK_DIR}/{wildcards.sample}/assembly/contigs.fa {WORK_DIR}/{wildcards.sample}/{wildcards.assemblr}.contigs.fa;"
"rm -r {WORK_DIR}/{wildcards.sample}/assembly/"
......@@ -75,13 +77,14 @@ elif config["SICKLE"]=="no":
threads:
threads["single"]
log:
"logs/{assemblr}/{sample}_clean.log"
out="logs/{assemblr}/{sample}_clean.out",
err="logs/{assemblr}/{sample}_clean.err"
benchmark:
"benchmarks/{assemblr}/{sample}_clean.txt"
shell:
"mkdir {WORK_DIR}/{wildcards.sample}/assembly/;"
"{VELVET}/velveth {WORK_DIR}/{wildcards.sample}/assembly/ {params.kmerlength} -short -fastq {input.single} -shortPaired -fastq -separate {input.pair_1} {input.pair_2};"
"{VELVET}/velvetg {WORK_DIR}/{wildcards.sample}/assembly/ -exp_cov auto -cov_cutoff 2 -max_coverage 100 -scaffolding no;"
"{VELVET}/velveth {WORK_DIR}/{wildcards.sample}/assembly/ {params.kmerlength} -short -fastq {input.single} -shortPaired -fastq -separate {input.pair_1} {input.pair_2} > {log.out} 2> {log.err};"
"{VELVET}/velvetg {WORK_DIR}/{wildcards.sample}/assembly/ -exp_cov auto -cov_cutoff 2 -max_coverage 100 -scaffolding no >> {log.out} 2>> {log.err};"
"mv {WORK_DIR}/{wildcards.sample}/assembly/contigs.fa {WORK_DIR}/{wildcards.sample}/{wildcards.assemblr}.contigs.fa;"
"rm -r {WORK_DIR}/{wildcards.sample}/assembly/"
......@@ -104,12 +107,13 @@ elif config["SICKLE"]=="no":
threads:
threads["single"]
log:
"logs/{assemblr}/{sample}.log"
out="logs/{assemblr}/{sample}.out",
err="logs/{assemblr}/{sample}.err"
benchmark:
"benchmarks/{assemblr}/{sample}.txt"
shell:
"mkdir {WORK_DIR}/{wildcards.sample}/assembly/;"
"{VELVET}/velveth {WORK_DIR}/{wildcards.sample}/assembly/ {params.kmerlength} -short -fastq {input.single} -shortPaired -fastq -separate {input.pair_1} {input.pair_2};"
"{VELVET}/velvetg {WORK_DIR}/{wildcards.sample}/assembly/ -exp_cov auto -cov_cutoff 2 -max_coverage 100 -scaffolding no;"
"{VELVET}/velveth {WORK_DIR}/{wildcards.sample}/assembly/ {params.kmerlength} -short -fastq {input.single} -shortPaired -fastq -separate {input.pair_1} {input.pair_2} > {log.out} 2> {log.err};"
"{VELVET}/velvetg {WORK_DIR}/{wildcards.sample}/assembly/ -exp_cov auto -cov_cutoff 2 -max_coverage 100 -scaffolding no >> {log.out} 2>> {log.err};"
"mv {WORK_DIR}/{wildcards.sample}/assembly/contigs.fa {WORK_DIR}/{wildcards.sample}/{wildcards.assemblr}.contigs.fa;"
"rm -r {WORK_DIR}/{wildcards.sample}/assembly/"
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment