Main story: Motivation → Visualization Update → Annotation Strategy → Functional Clustering.
Pipeline Update: Refining TraDIS Visualizations and Functionally Clustering Essential Genes in Non-Model Organisms
Context & Motivation: Following a review of our TraDIS data visualization, we received feedback to make two key updates for our upcoming manuscript:
- Remove the extracellular bacteria sample (green outer ring) from the Circos plot to reduce visual clutter.
- Generate a comprehensive functional clustering table of all identified essential genes (e.g., ribosome-associated, DNA-associated) to replace vague references to “confirmed essential genes” in the methods section.
Below is the adapted pipeline to achieve both goals, specifically tailored for a non-model organism where standard R annotation packages (e.g., org.Hs.eg.db) do not apply. Instead, we derive functional annotations directly from protein sequences using EggNOG-mapper.
Part 1: Updating the Circos Visualization
To remove the extracellular sample, we must adjust the circos.conf file by removing its corresponding plot block and re-balancing the radii (r1 and r0) of the remaining rings. This ensures the 4 remaining conditions and the essential genes heatmap evenly distribute and fill the space left by the removed outer ring.
Action: Replace the plots section in your configuration file and run:
circos -conf circos_4rings.conf
Part 2: Functional Annotation Strategy (EggNOG-mapper)
Since standard organism-specific databases are unavailable, we use EggNOG-mapper to generate robust functional annotations (COG categories, KEGG pathways, GO terms) directly from the protein FASTA sequences.
2A) Environment Setup
mamba create -n eggnog_env python=3.8 eggnog-mapper -c conda-forge -c bioconda # Installs eggnog-mapper 2.1.12
mamba activate eggnog_env
2B) Database Preparation
mkdir -p /home/jhuang/mambaforge/envs/eggnog_env/lib/python3.8/site-packages/data/
download_eggnog_data.py --dbname eggnog.db -y \
--data_dir /home/jhuang/mambaforge/envs/eggnog_env/lib/python3.8/site-packages/data/
2C) Input Preparation & Execution
(Note: Step 2C.1 is optional and used primarily for RNA-seq integration baseline, but good practice for header standardization).
1. Clean Reference FASTA Headers (Optional):
mv ~/Downloads/sequence\(12\).txt CP009367_protein_.fasta
python ~/Scripts/update_fasta_header.py CP009367_protein_.fasta CP009367_protein.fasta
- Input: Downloaded GenBank protein FASTA (
CP009367_protein_.fasta) - Output: Cleaned FASTA headers (
CP009367_protein.fasta)
2. Run EggNOG-mapper:
emapper.py -i CP009367_protein.fasta -o eggnog_out --cpu 60
# Add --resume if the process was interrupted
- Output:
eggnog_out.emapper.annotations(Contains all functional mappings for downstream clustering).
Part 3: Essential Gene Functional Clustering & Reporting
To answer the request for a table showing all essential genes and their involved pathways, we cross-reference the TraDIS essentiality calls with the EggNOG annotations using a custom Python profiler.
3A) Execute the Clustering Pipeline
Run the adapted profiling script, which strictly filters for genes marked as "Essential" in the final column of the Tn5Gaps.xls sheets, maps them to their COG categories, and generates both summary statistics and manuscript-ready tables.
cd /mnt/md1/DATA/Data_Jiline_Transposon/
./tn5_essential_cog_profiler.py
3B) Finalize the Manuscript Excel Output
The script generates Tn5_Essential_COG_Summary.xlsx. Before sharing with collaborators or inserting into the manuscript supplementary materials, perform these final cleanup steps in Excel:
- Rename the primary sheet: Change the name of the main detailed sheet to
Essential_Genes_Functional_Groups. - Clean up the Summary sheet: In the final summary tab, delete the
UnassignedandR+S_Percentcolumns to keep the focus strictly on the assigned functional distributions.
Final Deliverables:
- Updated Circos plots (
.png/.svg) with 4 rings. Tn5_Essential_COG_Summary.xlsxcontaining the complete, filtered table of essential genes mapped to their specific COG letters and broader functional groups (Information Storage, Cellular Processes, Metabolism, etc.).




