# Nextflow, nf-core etc. on Dardel
:::info
These instructions install `nextflow` and `nf-core` in your `$HOME` folder since they are relatively small. Please, consider installing any tool or software in your project folder instead.
:::
:::success
UPDATE 2024.10.23: `nextflow` is available as module so you can use that one if you choose so.
```
module load PDC nextflow apptainer python/3.12.3
```
:::
## :gear: General setup
```bash
# Load relevant modules
# You might need to match versions if PDC dicontinues the ones bellow
$ module load PDC java apptainer python/3.12.3
# make bin folder and add "export PATH+=:$HOME/bin" in ~/.bashrc
$ mkdir -p $HOME/bin
$ cd $HOME/bin
$ export PATH+=:$HOME/bin
```
## :computer: nextflow
```bash
# Install Nextflow
$ cd ~/bin
$ curl -s https://get.nextflow.io | bash
```
```bash
# Test Nextflow
$ nextflow run hello
N E X T F L O W ~ version 23.04.4
Pulling nextflow-io/hello ...
downloaded from https://github.com/nextflow-io/hello.git
Launching `https://github.com/nextflow-io/hello` [agitated_hugle] DSL2 - revision: 1d71f857bb [master]
executor > local (4)
[93/082645] process > sayHello (1) [100%] 4 of 4 ?
Hello world!
Hola world!
Ciao world!
Bonjour world!
```
>This clean `nextflow` installation will require ~102 MB in `~/.nextflow`
## :computer: nf-core - quick installation
> Follow instead next section for the proper way to install nf-core (or any python tool).
```bash
# Install nf-core
$ python3 -m pip install -U --user --no-cache-dir nf-core
# test
$ nf-core
,--./,-.
___ __ __ __ ___ /,-._.--~\
|\ | |__ __ / ` / \ |__) |__ } {
| \| | \__, \__/ | \ |___ \`-._,-`-,
`._,._,'
nf-core/tools version 2.10 - https://nf-co.re
...
```
>This clean `nf-core` installation will require ~70 MB in your `~/.local`
```bash
# If needed, define/export common directory for Singularity containers
# export NXF_SINGULARITY_CACHEDIR=/cfs/klemming/projects/naiss/project/NXF_SINGULARITY_CACHEDIR
# mkdir -p $NXF_SINGULARITY_CACHEDIR
# Make folder in project
$ cd /cfs/klemming/projects/naiss/project/user/sarek-test
# Disable Singularity/Apptainer cache
$ export SINGULARITY_DISABLE_CACHE=true
$ export APPTAINER_DISABLE_CACHE=true
# Run test
$ nextflow run nf-core/rnaseq -profile test,singularity --outdir outdir
------------------------------------------------------
,--./,-.
___ __ __ __ ___ /,-._.--~'
|\ | |__ __ / ` / \ |__) |__ } {
| \| | \__, \__/ | \ |___ \`-._,-`-,
`._,._,'
nf-core/rnaseq v3.12.0-g3bec233
------------------------------------------------------
...
[05/99d870] process > NFCORE_RNASEQ:RNASEQ:DESEQ2_QC_SALMON [100%] 1 of 1 ?
[c1/215fce] process > NFCORE_RNASEQ:RNASEQ:CUSTOM_DUMPSOFTWAREVERSIONS (1) [100%] 1 of 1 ?
[97/411d40] process > NFCORE_RNASEQ:RNASEQ:MULTIQC (1) [100%] 1 of 1 ?
-[nf-core/rnaseq] Pipeline completed successfully -
Completed at: 09-Oct-2023 12:15:15
Duration : 7m 25s
CPU hours : 0.5
Succeeded : 194
```
> The containers will occupy 4GB in `./work/singularity` out of 4.3 GB in total for the workflow, when the test is completed.
**To run with the SLURM scheduler** (credits to @pontus [config](https://github.com/nf-core/configs/blob/master/conf/pdc_kth.config))
```bash
$ nextflow run nf-core/rnaseq -profile test,singularity,pdc_kth --outdir outdir --project naiss2023-xx-xxxx
```
## :computer: nf-core - the proper way
The proper way is to install any python tool(s) in its own virtual environment `venv`
```bash!
# Location for the venv
DEST=$HOME/venv-nf-core
python3 -m venv ${DEST}
source ${DEST}/bin/activate
python3 -m pip install -U --no-cache-dir pip setuptools
python3 -m pip install -U --no-cache-dir nf-core
# Soft link to the tool in your $HOME/bin
ln -s ${DEST}/bin/nf-core $HOME/bin/nf-core
```
## :spiral_note_pad: Notes
Checking project and home quotas with `projinfo`
```text
$ projinfo
Last update: Mon Oct 9 13:03:08 2023
$HOME folder
Path: /cfs/klemming/home/x/xxx
Storage: 178.01 MiB
Number of files: 6569
Project info for all projects for user: xxx
If usage of specific users is not listed, then that user has not been executing job within this time period
Information for compute project: snic2022-5-301 (PI: xxx)
SNIC systems access for application experts
Active from 2022-06-16 00:00:00 to 2024-01-01 00:00:00
Members: xxx
dardel: 2000 corehours/month, used 5.70% (113 corehours) during the past 30 days
Information for storage project: snic2022-5-301 (PI: xxx)
SNIC systems access for application experts
Active from 2022-06-16 00:00:00 to 2024-01-01 00:00:00
Members: xxx
Max quota: 500 GiB, 1000000 files
Path: /cfs/klemming/projects/supr/snic_ae
Storage: 144.16 GiB (28.83%)
Number of files: 225730
```
## Troubleshooting
- If you have problems with some python modules, the easiest way is to start clean i.e. `rm -r $HOME/.local`. Keep in mind, this will remove any pip installed modules and tools
- If you are running out of space in your`$HOME` you need to install your tools in your project folder.
## :link: Links related to PDC
- [PDC](https://hackmd.io/@pmitev/Dardel_Nextflow)
- [PDC Blog](https://www.kth.se/blogs/pdc/)
- [General information about python](https://www.pdc.kth.se/software/software/python/index_general.html)
- [Run interactively](https://www.pdc.kth.se/support/documents/run_jobs/run_interactively.html)
## :mailbox: Contacts:
- [Pavlin Mitev](https://katalog.uu.se/profile/?id=N3-1425)
- [UPPMAX](https://www.uppmax.uu.se/)
- [AE@UPPMAX - related documentation](/8sqXISVRRquPDSw9o1DizQ)
###### tags: `PDC`, `Dardel`, `nextflow`, `nf-core`