TITLE: Core Genome Multilocous Sequence Typing Development Workflow
AUTHORS: made.krisna, William Monteith, odile.harrison, Martin C. J. Maiden

[DESCRIPTION]
Core genome MLST (cgMLST) is a high-resolution typing approach that enables the evaluation of bacterial
population structure for research and public health-related purposes, such as outbreak confirmation and routine surveillance. Currently, many pangenome analysis tools are available, with each tool employing distinct strategies for clustering orthologous genes and identifying paralogs. This protocol aims to describe a step-by-step process of developing the computational pipeline for pangenome analyses utilising a combination of software, namely PIRATE, Panaroo, chewBBACA, PEPPAN, and Genome Comparator from BIGSdb.

[STEPS]
SECTION: Developing a computational pipeline for pangenome analysis tools using complete, reference genomes
2. Pangenome analysis 1: PIRATE (Pangenome Iterative Refinement and Threshold Evaluation)

  GFF file from annotation step using Prokka

Software:
 
Command:
 

Key output file: 
 
Also available as csv file.
SECTION: Developing a computational pipeline for pangenome analysis tools using complete, reference genomes
1. Annotation of complete, reference genomes
SECTION: Developing a computational pipeline for pangenome analysis tools using complete, reference genomes
1.1.    FASTA files of complete, reference genomes

The dataset of these genomes, FASTA files and metadata included, can be accessed through PubMLST H. influenzae Isolate Database below:

 

The list of IDs:

 


SECTION: Developing a computational pipeline for pangenome analysis tools using complete, reference genomes
1.2. Annotation was done with Prokka software:
 
Command:
 

Important output file: GFF file, one per genome
SECTION: Developing a computational pipeline for pangenome analysis tools using complete, reference genomes
3. Pangenome analysis 2: Panaroo

  GFF file from annotation step using Prokka

Software:
 
Command:
 

Key output file:
  

SECTION: Developing a computational pipeline for pangenome analysis tools using complete, reference genomes
4. Pangenome analysis 3: PEPPAN (Phylogeny Enhanced Pipeline for PAN-genome)

  GFF file from annotation step using Prokka OR separate FASTA files and annotation file (i.e. annotation by BIGSdb)

Software:
 
Command:

 

Key output file:
  

SECTION: Developing a computational pipeline for pangenome analysis tools using complete, reference genomes
5. Pangenome analysis 5: chewBBACA

  FASTA files 

Software:
 

Command:
 


Key output files: 
      

SECTION: Comparison of pangenome analysis from different tools
6. Table 1. Summary of pangenome analysis results (N = 14)

 

Based on chewBBACA pangenome analysis in step 5 above, two genomes were suggested to be excluded: 10P129H1 and 84P36H1 (PubMLST id: 2222 and 19836, respectively) due to a lower number of annotated genes. Please refer to this output file of the TestGenomeQuality step:   

The pangenome analysis (Steps 1-5) was redone with the 12 genomes.

Table 2. Summary of pangenome analysis results (N = 12)

 
Bar graph comparison of results from Table 1 and 2:

 
 Based on this comparison: Although they were still affected by the quality of genomes included in the analysis, PIRATE's pan- and core genome analysis showed the most stable results, with the total number of pan genes approximating the number discovered in previous literature.
SECTION: Core genome multilocus sequence typing (cgMLST) development
7. Compiling dataset for cgMLST development and validation

The dataset of these genomes, FASTA files and metadata included, can be accessed through PubMLST H. influenzae Isolate Database, with the following IDs:

Development dataset PubMLST IDs:
  

Validation dataset PubMLST IDs:
  

SECTION: Core genome multilocus sequence typing (cgMLST) development
8. Combining multiple pangenome analysis pipelines

The final workflow for core genome identification combining multiple pangenome analysis pipelines, based on the results obtained from the Part 1-6 above, is as follows:

 

SECTION: Core genome multilocus sequence typing (cgMLST) development
9. Consolidating results from multiple pangenome analysis pipelines

Step by step on how to identify core genes, combining automatic and manual curation:

1. Choosing several "model" genomes based on PIRATE key output
2. Preparing input file format
3. Python script to generate output file
4. Repeat step 1-3 for different pangenome analysis tools
5. Compare each output file from step 4 in Excel with VLOOKUP function.
6. If needed, compare the output file from step 4 with PubMLST annotation to identify the core gene(s) not defined in the database yet.

Step 1-4 will be detailed further below.
SECTION: Core genome multilocus sequence typing (cgMLST) development
9.1. Choosing several "model genomes" based on PIRATE key output*

1. Excluding genes (or "gene family", a term in PIRATE) which:
were not present in at least 95% of the genomes.
underwent duplication event ("genomes_containing_duplication" column > 0)
This will be the temporary core gene lists. 

2. Find genome(s) with the most core genes annotated and with the least "fission events".
The fission event for each locus (if there are any) will be notable as loci with more than one allele (usually two) whose sequences do not overlap with each other.

These genomes will be our "model genomes" and their annotation results will cover the total core genes in our temporary core gene lists.

*See Part 2 above for an example of PIRATE key output 

SECTION: Core genome multilocus sequence typing (cgMLST) development
9.2. Preparing input file format

There will be two types of input files: CSV file and the modified gff files from the pangenome analysis.

1. CSV file
Template, with example:    
Each row represents 1 (temporary) core loci/core gene, as distinguished by the "gene_family" column and 1 core gene is represented at least once. 
Note on each column:
gene_family: unique ID from the pangenome analysis output for each core gene.
consensus_gene_name: the gene name of the core gene, when available. This is not a unique identification measure for the core gene.
isolate_id: the ID of one of the model genomes that "covers" the corresponding core gene. It is possible to have one core gene covered by more than one model genome. See examples below.
locus_id: locus id from the corresponding model genome and core gene it represents. See examples below.

Example 1
 

Example 2
 

2. Modified gff files
Copy modified gff files (one of the outputs of pangenome analysis) for all the model genomes to a new folder.



SECTION: Core genome multilocus sequence typing (cgMLST) development
9.3. Python script to generate output file

This script was run via Jupyter Notebook and structured according to PIRATE pangenome analysis output files structure. There are slight modifications of the script to process output from other pangenome analysis tools (i.e. Panaroo and PEPPAN).

What the script does: Look up modified gff files to find the start and end location of each core gene in the corresponding model genomes. This information allows for comparison with any pangenome analysis and/or genome annotation tools.

 

Output file structure, with example: