Daily Archives: 2026年7月16日

Streamlining TraDIS Analysis: Updating Circos Visualizations and Functional Clustering of Essential Genes in Yersinia (Data_Jiline_Transposon)

1. Draft Email Response

Subject: Re: TraDIS data visualization and essential genes clustering for publication

Hi XXXX,

Great to hear that we are moving forward with the paper! I have updated the analysis and visualization based on your requests.

  1. Updated Circle Plot: I have removed the extracellular bacteria sample (the outer green ring) from the Circos plot. The remaining conditions (intracellular, growthout control, LB culture, and initial mutants) have been re-scaled to evenly fill the plot, making the visualization cleaner and more focused for the publication.
  2. Essential Genes Functional Clustering: I have generated a comprehensive table of all identified essential genes, clustered by their functional categories and pathways (e.g., Translation/Ribosome, DNA Replication & Repair, Cell Envelope, Metabolism, Transport, etc.). This is derived from our reference annotation descriptions.

Attached to this email (or available in the project directory), you will find:

  • The updated circos.conf and generate_circos_input_files.py to generate the new circle plot.
  • The new publication-ready table essential_genes_functional_clustering.xlsx (and .tsv) containing the essential genes, their descriptions, and assigned functional categories.

Please let me know if you would like to adjust any of the functional categories or if you need the data formatted in a specific way for the manuscript’s supplementary materials.

Best regards, YYYY


2. Adapted Step 1: Remove Extracellular Sample from Circle Plot

We need to adjust the circos.conf file to remove its plot block and re-balance the radii of the remaining rings.

Replace the plots section in your circos.conf with the following. The radii (r1 and r0) have been recalculated to evenly distribute the 4 remaining conditions and the essential genes heatmap, filling the space left by the removed outer ring.

#circos -conf circos_4rings.conf

<<include /etc/circos/colors_fonts_patterns.conf>>

karyotype = circos_data/karyotype.microbe.txt

chromosomes_units           = 10000
chromosomes_display_default = yes

<ideogram>
show = yes

<spacing>
default = 0.01r
break   = 0.5r  #8r  # Adds a gap between the first and last position of the single chromosome
</spacing>
radius    = 0.9r
thickness = 25p
fill      = no
stroke_thickness = 2
stroke_color     = black
show_bands = yes
fill_bands = yes
band_transparency = 0
show_label       = yes
label_font       = default
label_radius = 1.05r
label_size       = 75
label_parallel   = yes
orientation      = 100 # Rotate the plot by 90 degrees
</ideogram>

#<<include ticks.conf>>
show_ticks          = yes
show_tick_labels    = yes

show_grid          = no
grid_start         = dims(ideogram,radius_inner)-0.5r
grid_end           = dims(ideogram,radius_inner)

<ticks>
skip_first_label     = yes
skip_last_label      = no
radius               = dims(ideogram,radius_outer)
tick_separation      = 2p
min_label_distance_to_edge = 0p
label_separation = 5p
label_offset     = 5p
label_size = 8p
multiplier = 0.001
color = black

thickness = 3p
size      = 20p

<tick>
size           = 10p
spacing        = 1u
color          = black
show_label     = no
label_size     = 12p
format         = %.2f
grid           = no
grid_color     = lblue
grid_thickness = 1p
</tick>
<tick>
size           = 15p
spacing        = 5u
color          = black
show_label     = yes
label_size     = 16p
format         = %s
grid           = yes
grid_color     = lgrey
grid_thickness = 1p

</tick>
<tick>
size           = 18p
spacing        = 10u
color          = black
show_label     = yes
label_size     = 16p
format         = %s
grid           = yes
grid_color     = grey
grid_thickness = 1p
</tick>
<tick>
spacing        = 100u
color          = black
show_label     = yes
suffix = " kb"
label_size     = 36p
format         = %s
grid           = yes
grid_color     = dgrey
grid_thickness = 1p
</tick>
</ticks>

<image>
<<include /etc/circos/image.conf>>
</image>

<colors>
<<include /etc/circos/colors.conf>>
</colors>

<fonts>
<<include /etc/circos/fonts.conf>>
</fonts>

<plots>
    # -- Scatter plot 1: Intracellular mutants (moved to outermost) --

<plot>
    type       = scatter
    file       = circos_data/intracellular_mutants.txt
    r1         = 0.95r
    r0         = 0.86r
    min        = 0
    max        = 150000
    glyph      = circle
    glyph_size = 5
    color      = dblue

<axes>

<axis>
            spacing   = 50000
            color     = lgrey
        </axis>
    </axes>
    </plot>

    # -- Scatter plot 2: Growthout control --

<plot>
    type       = scatter
    file       = circos_data/growthout_control.txt
    r1         = 0.85r
    r0         = 0.76r
    min        = 0
    max        = 150000
    glyph      = circle
    glyph_size = 5
    color      = dred

<axes>

<axis>
            spacing   = 50000
            color     = lgrey
        </axis>
    </axes>
    </plot>

    # -- Scatter plot 3: LB culture --

<plot>
    type       = scatter
    file       = circos_data/LB_culture.txt
    r1         = 0.75r
    r0         = 0.66r
    min        = 0
    max        = 150000
    glyph      = circle
    glyph_size = 5
    color      = dpurple

<axes>

<axis>
            spacing   = 50000
            color     = lgrey
        </axis>
    </axes>
    </plot>

    # -- Scatter plot 4: Initial mutants --

<plot>
    type       = scatter
    file       = circos_data/initial_mutants.txt
    r1         = 0.65r
    r0         = 0.56r
    min        = 0
    max        = 150000
    glyph      = circle
    glyph_size = 5
    color      = dyellow

<axes>

<axis>
            spacing   = 50000
            color     = lgrey
        </axis>
    </axes>
    </plot>

    # -- Gene Locations: Essential genes heatmap --

<plot>
    type       = heatmap
    file       = circos_data/merged_genome.txt
    r1         = 0.50r
    r0         = 0.47r
    color      = orange
    </plot>
</plots>

<<include /etc/circos/housekeeping.conf>>

3. Adapted Step 2: Functional Clustering of Essential Genes

To provide a table of essential genes clustered by function/pathway, we can leverage the Desc (description) column already present in your initial_mutants_tn5gaps_trimmed.dat file.

Create a new Python script named cluster_essential_genes.py. This script filters for essential genes, applies keyword-based functional categorization (which is highly standard for bacterial genomics publications), and outputs a clean, publication-ready Excel and TSV file.

import pandas as pd

# 1. Load essential genes from tn5gaps output
tn5gaps_file = "initial_mutants_tn5gaps_trimmed.dat"
df_tn5 = pd.read_csv(tn5gaps_file, sep="\t")

# Filter for essential genes only
essential_df = df_tn5[df_tn5["call"] == "Essential"].copy()

# 2. Define a function to categorize genes based on description keywords
def categorize_function(desc):
    if pd.isna(desc):
        return "Unknown / Hypothetical"
    desc_lower = str(desc).lower()

    if any(word in desc_lower for word in ["ribosom", "translation", "rrna", "trna", "aminoacyl"]):
        return "Translation / Ribosome"
    elif any(word in desc_lower for word in ["dna polymerase", "dna replication", "recombination", "repair", "helicase", "topoisomerase", "gyrase", "primase"]):
        return "DNA Replication, Repair & Recombination"
    elif any(word in desc_lower for word in ["rna polymerase", "transcription", "sigma factor"]):
        return "Transcription / RNA"
    elif any(word in desc_lower for word in ["cell wall", "peptidoglycan", "membrane", "envelope", "lipopolysaccharide", "lps", "porin"]):
        return "Cell Envelope & Wall"
    elif any(word in desc_lower for word in ["transport", "abc ", "secretion", "permease", "efflux", "importer", "exporter"]):
        return "Transport & Secretion"
    elif any(word in desc_lower for word in ["metabolism", "biosynthesis", "kinase", "dehydrogenase", "synthase", "reductase", "glycolysis"]):
        return "Metabolism & Biosynthesis"
    elif any(word in desc_lower for word in ["regulator", "transcription factor", "repressor", "activator", "two-component"]):
        return "Gene Regulation"
    elif "hypothetical" in desc_lower or "uncharacterized" in desc_lower:
        return "Hypothetical / Uncharacterized"
    else:
        return "Other / Miscellaneous"

# 3. Apply categorization
essential_df["Functional_Category"] = essential_df["Desc"].apply(categorize_function)

# 4. Select and reorder columns for the final publication table
final_columns = ["Orf", "Name", "Desc", "Functional_Category", "k", "n", "r", "pval", "padj", "call"]
final_df = essential_df[final_columns]

# Sort by Functional_Category for better readability in the paper/supplement
final_df = final_df.sort_values(by=["Functional_Category", "Orf"])

# 5. Save to TSV and Excel
final_df.to_csv("essential_genes_functional_clustering.tsv", sep="\t", index=False)
final_df.to_excel("essential_genes_functional_clustering.xlsx", index=False)

print(f"Successfully processed {len(final_df)} essential genes.")
print("\nCategory distribution:")
print(final_df["Functional_Category"].value_counts().to_string())

How to run it:

python3 cluster_essential_genes.py

(Note: If your lab already has a specific KEGG or COG pathway mapping file for Yersinia enterocolitica WA-314, you can easily replace the categorize_function step with a pd.merge() to join that specific pathway data to the essential_df using the Orf or Name column. However, the keyword-based approach above is robust, immediately runnable, and widely accepted for this type of functional overview in manuscripts).



📝 For the Scientific Manuscript / Paper

  1. “Genome-wide TraDIS Analysis Reveals Core and Conditionally Essential Genes of Yersinia enterocolitica During Intracellular Infection” (Strong, specific, highlights the main finding)
  2. “Transposon Insertion Sequencing Identifies Essential Metabolic and Regulatory Pathways in Yersinia enterocolitica WA-314″ (Focuses on the functional clustering aspect)
  3. “Condition-Dependent Fitness Landscapes of Yersinia enterocolitica Revealed by High-Throughput TraDIS” (Broader, emphasizes the comparative conditions)

📊 For the Updated Figure (Figure 1)

  1. “Figure 1: Genome-wide distribution of transposon insertions and essential gene clusters in Yersinia enterocolitica WA-314 across infection-relevant conditions.”
  2. “Figure 1: Circular genome map highlighting condition-specific transposon insertion densities and localized essential gene regions in Y. enterocolitica.”

💻 For a GitHub Repository, Lab Wiki, or Methods Documentation Post

  1. “Streamlining TraDIS Analysis: Updating Circos Visualizations and Functional Clustering of Essential Genes in Yersinia
  2. “Adapted Tn-Seq Pipeline: Removing Control Conditions and Generating Pathway-Clustered Essential Gene Tables for Publication”
  3. “From Raw Reads to Publication-Ready Figures: An Updated TPP and TRANSIT Workflow for Yersinia TraDIS Data”

📧 For the Email Subject Line (if needed)

  1. “Updated TraDIS Circos Plot & Essential Genes Functional Clustering for Publication”
  2. “Re: Manuscript Figures – Revised Genome Plot and Essential Gene Pathway Table Attached”