# Klebsiella LIN Codes

## About

### Introduction

LIN (Life Identification Number) codes are a system developed by [Vinatzer *et al* (2020)](https://academic.oup.com/nar/article/48/W1/W529/5813796?login=false) for creating stable nomenclatures for taxonomic trees. It has been applied to the *Klebsiella pneumoniae* complex though clustering of their core genome MLST profiles, providing a mechanism for identifying and referencing *Kpn* complex lineages ([Hennart et al, 2022](http://dx.doi.org/10.1093/molbev/msac135)). The resulting reference database of [core genome MLST (cgMLST)](https://cgps.gitbook.io/pathogenwatch/technical-descriptions/typing-methods/cgmlst) profiles and associated LIN codes are maintained and provided via the BigsDB resource at the [Pasteur institute](https://bigsdb.pasteur.fr/api/db/pubmlst_klebsiella_seqdef). These are imported into Pathogenwatch, and compared against query genome cgMLST profiles. Depending on the level of similarity between the query and closest reference, a partial or complete LIN code is inferred and the "Clonal group" and "Sublineage" assignments highlighted.

{% hint style="info" %}
For specific information about the Klebsiella LIN code scheme, please visit the Pasteur Institute's reference documentation: <https://bigsdb.pasteur.fr/klebsiella/cgmlst-lincodes/>
{% endhint %}

## Lineage annotations

### LIN code

The LIN code is a hierarchical code consisting of 10 levels, with each level indicating a division of the previous level. So the topmost level is the most general and approximates to the species level within the *Klebsiella pneumoniae* complex. The bottom level indicates genomes that have identical core genomes, providing a fine-grained view of the population.

LIN codes inferred by Pathogenwatch will always be incomplete for novel core genome profiles. These have a placeholder cgST assigned consisting of a unique combination of letters and numbers. In the genome report the first four characters are shown prepended by an asterisk to indicate it is a novel cgST. Novel cgSTs will be replaced with standard numeric codes when a representative profile is made available.

To infer the LIN code for a novel cgST, the [similarity metric](#similarity-calculation) is used to identify the maximum level of similarity according to the thresholds show in the [table below](#inferring-the-lineage-codes). The code is then inferred up to this level, while subsequent levels are marked with "\*".

### Sublineage and clonal group

The sublineage and clonal group assignments are based on the third and fourth levels of the LIN code respectively, and they represent the deepest branches in the Kpn complex lineages. The sublineage and clonal group names are based on the dominant MLST within that group and provide a stable naming scheme that is more coherent than MLST by itself.

<figure><img src="https://321039241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LB6jV5PGtOeTCAE8S8I%2Fuploads%2FP1GJVyhVJ63q4vvhVMIY%2Fimage.png?alt=media&#x26;token=c56d7fbd-0ca7-4d66-8374-992bef89d91f" alt=""><figcaption><p>Classification of the cgMLST profile of a novel cgST, as displayed in the <a href="../../../how-to-use-pathogenwatch/genome-reports#genome-reports">Genome Report</a></p></figcaption></figure>

## Method

### Software components:

1. A library of cgMLST profiles with linked cgST codes, LIN codes, clonal groups codes, and sublineage codes.
2. A tool that takes a cgMLST profile as input, and finds the nearest neighbour(s) according to the distance calculation described. It then infers a LIN code, as well as the sublineage and clonal groups according to the similarity of the best match.

### Similarity calculation

For each profile the allele code at each locus is compared, and the similarity between two profiles is calculated as a percentage using the following formula:

> ( Number of identical loci ) / ( Total loci \[629] - Missing loci )

Note: There are 629 loci in the Kpn cgMLST scheme. If 30 or more loci are missing between the two profiles then the score is invalid and not reported.

{% hint style="info" %}
It is possible for more than one reference profile to be equidistant to the query profile. In this case all the nearest cgST codes are reported. This has no impact on the inferred LIN code.
{% endhint %}

### Inferring the lineage codes

The calculated similarity above is used to identify the similarity level, from 1-10. The thresholds are shown in the table below. The query profile's LIN code is inferred up to one level below the assigned bin. So an assignment to bin 10 (1 allele different) will result in a 9 part LIN code with a single asterisk at the end.

<table><thead><tr><th>Level</th><th width="125">Similarity Threshold</th><th>Identity*</th></tr></thead><tbody><tr><td>1</td><td>&#x3C;3.0207</td><td>&#x3C;19</td></tr><tr><td>2</td><td>&#x3C;6.9952</td><td>&#x3C;44</td></tr><tr><td>3 (Sublineage)</td><td>&#x3C;69.7933</td><td>&#x3C;439</td></tr><tr><td>4 (Clonal group)</td><td>&#x3C;93.1638</td><td>&#x3C;586</td></tr><tr><td>5</td><td>&#x3C;98.4102</td><td>&#x3C;619</td></tr><tr><td>6</td><td>&#x3C;98.8871</td><td>&#x3C;622</td></tr><tr><td>7</td><td>&#x3C;99.3641</td><td>&#x3C;625</td></tr><tr><td>8</td><td>&#x3C;99.6820</td><td>&#x3C;627</td></tr><tr><td>9</td><td>&#x3C;99.8410</td><td>&#x3C;628</td></tr><tr><td>10</td><td>&#x3C;100</td><td>&#x3C;629</td></tr></tbody></table>

**Notes:**\
\* This is the equivalent identity between the two profiles if they both have an allele assigned to every locus. There's a total of 629 loci in the *Klebsiella pneumoniae* complex cgMLST scheme.

{% hint style="warning" %}
If the similarity score is in bin 1, then no part of the LIN code will be inferred. This is also likely to indicate an issue with the assembly or, potentially, an issue with speciation.
{% endhint %}

## How to cite

If you make use of the lineage assignments from this tool, please cite the foundational work by [**Hennart&#x20;*****et al*****&#x20;(2022)**](https://academic.oup.com/mbe/article/39/7/msac135/6608353) A Dual Barcoding Approach to Bacterial Strain Nomenclature: Genomic Taxonomy of *Klebsiella pneumoniae* Strains *Molecular Biology and Evolution* 39:7
