Skip to content
Snippets Groups Projects
Commit 3bd54e46 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion :recycle:
Browse files

add sample2markers for strainphlan

parent e60c44c9
No related branches found
No related tags found
1 merge request!5metaphlan3 and strainphlan
# sample2markers.py for strainphlan
This step will reconstruct all species strains found in metaphlan output sam file and store them in a pickle file (*.pkl). Those strains are referred as sample-reconstructed strains.
### Help section
```
usage: sample2markers.py [-h] [-i INPUT [INPUT ...]] [--sorted]
[-f INPUT_FORMAT] [-o OUTPUT_DIR]
[-b BREADTH_THRESHOLD] [-n NPROCS]
optional arguments:
-h, --help show this help message and exit
-i INPUT [INPUT ...], --input INPUT [INPUT ...]
The input samples as SAM or BAM files
--sorted Whether the BAM input files are sorted. Default false
-f INPUT_FORMAT, --input_format INPUT_FORMAT
The input samples format {bam, sam, bz2}. Default bz2
-o OUTPUT_DIR, --output_dir OUTPUT_DIR
The output directory
-b BREADTH_THRESHOLD, --breadth_threshold BREADTH_THRESHOLD
The breadth of coverage threshold for the consensus
markers. Default 80 (%)
-n NPROCS, --nprocs NPROCS
The number of threads to execute the script
```
__sample2markers_exec_command = config.get('sample2markers', {}).get('exec_command', 'sample2markers.py')
__sample2markers_modules = config.get('sample2markers', {}).get('modules')
__sample2markers_options = config.get('sample2markers', {}).get('options', "")
__sample2markers_threads = config.get('sample2markers', {}).get('threads', 1)
rule sample2markers:
input:
__sample2markers_input
output:
dir = __sample2markers_output_dir,
file = __sample2markers_output
params:
exec_command = __sample2markers_exec_command,
modules = __sample2markers_modules,
options = __sample2markers_options
threads:
__sample2markers_threads
run:
command = []
if params.modules:
command.append("module load {params.modules}")
command.append("{params.exec_command} -n {threads} {params.options} -i {input} -o {output.dir}")
shell(" && ".join(command))
input_dir: data
sample2markers:
threads: 1
exec_command: sample2markers.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment