Skip to content

Commit a851c68

Browse files
authored
MRG: simplify Snakefile by using new singlesketch output format; add retries to download genomes; bump ver (#319)
* simplify singlesketch * add retries for downloading genomes * bump version to 0.11.1
1 parent 3e96c2f commit a851c68

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

genome_grist/Snakefile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -574,15 +574,14 @@ rule download_sra_process_wc:
574574
'''
575575

576576
# compute sourmash signature from raw reads
577-
# @CTB: switch to using singlesketch?
578577
rule smash_raw_reads_wc:
579578
input:
580579
r1 = ancient(outdir + "/raw/{sample}_1.fastq.gz"),
581580
r2 = ancient(outdir + "/raw/{sample}_2.fastq.gz"),
582581
#unp = ancient(outdir + "/raw/{sample}_unpaired.fastq.gz"),
583582
output:
584-
r1 = temp(outdir + "/raw/{sample}.raw.r1.sig.gz"),
585-
r2 = temp(outdir + "/raw/{sample}.raw.r2.sig.gz"),
583+
r1 = temp(outdir + "/raw/{sample}.raw.r1.sig.zip"),
584+
r2 = temp(outdir + "/raw/{sample}.raw.r2.sig.zip"),
586585
#unp = temp(outdir + "/raw/{sample}.raw.unp.sig.gz"),
587586
merged = outdir + "/raw/{sample}.raw.sig.zip",
588587
conda: "env/sourmash.yml"
@@ -827,7 +826,6 @@ rule smash_trim_wc:
827826
metagenome = ancient(outdir + "/trim/{sample}.trim.fq.gz"),
828827
output:
829828
sig = outdir + "/sigs/{sample}.trim.sig.zip",
830-
json_out = temporary(outdir + "/sigs/{sample}.trim.sig.gz"),
831829
conda: "env/sourmash.yml"
832830
params:
833831
param_str = make_param_str(ksizes=SOURMASH_COMPUTE_KSIZES,
@@ -837,11 +835,8 @@ rule smash_trim_wc:
837835
outdir + "/benchmarks/sketch_{sample}.txt"
838836
shell: """
839837
sourmash scripts singlesketch -p {params.param_str} \
840-
-o {output.json_out} --name {wildcards.sample} {input.metagenome} \
838+
-o {output.sig} --name {wildcards.sample} {input.metagenome} \
841839
--input-moltype={SOURMASH_COMPUTE_TYPE}
842-
843-
# convert to sig.zip
844-
sourmash sig cat {output.json_out} -o {output.sig}
845840
"""
846841

847842
# configure ipython kernel for papermill
@@ -1079,6 +1074,7 @@ rule download_genbank_genomes_wc:
10791074
output:
10801075
csvfile = f'{GENBANK_CACHE}/{{ident}}.info.csv',
10811076
genome = f'{GENBANK_CACHE}/{{ident}}_genomic.fna.gz'
1077+
retries: 3
10821078
shell: """
10831079
sourmash scripts get-genomes {wildcards.ident} --output-dir {GENBANK_CACHE}
10841080
"""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "genome-grist"
33
description = "tools to support genome and metagenome analysis"
44
readme = "README.md"
55
requires-python = ">=3.12"
6-
version = "0.11.0"
6+
version = "0.11.1"
77
authors = [
88
{ name="C. Titus Brown" },
99
{ name="Luiz Irber" },

0 commit comments

Comments
 (0)