Table of Contents | ||
---|---|---|
|
...
Info |
---|
Not familiar with the module function? Please review the Modules section section of the Intro to HPC. |
Finally make sure you are in your home directory, if unsure you can run the following commandwe will create a folder which will contain all the exercises and code from today:
Code Block |
---|
cd ~mkdir -p $HOME/workshop/2024-2/session3 |
Installing Nextflow for the first time
...
To install Nextflow for the first time, copy and paste the following block of code into your terminal (i.e., PuTTy that is already connected to the terminal) and hit 'enter':
Code Block |
---|
curl -s https://get.nextflow.io | bash mv nextflow $HOME/bin |
Line 1: This command downloads and assembles the parts of nextflow - this step might take some time.
Line 2: When finished, the nextflow binary will be in the current folder so it should be moved to your “bin” folder” so it can be found later.
...
Updating Nextflow
If you have installed Nextflow before on the HPC then you will have to run:
...
We will also run locally your first Nextflow pipeline, which is called Hello:
Code Block |
---|
mkdir -p $HOME/workshop/2024-2/session3/nftemp && cd $HOME/workshop/2024-2/session3/nftemp nextflow run hello |
Line 12: Make a temporary folder called nftemp for Nextflow to create files when it runs the hello pipeline; change directory to this newly created folder.
Line 23: Verify Nextflow is working.
You should see something like this:
...
Now that you have managed to run the hello pipeline, go back to your home directory and clean the test folder.
Code Block |
---|
cd $HOME rm -rf $HOME/workshop/2024-2/session3/nftemp |
Nextflow’s base configuration
...
Code Block |
---|
[[ -d $HOME/.nextflow ]] || mkdir -p $HOME/.nextflow cat <<EOF > $HOME/.nextflow/config singularity { cacheDir = '$HOME/.nextflow/NXF_SINGULARITY_CACHEDIR' autoMounts = true } conda { cacheDir = '$HOME/.nextflow/NXF_CONDA_CACHEDIR' } process { executor = 'pbspro' scratch = false cleanup = false } includeConfig '/work/datasets/reference/nextflow/qutgenome.config' EOF |
Line 1: Check if a
.nextflow/config
file already exists in your home directory. Create it if it does not existLine 2-15: Using the cat command, paste text in the newly created
.nextflow/config
file which specifies the cache location for your singularity and conda.What are the parameters you are setting?
Line 4-7 set the directory where remote Singularity images are stored and direct Nextflow to automatically mount host paths in the executed container.
Line 8-10 set the directory where Conda environments are stored.
Line 11-15 sets default directives for processes in your pipeline. Note that the executor is set to pbspro on line 12.
Line 16 provides the local path to genome files required for pipelines such as nf-core/rnaseq
Info |
---|
More in depth information on Nextflow configuration is described here: https://www.nextflow.io/docs/latest/config.html. |
...