Skip to content

Commit

Permalink
Separate kmer pair calculation from plotting#
Browse files Browse the repository at this point in the history
  • Loading branch information
percyfal committed Mar 3, 2021
1 parent e9e5ee2 commit 504d34a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
21 changes: 14 additions & 7 deletions workflow/rules/jellyfish.smk
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,28 @@ rule jellyfish_histo:
wrapper: f"{WRAPPER_PREFIX}/bio/jellyfish/histo"


rule jellyfish_plot:
rule jellyfish_kmer_count_pairs:
output:
png = report("{results}/jellyfish/kmer_comparison/{assembly}.{analysis}.{kmer}_jf.png",
caption="../report/kmer_comparison.rst", category="Kmer comparison"),
tsv = "{results}/jellyfish/kmer_comparison/{assembly}.{analysis}.{kmer}_jf.tsv"
input:
assembly = "{results}/jellyfish/assembly/{assembly}.{kmer}mer_counts.jf",
reads = "{results}/jellyfish/reads/{analysis}.{kmer}mer_counts.jf"
params:
tmpdir = get_workflow_params("jellyfish", "tmpdir")
conda:
"../envs/jellyfish-python.yaml"
"../envs/jellyfish-kmer-utils.yaml"
resources:
runtime = lambda wildcards, attempt: resources("jellyfish_plot", "runtime", attempt)
threads: get_params("jellyfish_plot", "threads")
log: "logs/{results}/jellyfish/{assembly}.{analysis}.{kmer}_jf.log"
script:
shell:
"kmer_count_pairs {input.assembly} {input.reads} > {output.tsv}"


rule jellyfish_kmer_pairs_plot:
"""Plot kmer assembly and read pairs"""
output:
png = report("{results}/jellyfish/kmer_comparison/{assembly}.{analysis}.{kmer}_jf.png",
caption="../report/kmer_comparison.rst", category="Kmer pairs plot")
input:
tsv = "{results}/jellyfish/kmer_comparison/{assembly}.{analysis}.{kmer}_jf.tsv"
conda:
"../scripts/assemblyeval_jellyfish_plot.py"
8 changes: 6 additions & 2 deletions workflow/schemas/definitions.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,13 @@ definitions:
default: {}
$ref: "jellyfish.schema.yaml#/definitions/jellyfish_histo"

jellyfish_plot:
jellyfish_kmer_count_pairs:
default: {}
$ref: "jellyfish.schema.yaml#/definitions/jellyfish_plot"
$ref: "jellyfish.schema.yaml#/definitions/jellyfish_kmer_count_pairs"

jellyfish_kmer_pairs_plot:
default: {}
$ref: "jellyfish.schema.yaml#/definitions/jellyfish_kmer_pairs_plot"

##############################
# busco
Expand Down
6 changes: 5 additions & 1 deletion workflow/schemas/jellyfish.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ definitions:
description: jellyfish histo config
$ref: "definitions.schema.yaml#/definitions/resources.rule"

jellyfish_plot:
jellyfish_kmer_count_pairs:
description: jellyfish kmer count pairs config
$ref: "definitions.schema.yaml#/definitions/resources.rule"

jellyfish_kmer_pairs_plot:
description: jellyfish plot config
$ref: "definitions.schema.yaml#/definitions/resources.rule"

0 comments on commit 504d34a

Please sign in to comment.