Flanker: a tool for comparative genomics of gene flanking regions

William Matlock, Samuel Lipworth, Bede Constantinides, Timothy E.A. Peto, A. Sarah Walker, Derrick Crook, Susan Hopkins, Liam P. Shaw, Nicole Stoesser

Research output: Contribution to journalArticlepeer-review


Analysing the flanking sequences surrounding genes of interest is often highly relevant to understanding the role of mobile genetic elements (MGEs) in horizontal gene transfer, particular for antimicrobial-resistance genes. Here, we present Flanker, a Python package that performs alignment-free clustering of gene flanking sequences in a consistent format, allowing investigation of MGEs without prior knowledge of their structure. These clusters, known as 'flank patterns' (FPs), are based on Mash distances, allowing for easy comparison of similarity across sequences. Additionally, Flanker can be flexibly parameterized to fine-tune outputs by characterizing upstream and downstream regions separately, and investigating variable lengths of flanking sequence. We apply Flanker to two recent datasets describing plasmid-associated carriage of important carbapenemase genes (blaOXA-48 and blaKPC-2/3) and show that it successfully identifies distinct clusters of FPs, including both known and previously uncharacterized structural variants. For example, Flanker identified four Tn4401 profiles that could not be sufficiently characterized using TETyper or MobileElementFinder, demonstrating the utility of Flanker for flanking-gene characterization. Similarly, using a large (n=226) European isolate dataset, we confirm findings from a previous smaller study demonstrating association between Tn1999.2 and blaOXA-48 upregulation and demonstrate 17 FPs (compared to the 5 previously identified). More generally, the demonstration in this study that FPs are associated with geographical regions and antibiotic-susceptibility phenotypes suggests that they may be useful as epidemiological markers. Flanker is freely available under an MIT license at https://github.com/wtmatlock/flanker.

Original languageEnglish
Article number000634
Number of pages8
JournalMicrobial Genomics
Issue number9
Publication statusPublished - 1 Sep 2021


  • antimicrobial resistance (AMR)
  • bioinformatics
  • mobile genetic element (MGE)
  • plasmid
  • whole-genome sequencing


Dive into the research topics of 'Flanker: a tool for comparative genomics of gene flanking regions'. Together they form a unique fingerprint.

Cite this