Commit 44756d39 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

add SnakeFile for metaphlan2 merge

parent a35b74dd
......@@ -3,5 +3,5 @@ input_dir: data
metaphlan2:
threads: 1
input_type: fastq
options: "COMMAND LINE OPTIONS"
options: ""
exec_command: metaphlan2.py
samples:
- S1
- S2
input_dir: data
metaphlan2_merge:
options: ""
exec_command: merge_metaphlan_tables.py
\ No newline at end of file
__metaphlan2_merge_exec_command = config['metaphlan2_merge'].get('exec_command', 'merge_metaphlan_tables.py')
__metaphlan2_merge_options = config['metaphlan2_merge'].get('options', "")
rule metaphlan2_merge:
input:
__metaphlan2_merge_input
output:
__metaphlan2_merge_output
params:
exec_command = __metaphlan2_merge_exec_command,
options = __metaphlan2_merge_options
shell:
"{params.exec_command} {params.options} {input} > {output}"
"""
This example would be used as followed:
$ snakemake --snakefile metaphlan2_merge.rules
It requires the presence of input files within data to work based on config file
e.g. : data/S1.txt
data/S2.txt
"""
configfile: "config.yaml"
__input_dir = config['input_dir']
__main_output_dir = config.get('output_dir', 'output')
# ---- Metaphlan2 merge
__metaphlan2_merge_output_dir = __main_output_dir + "/metaphlan2_merge"
__metaphlan2_merge_output_file_name = config['metaphlan2_merge'].get('output_file_name',"merged_taxonomic_profiles.txt")
__metaphlan2_merge_input = expand("{dir}/{sample}.txt".format(dir=__input_dir,
sample="{sample}"),
sample=config['samples'])
__metaphlan2_merge_output = "{dir}/{file_name}".format(dir=__metaphlan2_merge_output_dir,
file_name=__metaphlan2_merge_output_file_name)
include: "metaphlan2_merge.rules"
rule all:
input:
__metaphlan2_merge_output
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment