Skip to content

Commit

Permalink
Merge branch 'master' into subset-vamb
Browse files Browse the repository at this point in the history
  • Loading branch information
SilasK authored Aug 15, 2023
2 parents 95a800a + 1daf261 commit 5f72087
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ rm -f $WD/samples.tsv
#
atlas init --db-dir --interleaved-fastq $databaseDir -w $WD $reads_dir

atlas run None screen -w $WD qc $@

echo "\n\nFinished screen\n\n"

atlas run -w $WD qc $@

echo "\n\nFinished qc\n\n"
Expand Down
5 changes: 5 additions & 0 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ wildcard_constraints:
include: "rules/sample_table.smk"
include: "rules/download.smk" # contains hard coded variables
include: "rules/qc.smk"
include: "rules/screen.smk" # expects function get_input_fastq defined in qc
include: "rules/assemble.smk"
include: "rules/binning.smk"
include: "rules/derep.smk"
Expand Down Expand Up @@ -200,6 +201,10 @@ rule qc:
output:
touch("finished_QC"),

rule screen:
input:
"QC/screen/sketch_comparison.tsv.gz"


# overwrite commands in rules/download.snakefile
onsuccess:
Expand Down
50 changes: 50 additions & 0 deletions workflow/rules/screen.smk
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

rule generate_sketch:
input:
unpack(get_input_fastq),
output:
"Intermediate/screen/sketches/{sample}.sketch.gz"
log:
"logs/screen/make_sketch/{sample}.log",
conda:
"../envs/required_packages.yaml"
threads: 1
resources:
mem=config["simplejob_mem"],
java_mem=int(config["simplejob_mem"] * JAVA_MEM_FRACTION),
shell:
"bbsketch.sh "
"in={input[0]}" # take only one read
" samplerate=0.5"
" minkeycount=2 "
" out={output} "
" blacklist=nt ssu=f name0={wildcards.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} "
" records=5000 "
" {input} "
" -Xmx{resources.java_mem}g "
" &> {log}"



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

0 comments on commit 5f72087

Please sign in to comment.