How to run ERGO-ii anlaysis in the computational infrastructure of INAB

Prerequisites

Install R

Follow instructions here: The Comprehensive R Archive Network. If you cannot download R on your local machine please contact inab-support@certh.gr.

Install RStudio

Follow instructions here: RStudio Desktop - Posit (2: Install RStudio). If you cannot download R on your local machine please contact inab-support@certh.gr.

Organize your data with the following structure

Your data should be organized with the following format:

my_data/
├─ Group1/
│  ├─ Clonotypes/
│  │  ├─ Clonotypes_sample1.txt
│  │  ├─ Clonotypes_sample2.txt
│  │  ├─ ...
│  ├─ peptides.xlsx
├─ Group2/
│  ├─ Clonotypes/
│  │  ├─ ...
│  ├─ peptides.xlsx
├─ .../
│  ├─ .../
│  ├─ ...

Peptides file

The peptides file is a 3 – column table containing the following information:

HLA allele Peptide Sample
HLA-A*02:02 AMAIAVPANV Sample1
HLA-A*02:02 MAIAVPANV Sample1
HLA-A*03:01 AIAVPANVY Sample2
HLA-C*07:01 QSYSPPFSF Sample3

Creating ERGO-II input files

1. Open RStudio

2. Set up your working directory

Find the folder where your data are located and choose “Set as Working Directory”

3. Download the necessary R scripts

Find them here: ERGO-helpers/R at main · BiodataAnalysisGroup/ERGO-helpers and place them into your working directory.

4. Open the 01.build_ergo_inputs.R

Update it with the right path of the data to run first (lines 14 + 15, remove the others if necessary).

5. Provide an output folder name of preference (line 17)

6. Run the script

7. When complete a folder will be created with the following structure:

my_output_folder/
├─ ergo-ii-input_sample1.csv
├─ ergo-ii-input_sample2.csv
├─ ...

Steps to run ERGO:

1. Log in to the appropriate server:

o 160.40.71.4

2. Move to the your working directory:

cd /work/folder_of_each_user

3. Create a new analysis directory:

mkdir ergo-ii_2026-01-07

4. Move to the your new analysis directory:

cd /work/ergo-ii_2026-01-07

5. Download script to your analysis directory

git clone https://github.com/BiodataAnalysisGroup/ERGO-helpers.git

6. Move to the your new analysis directory:

cd ERGO-helpers/ERGO-II

7. Create a folder named data and upload your data there:

mkdir data

8. Create a sample list:

ls -la data/ | awk '{print $9}' | awk -F "_" '{print $2}' | awk -F "." '{print $1}' | sort | uniq > SampleList

9. Remove samples that should not be analyzed:

nano SampleList

In order to edit the SampleList use the following:

o Delete button: Removes one letter

o Ctrl + k: Removes a whole row

o Ctrl + o and Enter: Saves the modified SampleList

o Ctrl + x: Exits and returns to the terminal

10. Run the analysis

You have to update with the right path

bash runERGO-II.sh > run.sh
nohup bash run.sh &

11. When complete score files will be created inside the folder you have uploaded.

Filtering ERGO-II results

1. Go back to your working directory (RStudio).

2. Set it as your Working Directory (same steps as before).

3. Create a new folder (e.g. ergo-ii_scores) and download the resulted scores files from the server.

4. Open the 02.filter_ergo_scores.R and update it with the right path of the data to run first (lines 9 + 10, remove the others if necessary).

5. Provide an output folder name of preference (line 12).

6. Run the script.