

This is the second of two posts on HBV analysis from NGS data. The first post covers the biology of the genome and the path from raw reads to a consensus and a tree. This post walks through each number in a public dataset: coverage, N, variants, phylogeny and a recombination signal. The aim is to separate observations from hypotheses and to state what the data cannot support.
The code, summary tables and reference results are in vieomics/solutions.
The example uses five samples from NCBI BioProject PRJNA659786 — three genotype A and two genotype D, all from Brazil — and ten complete GenBank genomes. The five samples are the genotype A and D runs with the largest read counts, not a random sample. The reference panel is also deliberate: one Brazilian A2, three D genomes (including the RefSeq), two B and two C from Vietnam/Cambodia, and one E and one F as outgroups.
| Sample | Genotype | Mapped (Bowtie2) | Mean depth | Breadth ≥10× | N |
|---|---|---|---|---|---|
| B215/2014 | A | 84.3% | 40,310× | 99.5% | 0.5% |
| B3392/2014 | A | 76.8% | 24,431× | 99.5% | 0.5% |
| B575/2014 | A | 71.2% | 24,944× | 65.1% | 34.9% |
| B2719/2015 | D | 99.6% | 48,467× | 100.0% | 0.0% |
| B364/2014 | D | 99.2% | 44,223× | 83.1% | 16.9% |
Five samples and ten references are enough to check the workflow, compare genotype placement and describe some genome features. They are not enough to infer global distribution, geographic origin, transmission chains or treatment response. The public panel is not a representative sample of global HBV diversity.
Mean depth in this dataset is very high — 24,431× to 48,467× — because the genome is only about 3.2 kb and each sample has hundreds of thousands to millions of reads. High mean depth does not mean every position is evenly covered. The more useful metric is breadth: the fraction of positions reaching a minimum depth, here 10×.
Figure 1 — Coverage along the HBV genome. The y-axis is depth (log scale); red marks positions below 10×. B215/2014 and B3392/2014 are nearly complete; B575/2014 and B364/2014 have clear low-coverage blocks. The figure was produced by the workflow in the technical repository.
Two samples are incomplete:
N. The low-coverage block runs from about 1,285 to 2,376, plus a short run around 2,856–2,872.N, with a low-coverage block from about 1,285 to 1,821.Even B215/2014 and B3392/2014, at about 99.5% breadth ≥10×, carry a short 16–17 bp N run around 2,856–2,872. That detail is easy to miss if you only look at mean depth.
A note on the source: the table uses the Bowtie2 mapping from the viralrecon run. The technical repository also contains an independent BWA mapping for validation; its depth and breadth differ. When reporting, choose one source and state it instead of mixing numbers from two pipelines.
N is not a gapThe consensus in this example is reference-guided and keeps the 3,182 bp NC_003977.2 frame. Positions below 10× or with no covering read are written as N; indels are not applied. Therefore, N does not mean the virus lost the base, and consensus length is not assembly length.
Deletions relative to the closest reference are reported separately. This dataset has six candidates, all in-frame:
| Sample | Position | Length | Type |
|---|---|---|---|
| B215/2014 | 2,356 | 6 bp | in-frame deletion |
| B215/2014 | 2,854 | 33 bp | in-frame deletion |
| B3392/2014 | 2,356 | 6 bp | in-frame deletion |
| B3392/2014 | 2,854 | 33 bp | in-frame deletion |
| B575/2014 | 1,285 | 6 bp | in-frame deletion |
| B575/2014 | 2,854 | 33 bp | in-frame deletion |
These deletions are not drawn as gaps in the consensus. The 33 bp deletion at 2,854 overlaps the low-coverage run around 2,856–2,872, but the two concepts are not the same: N is a position without enough evidence in the reference frame; a deletion is a structural difference from the closest reference. Confirming a deletion needs read-level evidence, targeted PCR or long reads; a short-read consensus alone is not enough.
The VCF against the mapping reference NC_003977.2 contains 1,942 SNP positions: 660 in B215/2014, 571 in B3392/2014, 481 in B575/2014, 123 in B2719/2015 and 107 in B364/2014. The VCF contains no indels. For the genotype A samples, most of those 660–571 differences are genotype-defining differences from the D reference, not mutations that arose within the sample.
The second table therefore compares each consensus with the closest public genome — KJ854710.1 for the A samples (94.9–95.5% identity) and NC_003977.2 for the D samples (98.3–98.5%). This gives 633 region-annotated nucleotide rows, corresponding to 473 unique positions, and 593 amino-acid rows. The row count is larger than the position count because the ORFs overlap: one nucleotide in the S region can also sit in the P frame and is annotated twice.
Figure 2 — Variants by ORF (left), SNP/indel class (centre) and density along the genome (right). The per-region bars sum to more than 1,942 because one position can fall in several ORFs. These are counts, not a mutation rate.
The three numbers — 1,942, 633 and 473 — answer three different questions. 1,942 is the number of positions that differ from the mapping reference; 633 is the number of rows after region annotation; 473 is the number of unique positions after merging overlapping ORFs. Do not use any of them as “the number of mutations” without stating the reference and the counting rule.
No variant in this analysis is labelled drug resistant or immune escape. A clinical HBV variant database was not queried; the synonymous/nonsynonymous/stop labels describe the effect on a reading frame, not a functional conclusion.
The tree was built from the 15-sequence alignment (5 consensus + 10 references) with IQ-TREE 2, model TVM+F+I+G4, 1,000 UFBoot and 1,000 SH-aLRT. The alignment has 3,221 columns, 845 variable sites, 535 parsimony-informative sites and 39 gap-rich columns.
Figure 3 — Maximum-likelihood tree of 15 HBV sequences. Internal labels are SH-aLRT/UFBoot. The three genotype A samples fall in the A clade with KJ854710.1 (100/100); the two D samples fall in the D clade, but the D pair has only 28.5/61 support. The figure was produced by the workflow in the technical repository.
The main observations:
Such a tree is a hypothesis about relationships. It does not say who infected whom, when infection occurred, or where the virus came from. With two incomplete genomes and gap-rich regions, the uncertainty on some branches is substantial; low support should be reported, not dropped.
PhiPack was run on the 15-sequence alignment to screen for recombination. The output in the repository comes from the earlier alignment version (533 informative sites; the current alignment has 535). The permutation tests for PHI and NSS are below the 1,000-permutation resolution (p < 0.001); Max χ² gives p = 0.028. The best breakpoint reported by Max χ² is between NC_003977.2 and B364/2014, both genotype D.
This is a statistical signal, not evidence of a specific recombination event. There are at least three reasons for caution:
N and B364/2014 is 16.9% N; missing data can inflate recombination statistics.A reasonable conclusion is: the dataset contains a signal worth following up, not a resolved breakpoint. A stronger check would run the test within one genotype, mask the gap-rich blocks, use a recombination-aware model and confirm with long reads or cloned sequences.
N runs.N is not a gap; indels may not be applied.N, not only mean depth. High depth can hide low-coverage regions.The full analysis can be reproduced on the Omicslab platform. The upstream nf-core/viralrecon step runs as an analysis job; the alignment, phylogeny and variant annotation steps run in a version-pinned pixi environment. Public inputs, reference results and manifests are in the vieomics/solutions repository; the workspace can be reopened to inspect the data and results.
If you want to apply it to your own data, start with the analysis guide, then keep the quality-control, circular-mapping and coverage-reporting checks.
nf-core/viralrecon: doi:10.5281/zenodo.3901628. MAFFT: doi:10.1093/molbev/mst010. IQ-TREE 2: doi:10.1093/molbev/msaa015. PhiPack: doi:10.1093/molbev/msj092.

