Using Snakemake on the HPC Cluster: Difference between revisions

Changed to code tags
Switched back
 
Line 2: Line 2:


* Install snakemake via mamba/conda (see https://snakemake.readthedocs.io/en/stable/getting_started/installation.html)
* Install snakemake via mamba/conda (see https://snakemake.readthedocs.io/en/stable/getting_started/installation.html)
* In the working folder create a snakemake environment with <code>mamba activate snakemake</cpde>
* In the working folder create a snakemake environment with <pre>mamba activate snakemake</pre>
* Install the cluster-generic tool to submit snakemake files to a cluster from pip with <code>pip install snakemake-executor-plugin-cluster-generic</code>
* Install the cluster-generic tool to submit snakemake files to a cluster from pip with <pre>pip install snakemake-executor-plugin-cluster-generic</pre>
* Create a generic profile in ~/.config/snakemake/testprofile/config.yaml such as:
* Create a generic profile in ~/.config/snakemake/testprofile/config.yaml such as:


<code>
<pre>
executor: slurm
executor: slurm
jobs: 100
jobs: 100
Line 19: Line 19:
     myrule:
     myrule:
         mem_mb: attempt * 200
         mem_mb: attempt * 200
</code>
</pre>


== Executing a Snakefile Workflow ==
== Executing a Snakefile Workflow ==
* Create a Snakefile (see  
* Create a Snakefile (see  
** You can over-ride resources with that flag otherwise it will use the values in testprofile
** You can over-ride resources with that flag otherwise it will use the values in testprofile
* Run the Snakefile with this command <code>snakemake --profile testprofile  -j 1 --executor cluster-generic --cluster-generic-submit-cmd "batch" ... </code>
* Run the Snakefile with this command <pre>snakemake --profile testprofile  -j 1 --executor cluster-generic --cluster-generic-submit-cmd "batch" ... </pre>