Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create templating system #33

Open
rmcminds opened this issue Jul 12, 2024 · 0 comments
Open

create templating system #33

rmcminds opened this issue Jul 12, 2024 · 0 comments

Comments

@rmcminds
Copy link
Contributor

Maybe I should just use something like snakemake rather than reinventing the wheel, but to avoid unnecessary dependencies and keep things simpler, i think it should be possible to make my own templating system for reproducibility.

create global templates for the header of generated scripts. these would then be easy to change out if we want to run the script on a different system with a different scheduler. eg have a separate template for sge vs slurm. example for slurm would be something like:

{{hashbang}}
#SBATCH --partition={{partition}}
#SBATCH --mem={{mem}}
{{main_script}}

maybe set defaults for variables, and then if a variable is required but unspecified, the default is kept, but if it's not required, the whole line is removed.

every one of my example workflows can then be rewritten as a template rather than the current cat <<EOF setup, and i can run a script that pieces the templates together based on command line options, and produces reproducible other scripts that are submitted. these scripts might always include a 'raw' shell script with all substituted variables that is easy for someone to follow, in addition to the actual sbatch script that was run on your specific system.

another template can be used for general 'path preparation' - whether that means loading modules, directly modifying the path, or something else. this template could be called multiple times within the main script template if the path needs to be different at different points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant