Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
snakemake
Commits
7f8a53c3
Commit
7f8a53c3
authored
May 07, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
add rule and example for metaphlan2
parent
d6cfbd40
Changes
3
Hide whitespace changes
Inline
Side-by-side
tools/metaphlan2/metaphlan2/config.yaml
0 → 100644
View file @
7f8a53c3
input_dir
:
data
metaphlan2
:
threads
:
1
input_type
:
fastq
options
:
"
COMMAND
LINE
OPTIONS"
exec_command
:
metaphlan2.py
tools/metaphlan2/metaphlan2/metaphlan2.rules
0 → 100644
View file @
7f8a53c3
__metaphlan2_exec_command = config['metaphlan2'].get('exec_command', 'metaphlan2.py')
__metaphlan2_options = config['metaphlan2'].get('options', "")
__metaphlan2_threads = config['metaphlan2'].get('threads', 1)
rule metaphlan2:
input:
__metaphlan2_input
output:
__metaphlan2_output
params:
exec_command = __metaphlan2_exec_command,
input_type = __metaphlan2_input_type,
options = __metaphlan2_options
threads:
__metaphlan2_threads
shell:
"{params.exec_command} --nproc {threads} --input_type {params.input_type} {params.options} {input} {output}"
tools/metaphlan2/metaphlan2/usage_example.rules
0 → 100644
View file @
7f8a53c3
"""
This example would be used as followed:
$ snakemake --snakefile metaphlan2.rules output/s01.txt
It requires the presence of data/s01.fastq.gz to work based on config file
"""
configfile: "config.yaml"
__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"
rule all:
input:
__metaphlan2_output
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment