Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rule tool-a:
- input:
- counts=config['general']['paths']["count_matrix"]
- output:
- os.path.join(config['general']['paths']['outdir'], 'diff','tool-a', 'tool-a.tsv')
- params:
- result_dir=os.path.join(config['general']['paths']['outdir'], 'diff','tool-a')
- shell:
- """
- mkdir -p {params.result_dir}
- Rscript {GENE_TEST_DIFF_SCRIPT} {input.counts} {params.result_dir}
- """
- rule tool-b:
- input:
- counts=config['general']['paths']["count_matrix"]
- output:
- os.path.join(config['general']['paths']['outdir'], 'diff','tool-b', 'tool-b.tsv')
- params:
- result_dir=os.path.join(config['general']['paths']['outdir'], 'diff','tool-b')
- shell:
- """
- mkdir -p {params.result_dir}
- Rscript {GENE_TEST_DIFF_SCRIPT} {input.counts}
- """
- import pandas as pd
- from snakemake.utils import min_version
- import itertools
- ### set min snakemake requirement
- min_version("5.4.1")
- ### load config
- configfile: "config.yaml"
- ### load sample data
- DIFF_METH = config['general']['method']
- Tool_a = config['general']['paths']['tool_a-script']
- Tool_b = config['general']['paths']['tool_b-script']
- if DIFF_METH == "tool-a":
- GENE_TEST_DIFF_SCRIPT = Tool_a
- elif DIFF_METH == "tool-b":
- GENE_TEST_DIFF_SCRIPT = Tool_b
- else:
- sys.exit("Invalid value for 'method', possible choices are: 'tool-a' and 'tool-b'")
- onstart:
- sys.stderr.write("GENE_DIFF_METH = " + GENE_DIFF_METH + "n")
- return []
- ### define rules not to be executed on the cluster
- localrules: all
- ### define target rules
- rule all:
- input:
- expand(os.path.join(config['general']['paths']['outdir'], 'diff','tool-a','tool-a.tsv')),
- expand(os.path.join(config['general']['paths']['outdir'], 'diff','tool-b','tool-b.tsv')),
- include: "rules/tools.smk"
- general:
- gene_diff_method: 'tool-b'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement