---
# System prepended metadata

title: Q&A Doc - Python/Nextflow Training Sep 2025

---

# Q&A Doc - Python/Nextflow Training Sep 2025

Trainers: Marco De La Pierre, Lorenzo D'Amore

To get largest shared screen in Google Meet:
1. Bottom screen, click 3-dots icon, then "Adjust view", then in pop-up window choose "Spotlight", then close
2. Also, hover on the small pop-up window showing yourself, click if needed, then click on 3-dots, then on "Minimise"



## Tuesday 23 September - Python

Get the datasets:
```
# main dataset
 cp /hpcnfs/home/m.delapierre/portal-teachingdb-master.zip $HOME/`
 
# additional notebook with iterate performance example
cp /hpcnfs/home/m.delapierre/python-iterate-performance.ipynb $HOME/`
```

Q: can we have slides with the Conda setup for Jupyter?
A: Sure! We will provide all the slides at the end of today's training



## Wednesday 24 September - Nextflow I

Get the training repo tarball:
```
cp /hpcnfs/home/m.delapierre/training-nextflow.tgz $HOME/
cd $HOME
tar xzf training-nextflow.tgz
cd training
ls
```

Use directly the containers stored in `/hpcnfs/home/m.delapierre/containers`:
```
$ ls -1 /hpcnfs/home/m.delapierre/containers

cowpy.sif
gatk4.sif
hisat2_samtools.sif
pip_multiqc.sif
quay_cowsay.sif
samtools.sif
trim_galore.sif
```

To get a shorter prompt like trainer's one, add this at the end of your `$HOME/.bashrc`:
```
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
```
Then, either logout/login again, or execute `bash` to start another shell in the shell.



## Thursday 25 September - Nextflow II

Slurm allocation on IEO cluster terminal:
```
$ salloc -n 1 --mem=2G -t 2:00:00 --reservation=training
```

Get the training repo tarball:
```
cp /hpcnfs/home/m.delapierre/training-nextflow.tgz $HOME/
cd $HOME
tar xzf training-nextflow.tgz
cd training
ls
```

Use directly the containers stored in `/hpcnfs/home/m.delapierre/containers`:
```
$ ls -1 /hpcnfs/home/m.delapierre/containers

cowpy.sif
gatk4.sif
hisat2_samtools.sif
pip_multiqc.sif
quay_cowsay.sif
samtools.sif
trim_galore.sif
```

Genomics pipeline, shell commands to be run:

Part 1:
```
# 1- samtools
samtools index data/bam/reads_mother.bam

# 2- gatk HaplotypeCaller
gatk HaplotypeCaller \
        -R data/ref/ref.fasta \
        -I data/bam/reads_mother.bam \
        -O reads_mother.vcf \
        -L data/ref/intervals.bed
```

Part 2:
```
# 3- gatk HaplotypeCaller
gatk HaplotypeCaller \
        -R data/ref/ref.fasta \
        -I data/bam/reads_mother.bam \
        -O reads_mother.g.vcf \
        -L data/ref/intervals.bed \
        -ERC GVCF

# 4- gatk GenomicsDBImport
gatk GenomicsDBImport \
    -V reads_mother.g.vcf \
    -V reads_father.g.vcf \
    -V reads_son.g.vcf \
    -L data/ref/intervals.bed \
    --genomicsdb-workspace-path family_trio_gdb

# 5- gatk GenotypeGVCFs
gatk GenotypeGVCFs \
    -R data/ref/ref.fasta \
    -V gendb://family_trio_gdb \
    -O family_trio.vcf
```

Bash alternative to Groovy string manipulation:
```
var="a b c"
var2=$(echo $var | xargs -n 1 | while read line ; do echo "-V $line" ; done | xargs)
```

To get a shorter prompt like trainer's one, add this at the end of your `$HOME/.bashrc`:
```
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
```
Then, either logout/login again, or execute `bash` to start another shell in the shell.

