Commit 4134975f authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

start metaphlan3 rules

parent 8932d738
__metaphlan3_exec_command = config.get('metaphlan3', {}).get('exec_command', 'metaphlan')
__metaphlan3_modules = config.get('metaphlan3', {}).get('modules')
__metaphlan3_input_type = config['metaphlan3'].get('input_type', 'fastq')
__metaphlan3_options = config.get('metaphlan3', {}).get('options', "")
__metaphlan3_threads = config.get('metaphlan3', {}).get('threads', 1)
rule metaphlan3_paired:
"""
MetaPhlAn 3 can also natively handle paired-end metagenomes (but does not use the paired-end information),
and, more generally, metagenomes stored in multiple files (but you need to specify the --bowtie2out parameter):
$ metaphlan metagenome_1.fastq,metagenome_2.fastq --bowtie2out metagenome.bowtie2.bz2 --nproc 5
--input_type fastq > profiled_metagenome.txt
"""
input:
r1 = __metaphlan3_input_r1,
r2 = __metaphlan3_input_r2
output:
__metaphlan3_output
params:
exec_command = __metaphlan3_exec_command,
modules = __metaphlan3_modules,
input_type = __metaphlan3_input_type,
bowtie2out = "{output_dir}/{sample}.bowtie2.bz2".format(output_dir=__metaphlan3_output_dir, sample="{sample}"),
options = __metaphlan3_options
threads:
__metaphlan3_threads
run:
command = []
if params.modules:
command.append("module load {params.modules}")
command.append("{params.exec_command} --nproc {threads} --input_type {params.input_type} --bowtie2out {params.bowtie2out} {params.options} {input.r1},{input.r2} {output}")
shell(" && ".join(command))
input_dir: data
metaphlan3:
threads: 1
input_type: fastq
options: ""
pair_suffix: ""
exec_command: metaphlan
__metaphlan3_exec_command = config.get('metaphlan3', {}).get('exec_command', 'metaphlan')
__metaphlan3_modules = config.get('metaphlan3', {}).get('modules')
__metaphlan3_input_type = config['metaphlan3'].get('input_type', 'fastq')
__metaphlan3_options = config.get('metaphlan3', {}).get('options', "")
__metaphlan3_threads = config.get('metaphlan3', {}).get('threads', 1)
rule metaphlan3:
input:
__metaphlan3_input
output:
__metaphlan3_output
params:
exec_command = __metaphlan3_exec_command,
modules = __metaphlan3_modules,
input_type = __metaphlan3_input_type,
bowtie2out = "{output_dir}/{sample}.bowtie2.bz2".format(output_dir=__metaphlan3_output_dir, sample="{sample}"),
options = __metaphlan3_options
threads:
__metaphlan3_threads
run:
command = []
if params.modules:
command.append("module load {params.modules}")
command.append("{params.exec_command} --nproc {threads} --input_type {params.input_type} --bowtie2out {params.bowtie2out} {params.options} {input} {output}")
shell(" && ".join(command))
input_dir: data
metaphlan3:
threads: 1
input_type: fastq
options: "--bowtie2db /pasteur/projets/policy01/Atm/DBs/metaphlan/metaphlan3bowtie2db/"
exec_command: metaphlan
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