This plugin allows Snakemake to submit jobs to an SGE (Sun Grid Engine) cluster, specifically configured for the Wynton cluster at UCSF. This documentation will guide you through the usage and configuration of this plugin.
Before you begin, ensure that you have the following installed
- Mamba/Conda
- **Snakemake (**inside the conda environement)
- Python 3.11 or higher (To Check : python —version)
- Poetry for managing dependencies (inside the conda environment)
Remember to do this inside the conda environment so it doesn’t effect other installations you already have
conda create --name <env_name>
conda activate <env_name>Clone the repository from GitHub (most updated branch : beta-v1):
git clone git@github.com:AndrewsLabUCSF/snakemake-executor-plugin-sge-wynton.gitThen change to the most updated branch:
git checkout beta-v1Although Snakemake is listed as a development dependency, you should ensure it is available in your environment.
If you do not have Poetry installed, you can install it using the following command:
curl -sSL https://install.python-poetry.org | python3 -
Add Poetry to your PATH if not already added by poetry itself (you might need to add this to your shell configuration file like .bashrc or .zshrc):
export PATH="$HOME/.local/bin:$PATH"
Then next command is :
source ~/.bashrcGo to the directory where pyproject.toml is located.
cd /wynton/home/andrews/xxx/snakemake-executor-plugin-sge-wyntonUse Poetry to install the project dependencies:
poetry install
This command creates a virtual environment and installs all the required dependencies specified in the pyproject.toml file.
Step 5: Change the jobscript.sh (need to change this manually for sge )
Go to the snakemake_interface_executor_plugin site package where you installed snakemake to change the jobscript.sh.
For example:
nano /wynton/home/andrews/rakshyasharma/mambaforge/envs/{conda env name e.g: smk9}/lib/python3.12/site-packages/snakemake_interface_executor_plugins/executors/jobscript.shDelete whats in line 1 and Add this line in line 1
#$ -S /bin/bashSave your changes.
conda deactivateThen, reactivate conda again using
conda activate snakemakecp -r /wynton/group/andrews/bin/genetic_correlations <path/to/your/directory>cd into the test directory and ensure your Snakefile is correctly configured to use the resources specified for the SGE Wynton cluster.
You can use tmux sessions here
You can use the plugin with Snakemake by specifying it with the --executor flag. Below is an example of how to run a Snakemake workflow using the SGE Wynton executor:
snakemake --executor sge-wynton -j 6 --max-jobs-per-second 1 --use-conda --use-singularityIf you get this error
“LockException: Error: Directory cannot be locked. Please make sure that no other Snakemake process is trying to create the same files in the following directory:…..”
Run this command in your terminal
snakemake --unlockpoetry show
poetry update