Zubair Khalid

Virologist/Molecular Biologist | Veterinarian | Bioinformatician

Conventional & Molecular Virology • Vaccine Development • Computational Biology

Dr. Zubair Khalid is a veterinarian and virologist specializing in conventional and molecular virology, vaccine development, and computational biology. Dedicated to advancing animal health through innovative research and multi-omics approaches.

Dr. Zubair Khalid - Veterinarian, Virologist, and Vaccine Development Researcher specializing in Computational Biology, Multi-omics, Animal Health, and Infectious Disease Research

Category: Guides

Assembly Graph Visualization

Assembly graph visualization gives you a literal picture of how your genome assembly fits together. It shows the connections between assembled sequences (contigs) and reveals repeats, misjoins, and coverage gaps that summary statistics like N50 miss. This guide is for bioinformaticians, genome scientists, and advanced students who have assembled a genome and now need to assess its structural integrity. We will focus on de Bruijn graph,based assemblies, which are the standard for short-read data NCBI Bookshelf.

Visual inspection of an assembly graph is not a substitute for rigorous quality metrics, but it is a uniquely powerful diagnostic. It can expose problems that are invisible from contig lengths or read-mapping rates. By the end of this guide you will know how to read a graph, choose the right tool, and avoid common interpretive traps EMBL-EBI Training.

At a Glance

Aspect Details
Definition Graphical representation of overlapping sequences (nodes) and their connections (edges) in a genome assembly
Key Concepts Nodes (contigs or unitigs), edges (overlaps or adjacency), coverage depth, branching repeats
Common Tools Bandage (GUI), IGV (for mapped reads), gfaStats, custom scripts in Bioconductor
Main Use Cases Detecting repeats, spotting misassemblies, evaluating genome completeness, resolving haplotypes
Frequent Pitfalls Overinterpreting simple linear graphs, ignoring coverage variation, using default layouts without pruning

Core Concepts of Assembly Graph

An assembly graph, usually stored in GFA format (Graphical Fragment Assembly), represents sequences as nodes and their overlaps as edges. In a de Bruijn graph for a haploid genome, a clean assembly shows a linear path: node A connects to node B, then to node C. Repeats create forks: one node connects to two different downstream nodes, each corresponding to different genomic contexts. The depth of coverage on a node indicates its copy number in the original genome. Low coverage may indicate contamination or an assembly error, while very high coverage marks a multicopy repeat Galaxy Training Network.

The graph also stores read depth per node. This information is critical because a single node with twice the average coverage often represents a repeat that collapsed during assembly, while a node with half coverage might come from a heterozygous region in a diploid sample. Visualization tools like Bandage color nodes by coverage, letting you spot these patterns instantly.

Decision Criteria for Choosing a Visualization Approach

Not every assembly requires a full graph inspection. Ask these questions before you invest time.

  • Assembly size: Small bacterial genomes (below 10 Mb) can be viewed with Bandage at default settings. Larger eukaryotic genomes (gigabases) produce graphs with millions of nodes that crash most GUI tools. For large assemblies, consider using GFA statistics, simplified subgraphs of high coverage repeats, or the Bioconductor package aplot for custom plotting Bioconductor.
  • Purpose: If you need to verify that your assembly is mostly linear and contains no obvious chimeras, a quick Bandage glance suffices. If you are improving the assembly manually, you need interactive browsing and the ability to blast connecting sequences.
  • Read type: Long reads produce a different graph structure (overlap graph) with far fewer nodes. Visualization tools for long-read assemblies (e.g., those generated by Flye) are available, but the same principles apply. The NCBI Sequence Read Archive stores raw reads that can be remapped to validate graph branches NCBI Sequence Read Archive.
  • Ploidy: Haploid or highly inbred samples produce simpler graphs. Diploid or polyploid assemblies show many bubbles where two allelic paths diverge and converge. Choose a viewer that can hide or color small bubbles to focus on larger structural variants.

Practical Workflow for Assembly Graph Visualization

Follow these steps to generate and interpret an assembly graph.

Step 1: Assemble your reads and produce a GFA file. Most modern assemblers (SPAdes, MEGAHIT, Flye) emit a GFA1 or GFA2 file by default. If you have only a FASTA file, you can convert it to a layout graph using tools like gfa_from_fasta or custom scripts in Bioconductor. Using the Galaxy Training Network, you can run a complete assembly pipeline and download the GFA output Galaxy Training Network.

Step 2: Open the GFA file in Bandage. Bandage is the most widely used interactive graph viewer. It loads the graph, then lets you set a minimum node length (e.g., 200 bp for bacteria, 1000 bp for eukaryotes) to reduce clutter. Apply a coverage filter to hide nodes with very low depth (possible contaminants) or very high depth (repeats that are not helpful for scaffolding). Choose a layout algorithm, the default is often fine for small graphs.

Step 3: Identify the main linear path. In a prokaryotic assembly, the entire chromosome often forms a single long path or a few large paths. If you see many small disconnected components, the assembly is fragmented. Use the “BLAST search” feature in Bandage to check if a known marker gene (e.g., a 16S rRNA) is present on a high-coverage node. This confirms that the graph includes the expected genome content.

Step 4: Inspect branch points. A branch node (one node connects to two or more others) may indicate a repeat, a misassembly, or a true variant. Click on each branch and note the coverage. If the branches have nearly equal coverage and similar length, they likely represent allelic variation. If one branch has a coverage spike, it may be a collapsed repeat. Use the “Subgraph” tool to extract a region and BLAST it against a reference database. The EMBL-EBI Training resources provide excellent tutorials on BLAST integration with Bandage EMBL-EBI Training.

Step 5: Validate with read mapping. Export the sequences from a suspicious region and map the original reads back. Mismapping patterns, such as soft-clipped ends or uneven coverage, confirm a misassembly. The PipeSeq pipeline for RNA-seq shows how read mapping can validate graph-supported transcripts [https://pubmed.ncbi.nlm.nih.gov/42111799/]. For somatic variant calling, the Lancet2 method uses joint multi-sample local assembly graphs to refine calls, underscoring the value of graphs for validation [https://pubmed.ncbi.nlm.nih.gov/41972010/].

Quality Checks and Validation

Use the graph to perform several objective checks.

  • Node consistency: The top 20 nodes by coverage should have values within a narrow range (e.g., 20,30x). A node with 10x coverage in a 25x assembly suggests a heterozygous deletion or a collapsed region. A node with 60x in a 25x assembly is almost certainly a repeat.
  • Graph connectivity: For a complete bacterial genome, the graph should contain one or a few large connected components. Hundreds of small components usually indicate contamination or very low coverage. The NCBI Bookshelf chapter on genome assembly covers how to interpret component size distributions NCBI Bookshelf.
  • Bubble analysis: Bubbles (two parallel paths that connect at both ends) are common in diploid assemblies. Count the number of bubbles per megabase, an unusually high number may signal a chimeric assembly or strain variation.
  • Circularity: For circular genomes, look for a path that ends near its own start. Bandage can highlight cycles. If the graph contains a long, unbranched path that forms a circle, the assembly likely represents a complete replicon. If not, the chromosome may be incomplete.

Common Mistakes

  • Overinterpreting every branch as a repeat. Many branches are artifacts of low coverage or sequencing errors. Always check coverage depth before concluding that a branch is biologically real. A node with coverage far below the genome average is suspect.
  • Ignoring the layout algorithm. Bandage’s default layout pushes long nodes to the edge of the screen. Short nodes crowd the center. This can give a false impression of fragmentation. Try the “ForceDirected” layout or manually freeze a node to rearrange the graph.
  • Using only one tool. Bandage is excellent but cannot handle huge graphs. For large eukaryotic genomes, use GFA statistical summaries (e.g., gfa_stats.py) or visualize only a subgraph around a region of interest. Bioconductor offers the gfa package for programmatic analysis Bioconductor.
  • Confusing graph structure with contiguity. A nicely connected graph may still contain misjoins. The graph shows adjacency, not correctness. You must validate with read pairs or long reads. Validation pipelines that integrate AI assistance for clinical NGS workflows highlight the need for human-in-the-loop verification even after automated graph analysis [https://pubmed.ncbi.nlm.nih.gov/41921369/].
  • Failing to update the graph after polishing. If you correct the assembly using read mapping or long reads, regenerate the graph. Old graphs mislead.

Limits of Interpretation

Assembly graph visualization has clear boundaries.

  • Scalability: Interactive graph browsers cannot handle the millions of nodes found in large eukaryotic assemblies without heavy filtering. Even filtered graphs may lag. For such projects, rely on statistical graph descriptors rather than visual inspection.
  • Resolution: A node may be hundreds of kilobases long. The graph cannot show base-level detail. You will see the overall connectivity but miss small insertions or deletions. Use per-base quality metrics and read mapping to catch those micro-scale errors.
  • Graph ambiguity: In a repeat-rich region, the graph may become an indecipherable tangle. The human eye cannot distinguish true from false connections in a dense “hairball.” At this point, alternative approaches like long-read scaffolding or optical mapping are more trustworthy.
  • No universal correctness: A graph that looks “clean” can still contain subtle misassemblies, such as a rearrangement that does not change connectivity. You must combine graph visualization with other validation methods. The NCBI Bookshelf guide to genome annotation stresses that assembly quality is multidimensional NCBI Bookshelf.

Frequently Asked Questions

What does a branching node in an assembly graph mean?
A branch suggests that the sequence in that node is present in two different genomic contexts. This often indicates a repeat, but it can also be a true haplotype difference or a chimeric junction. Always check the coverage on the outgoing nodes. Nodes with coverage near the average are likely real, nodes with very low coverage may be errors.

How can I tell if a graph region is a collapsed repeat?
Collapsed repeats appear as a single node with coverage markedly higher (often double or triple) than the average genome coverage. The graph may show no alternative branch because the assembler merged identical repeats. To confirm, remap reads and look for a sharp coverage peak across that node.

Is visualization enough to guarantee a correct assembly?
No. Visualization is a screening tool, not a certification. Many errors, especially inversions or translocations that preserve connectivity, are invisible in the graph. You still need read-pair analysis, long-read alignments, and reference-based validation when possible.

Which tool should I use for a mammalian genome graph?
For a mammalian genome, try the command-line tool BandageNG or the R package gfa in Bioconductor. GUI clients are impractical unless you filter heavily (minimum node length 10 kb, remove low-coverage nodes). Alternatively, focus on specific chromosomes by extracting subgraphs from the GFA file.

References and Further Reading

Related Articles