diff --git a/README.md b/README.md index 55cbbeb..5280164 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,17 @@ If you don't already have `conda` installed, please [download Miniconda](https:/ Because this tutorial is designed to work on a Linux-based computer cluster, please follow the below instructions to set up the conda environment (if you already have an updated version of Miniconda installed, please skip to step 3): 1. Login to your cluster environment and navigate to your home folder. + +
+ 2. Download & install Miniconda for 64-bit Linux systems. When it asks if it should initialize `conda`, say `yes`: ``` wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh ``` + +
+ 3. Open your cluster `.bashrc` in a text editor and edit the initialization script added by Miniconda so it resembles the following. This will allow environments to be properly inherited when passing jobs to cluster nodes for execution: ``` nano ~/.bashrc @@ -43,35 +49,72 @@ nano ~/.bashrc # unset __conda_setup # # <<< conda initialize <<< ``` + +
+ 4. Source your `.bash_profile` to make all of the changes take effect and finish installing Miniconda (this should also re-source your `~/.bashrc`): ``` source ~/.bash_profile ``` + +
+ 5. Clone this repository and move into the main project folder: ``` git clone https://github.com/SchlossLab/snakemake_cluster_tutorial.git cd snakemake_cluster_tutorial ``` + +
+ 6. Create an environment called `clusterTutorial` with the dependencies we need: ``` conda env create -f envs/clusterTutorial.yaml ``` + +
+ 7. Activate the environment before running any code: ``` conda activate clusterTutorial ``` + +
+ 8. Before running any jobs on the cluster, don't forget to change the `ACCOUNT` and `EMAIL` fields in the following files for whichever cluster you're using: * PBS: [cluster profile configuration](config/pbs-torque/cluster.json) and the [cluster submission script](code/clusterSnakemake.pbs) * Slurm: [cluster profile configuration](config/slurm/cluster.json) and the [cluster submission script](code/clusterSnakemake.sh) +
+ 9. Run the Snakemake workflow. **Note**: If you wish to rerun the workflow after having it successfully complete, use the `--forcerun` or the `--forceall` flags or just delete the `results/` directory by running `snakemake clean`. - - To run it locally on the login node: - ``` - snakemake - ``` - - To run it on the cluster: - ``` - snakemake --profile config/pbs-torque/ --latency 20 - ``` +* To run the entire workflow locally (without the cluster): +``` +snakemake +``` + +
+ +* To run the rules as individual steps on a PBS cluster: +``` +snakemake --profile config/pbs-torque/ --latency 20 +``` +Or to run a job that manages the workflow for you instead +``` +sbatch code/clusterSnakemake.pbs +``` + +
+ +* To run the rules as individual steps on a Slurm cluster: +``` +snakemake --profile config/slurm/ --latency 20 +``` +Or to run a job that manages the workflow for you instead +``` +sbatch code/clusterSnakemake.sh +``` + +
See the [`conda` documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/index.html) for more information.