Commit 17767e09 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

update metaphlan3 pipeline

parent b265ed7f
......@@ -18,7 +18,7 @@ rule metaphlan3_paired:
r1 = __metaphlan3_input_r1,
r2 = __metaphlan3_input_r2
output:
profile = __metaphlan3_output,
profile = __metaphlan3_output_profile,
bowtie2out = __metaphlan3_output_bowtie2out,
sams = __metaphlan3_output_sams
params:
......
# Simple metaphlan3 workflows
Workflows using metaphlan3 and simple visualization of the results.
All examples presented were made for our TARS cluster system. This means you will be likely to find some
absolute path into the `config.yaml` that you might not have access to.
For every workflow, an example is provided and is based on the `config.yaml` file. Singularity images are necessary for these examples.
configfile: "config.yaml"
# ==== Snakefile paths ====
__metaphlan3_rules = config.get("snakefiles", {}).get("metaphlan3", "../../tools/metaphlan2/metaphlan2/Snakefile")
__metaphlan2_merge_rules = config.get("snakefiles", {}).get("metaphlan2_merge", "../../tools/metaphlan2/metaphlan2_merge/Snakefile")
__metaphlan2_heatmap_rules = config.get("snakefiles", {}).get("metaphlan2_heatmap", "../../tools/metaphlan2/metaphlan2_heatmap/Snakefile")
__graphlan_from_metaphlan2_rules = config.get("snakefiles", {}).get("graphlan_from_metaphlan2", "../subworkflows/graphlan_from_metaphlan2/Snakefile")
__input_dir = config['input_dir']
__main_output_dir = config.get('output_dir', 'output')
# ---- Metaphlan3
__metaphlan3_output_dir = __main_output_dir + "/metaphlan3"
__metaphlan3_input_type = config['metaphlan3'].get('input_type', 'fastq')
__metaphlan3_input_r1 = "{dir}/{sample}{ext}".format(dir=__input_dir,
sample="{sample}",
ext="_1.fq.gz")
__metaphlan3_input_r2 = "{dir}/{sample}{ext}".format(dir=__input_dir,
sample="{sample}",
ext="_2.fq.gz")
__metaphlan3_output_profile = "{dir}/{sample}.profile.tsv".format(dir=__metaphlan3_output_dir,
sample="{sample}")
__metaphlan3_output_bowtie2out = "{output_dir}/{sample}.bowtie2.bz2".format(output_dir=__metaphlan3_output_dir, sample="{sample}")
__metaphlan3_output_sams = "{output_dir}/{sample}.sam.bz2".format(output_dir=__metaphlan3_output_dir, sample="{sample}")
include: __metaphlan3_rules
# ---- Metaphlan2 merge
__metaphlan2_merge_output_dir = __main_output_dir + "/metaphlan_merge"
__metaphlan2_merge_output_file_name = config['metaphlan2_merge'].get('output_file_name',"merged_taxonomic_profiles.txt")
__metaphlan2_merge_input = __metaphlan3_output_profile
__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
# ---- Graphlan Dendogram
__graphlan_from_metaphlan2_output_dir = __main_output_dir + "/graphlan"
__graphlan_from_metaphlan2_output_file_name = config.get("graphlan_from_metaphlan2", {}).get('output_name',"dendrogram.png")
__graphlan_from_metaphlan2_input = __metaphlan2_merge_output
__graphlan_from_metaphlan2_output = "{dir}/{file_name}".format(dir=__graphlan_from_metaphlan2_output_dir,
file_name=__graphlan_from_metaphlan2_output_file_name)
include: __graphlan_from_metaphlan2_rules
rule all:
input:
heatmap = __metaphlan2_heatmap_output,
dendogram = __graphlan_from_metaphlan2_output
snakefiles:
metaphlan3: /pasteur/zeus/projets/p02/metasig/gitlab/snakemake/tools/metaphlan3/metaphlan/paired/Snakefile
metaphlan2_merge: /pasteur/zeus/projets/p02/metasig/gitlab/snakemake/tools/metaphlan2/metaphlan2_merge/Snakefile
metaphlan2_heatmap: /pasteur/zeus/projets/p02/metasig/gitlab/snakemake/tools/metaphlan2/metaphlan2_heatmap/Snakefile
graphlan_from_metaphlan2: /pasteur/zeus/projets/p02/metasig/gitlab/snakemake/subworkflows/graphlan_from_metaphlan2/Snakefile
samples:
- sample_1
- sample_2
- sample_2
input_dir: /a/path/to/input/data
output_dir: metaphlan2_output
metaphlan3:
modules: singularity
threads: 4
input_type: fastq
options: --bowtie2db /pasteur/gaia/projets/p01/Atm/DBs/bowtie2/metaphlan2/
exec_command: singularity exec --bind /pasteur/ /pasteur/gaia/projets/p01/Atm/singularity/tools/metaphlan2/from_docker/metaphlan2_2.7.7_s3.2.1.simg metaphlan2.py
metaphlan2_merge:
modules: singularity
exec_command: singularity exec --bind /pasteur/ /pasteur/gaia/projets/p01/Atm/singularity/tools/metaphlan2/from_docker/metaphlan2_2.7.7_s3.2.1.simg merge_metaphlan_tables.py
metaphlan2_heatmap:
modules: singularity
exec_command: singularity exec --bind /pasteur/ /pasteur/gaia/projets/p01/Atm/singularity/tools/metaphlan2/from_docker/metaphlan2_2.6.0_s3.2.1.simg metaphlan_hclust_heatmap.py
output_name: snakemake_heatmap.png
export2graphlan:
modules: singularity
exec_command: singularity exec --bind /pasteur/ /pasteur/gaia/projets/p01/Atm/singularity/tools/graphlan/from_docker/graphlan_0.9.7_s3.2.1.simg export2graphlan.py
options: "--skip_rows 1,2 --most_abundant 100 --abundance_threshold 1 --least_biomarkers 10 --annotations 5,6 --external_annotations 7 --min_clade_size 1"
graphlan_annotate:
modules: singularity
exec_command: singularity exec --bind /pasteur/ /pasteur/gaia/projets/p01/Atm/singularity/tools/graphlan/from_docker/graphlan_0.9.7_s3.2.1.simg graphlan_annotate.py
graphlan:
modules: singularity
exec_command: singularity exec --bind /pasteur/ /pasteur/gaia/projets/p01/Atm/singularity/tools/graphlan/from_docker/graphlan_0.9.7_s3.2.1.simg graphlan.py
options: "--dpi 300 --external_legends"
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