Skip to content
Snippets Groups Projects

metaphlan3 and strainphlan

Merged Kenzo-Hugo Hillion requested to merge 21-metaphlan3 into master
Files
7
+ 36
0
__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:
profile = __metaphlan3_output,
bowtie2out = __metaphlan3_output_bowtie2out,
sams = __metaphlan3_output_sams
params:
exec_command = __metaphlan3_exec_command,
modules = __metaphlan3_modules,
input_type = __metaphlan3_input_type,
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} -s {output.sams} --bowtie2out {output.bowtie2out} {params.options} {input.r1},{input.r2} {output.profile}")
shell(" && ".join(command))
Loading