Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: upgrade to sourmash_plugin_branchwater v0.9.0 #20

Open
wants to merge 3 commits into
base: use_containment_plugin
Choose a base branch
from
Open
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
33 changes: 8 additions & 25 deletions Snakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# @CTB switch to using manifests?

# import utility functions:
from slainte_functions import *

Expand Down Expand Up @@ -199,25 +201,6 @@ rule make_matrix_pdf:
sourmash plot {input} --output-dir=outputs/
"""

rule unpack_database:
input:
config['databases']
output:
directory(config.get('database_sketches_dir', 'interim/database_sketches.d'))
shell: """
sourmash sig split {input} --outdir {output} -E .sig.gz \
-k {GATHER_KSIZE}
"""

rule list_databases:
input:
config.get('database_sketches_dir', 'interim/database_sketches.d')
output:
"interim/list.database-sketches.txt"
shell: """
find {input} -name "*.sig.gz" > {output}
"""

rule extract_genome_sketch:
input:
"sketches/genomes/{name}.sig.zip",
Expand All @@ -238,8 +221,8 @@ rule extract_individual_sketch:

rule metag_fastgather:
input:
query="sketches/metag/{name}.{k}.sig.gz",
db="interim/list.database-sketches.txt"
query="sketches/metag/{name}.sig.zip",
db = config['databases'],
output:
"outputs/metag_gather/{name}.{k}.fastgather.csv",
threads: 64
Expand Down Expand Up @@ -305,11 +288,11 @@ rule list_genomes:

rule list_metag:
input:
expand("sketches/metag/{n}.{{k}}.sig.gz", n=METAGENOME_NAMES),
expand("sketches/metag/{n}.sig.zip", n=METAGENOME_NAMES),
output:
"interim/list.metag-sketches.{k}.txt"
"interim/manifest.metag-sketches.csv"
shell: """
ls -1 {input} > {output}
sourmash sig collect {input} -F csv -o {output}
"""

rule list_individual_metag_sketches:
Expand All @@ -323,7 +306,7 @@ rule list_individual_metag_sketches:

rule metag_x_individual_sketches_csv:
input:
metag="interim/list.metag-sketches.{k}.txt",
metag="interim/manifest.metag-sketches.csv",
individual="interim/list.metag-individual-sketches.{k}.txt",
output:
"outputs/check/metag.x.individual.{k}.manysearch.raw.csv"
Expand Down