templates
templates
Template files for CCBR Tools.
Templates
ccbr_tools.templates.submit_slurm.sh
Functions
Name | Description |
---|---|
read_template | Read a template file |
use_template | Uses a template, formats variables, and writes it to a file. |
read_template
templates.read_template(template_name)
Read a template file
Parameters
Name | Type | Description | Default |
---|---|---|---|
template_name | str |
Name of the template file | required |
Returns
Name | Type | Description |
---|---|---|
template | str |
Contents of the template file |
use_template
=None, **kwargs) templates.use_template(template_name, output_filepath
Uses a template, formats variables, and writes it to a file.
Parameters
Name | Type | Description | Default |
---|---|---|---|
template_name | str |
The name of the template to use. | required |
output_filepath | str |
The filepath to save the output file. If not provided, it will be written to template_name in the current working directory. |
None |
**kwargs | str |
Keyword arguments to fill in the template variables. | {} |
Raises
Name | Type | Description |
---|---|---|
FileNotFoundError |
If the template file is not found. | |
IOError |
If there is an error writing the output file. |
Examples
use_template(“submit_slurm.sh”, output_filepath=“./submit_slurm.sh”, PIPELINE=“CCBR_nxf”, MODULES=“ccbrpipeliner nextflow”, ENV_VARS=““, RUN_COMMAND=”nextflow run main.nf -stub”)