Commit 11a919a4 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

add example of workflow for metaphlan2

parent 9b792513
__metaphlan2_heatmap_exec_command = config['metaphlan2_heatmap']['exec_command']
__metaphlan2_heatmap_exec_command = config['metaphlan2_heatmap'].get('exec_command', "metaphlan_hclust_heatmap.py")
__metaphlan2_heatmap_options = config['metaphlan2_heatmap'].get('options', "")
rule heatmap:
......
# Simple metaphlan2 workflow
This is a simple example of a workflow using metaphlan2.
## Example
An example is provided and is based on the `config.yaml` file. Singularity images are necessary for this example as well as the samples in the appropriate folder.
\ No newline at end of file
configfile: "config.yaml"
# ==== Rule paths ====
__metaphlan2_rules = "../../tools/metaphlan2/metaphlan2/metaphlan2.rules"
__metaphlan2_merge_rules = "../../tools/metaphlan2/metaphlan2_merge/metaphlan2_merge.rules"
__metaphlan2_heatmap_rules = "../../tools/metaphlan2/metaphlan2_heatmap/metaphlan2_heatmap.rules"
__input_dir = config['input_dir']
__main_output_dir = config.get('output_dir', 'output')
# ---- Metaphlan2
__metaphlan2_output_dir = __main_output_dir + "/metaphlan2"
__metaphlan2_input_type = config['metaphlan2'].get('input_type', 'fastq')
__metaphlan2_input = "{dir}/{sample}.{ext}".format(dir=__input_dir,
sample="{sample}",
ext=__metaphlan2_input_type + ".gz")
__metaphlan2_output = "{dir}/{sample}.txt".format(dir=__metaphlan2_output_dir,
sample="{sample}")
include: __metaphlan2_rules
# ---- 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=__metaphlan2_output_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
# ---- Metaphlan2 heatmap
__metaphlan2_heatmap_output_dir = __main_output_dir + "/metaphlan2_heatmap"
__metaphlan2_heatmap_output_file_name = config['metaphlan2_heatmap'].get('output_name',"heatmap.png")
__metaphlan2_heatmap_input = __metaphlan2_merge_output
__metaphlan2_heatmap_output = "{dir}/{file_name}".format(dir=__metaphlan2_heatmap_output_dir,
file_name=__metaphlan2_heatmap_output_file_name)
include: __metaphlan2_heatmap_rules
rule all:
input:
__metaphlan2_heatmap_output
samples:
- SRS014459-Stool
- SRS014464-Anterior_nares
- SRS014470-Tongue_dorsum
- SRS014472-Buccal_mucosa
- SRS014476-Supragingival_plaque
- SRS014494-Posterior_fornix
input_dir: /pasteur/homes/kehillio/Atm/kenzo/repo/workflow-benchmarking/data
output_dir: 20190509_simplecase
metaphlan2:
threads: 4
input_type: fasta
exec_command: singularity run --bind /pasteur/ /pasteur/gaia/projets/p01/Atm/singularity/metaphlan2/metaphlan2.simg
metaphlan2_merge:
exec_command: singularity run --app merge --bind /pasteur/ /pasteur/gaia/projets/p01/Atm/singularity/metaphlan2/metaphlan2.simg
metaphlan2_heatmap:
exec_command: singularity run --app heatmap --bind /pasteur/ /pasteur/gaia/projets/p01/Atm/singularity/metaphlan2/metaphlan2.simg
output_name: snakemake_heatmap.png
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