Skip to content

Commit

Permalink
added comparison based on screens
Browse files Browse the repository at this point in the history
  • Loading branch information
SilasK committed Jul 26, 2023
1 parent 8b17d5e commit a7e5e00
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
1 change: 1 addition & 0 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ wildcard_constraints:

include: "rules/sample_table.smk"
include: "rules/download.smk" # contains hard coded variables
include: "rules/screen.smk"
include: "rules/qc.smk"
include: "rules/assemble.smk"
include: "rules/binning.smk"
Expand Down
40 changes: 31 additions & 9 deletions workflow/rules/screen.smk
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ rule generate_sketch:
input:
unpack(get_input_fastq),
output:
"{sample}/.sketch.gz"
priority: 100
"Intermediate/screen/sketches/{sample}.sketch.gz"
log:
"{sample}/logs/QC/make_sketch.log",
"logs/screen/make_sketch/{sample}.log",
conda:
"../enva/required_packages.yaml"
threads: config["simplejob_threads"]
"../envs/required_packages.yaml"
threads: 1
resources:
mem=config["simplejob_mem"],
java_mem=int(config["simplejob_mem"] * JAVA_MEM_FRACTION),
Expand All @@ -18,10 +17,33 @@ rule generate_sketch:
"in={input[0]}" # take only one read
" samplerate=0.5"
" minkeycount=2 "
" out= blacklist=nt ssu=f name0=sample1 depth=t overwrite=t"
"bbsketch.sh in=test_reads/sample2_R1.fastq.gz reads=10M samplerate=0.5 minkeycount=2 out=sample2.sketch blacklist=nt ssu=f name0=sample2 depth=t overwrite=t"
" out={output} "
" blacklist=nt ssu=f name0={sample} depth=t overwrite=t "
" -Xmx{resources.java_mem}g "
" &> {log}"


rule compare_sketch:
input:
expand( rules.generate_sketch.output, sample =SAMPLES ),
output:
"QC/screen/sketch_comparison.tsv.gz"
priority: 100
log:
"logs/screen/compare_sketch.log",
conda:
"../envs/required_packages.yaml"
threads: 1
resources:
mem=config["mem"],
java_mem=int(config["mem"] * JAVA_MEM_FRACTION),
shell:
"comparesketch.sh alltoall "
" format=3 out={output} "
" {input} "
" -Xmx{resources.java_mem}g "
" &> {log}"


comparesketch.sh alltoall format=3 out=sketch_comparison.tsv sample?.sketch

sendsketch.sh sample2.sketch printdepth2=t level=2 printqfname=f printvolume=t color=f out
# sendsketch.sh sample2.sketch printdepth2=t level=2 printqfname=f printvolume=t color=f out

0 comments on commit a7e5e00

Please sign in to comment.