# Fundamentals of Viromics {#sec-fundamentals}
Viromics uses sequencing and bioinformatics to study the **virome** — the viral community associated with a sample or environment. If a microbial sample is a city, then:
- **virology** studies one resident in detail (how a single virus infects and replicates);
- **metagenomics** surveys every resident's genetic material at once; and
- **viromics** focuses on the viral population — who the viruses are, what they can do, and which hosts they interact with.
That shift in focus changes almost everything downstream, from how you prepare a library to how you decide a contig is really viral.
::: {.chapter-goals}
**Learning objectives** — by the end of this chapter you will be able to:
- distinguish viromics from classical virology and general metagenomics;
- compare the major viral genome types and Baltimore groups;
- explain why viral genomes require different bioinformatics strategies from bacterial genomes;
- read the sequence signals that separate lytic infection from temperate lifestyles; and
- use Linux commands to filter and summarize a tab-separated dataset.
:::
::: {.callout-important}
## A virome is an operational measurement
No sequencing protocol captures every virus equally well. The observed virome depends on sampling, particle enrichment, nucleic-acid extraction, DNA or RNA selection, library preparation, sequencing depth, and the analysis workflow. A reported virome is therefore the viral community **detected under a particular protocol**, not a complete inventory of every virus present.
:::
## Viromics, virology, and metagenomics
| Field | Main question | Typical data | City analogy |
|---|---|---|---|
| Virology | How does a virus infect, replicate, and affect its host? | isolates, cultures, PCR assays, microscopy | one resident, studied closely |
| Metagenomics | What genetic material is present in a community? | total-community DNA or RNA | every resident at once |
| Viromics | Which viruses and viral functions are represented in a community? | virus-enriched data or viral sequences from metagenomes | the viral population |
Unlike bacteria and archaea, viruses do not share a universal marker gene comparable to 16S rRNA. Viral sequence identification therefore combines several imperfect signals: viral hallmark genes, similarity to reference sequences, gene density and orientation, sequence composition, genome architecture, read coverage, and host-association evidence [@minot2011humanvirome]. No single signal is sufficient in every case, especially for short contigs and highly novel viruses.
## Viral genome types
Viral genomes may consist of DNA or RNA and may be single- or double-stranded. They can also be linear or circular, and segmented or non-segmented. These properties affect library preparation, assembly, annotation, and the databases used for classification.
| Genome type | Meaning | Example |
|---|---|---|
| dsDNA | double-stranded DNA | many bacteriophages |
| ssDNA | single-stranded DNA | microviruses |
| dsRNA | double-stranded RNA | reoviruses |
| +ssRNA | positive-sense RNA | coronaviruses |
| -ssRNA | negative-sense RNA | influenza viruses |
| +ssRNA-RT | positive-sense RNA with reverse transcription | retroviruses |
| dsDNA-RT | double-stranded DNA with reverse transcription | hepadnaviruses |
## Virus genomes versus bacterial genomes
Many viral genomes are compact and encode functions that help the virus enter a host, replicate, assemble particles, evade host defenses, and spread. Bacterial genomes are generally larger and encode the systems needed to maintain a cellular organism, including translation, energy generation, membrane transport, and stress responses. These are useful trends rather than universal rules: giant viruses can have large genomes, and some viruses carry auxiliary metabolic genes that redirect host metabolism during infection.
| Feature | Viral genome | Bacterial genome | Example |
|---|---|---|---|
| Typical genome size | a few kb to hundreds of kb, with exceptions above 1 Mb | hundreds of kb to several Mb | SARS-CoV-2 is about 30 kb; *E. coli* K-12 is about 4.6 Mb |
| Nucleic acid type | DNA or RNA | DNA | influenza has RNA, T4 phage has dsDNA |
| Strandedness | single or double stranded | typically double stranded | ssDNA phages exist, bacteria are generally dsDNA |
| Shape | linear, circular, segmented, non-segmented | usually circular chromosome, sometimes multiple replicons | hepatitis B partially dsDNA, *Vibrio* has two chromosomes |
| Gene density | very high | moderate | viral genomes often have overlapping genes |
| Ribosomes | absent | present in the cell | viruses use host ribosomes |
| Metabolic capacity | none independent; some encode metabolic genes | extensive cellular metabolism | viruses redirect host resources |
| Reproduction | depends on a host cell | growth followed by cell division | phages replicate only in suitable hosts |
### Genome structure examples
- **T4 bacteriophage**: a tailed bacteriophage with a linear dsDNA genome.
- **PhiX174**: a bacteriophage with a small, circular ssDNA genome; also widely used as an Illumina sequencing control.
- **SARS-CoV-2**: positive-sense ssRNA, about 30 kb, one of the largest RNA virus genomes.
- **Influenza A virus**: negative-sense ssRNA with a segmented genome.
- ***Escherichia coli***: a bacterium with a circular chromosome and thousands of genes that support cellular life.
{#fig-virus-structure fig-alt="Simplified virus structure with genome, capsid, and envelope"}
{#fig-prokaryote fig-alt="Typical prokaryotic cell"}
These differences explain why viral genome interpretation often emphasizes hallmark genes, genome architecture, terminal repeats, coverage patterns, and host association. Bacterial genome interpretation can additionally draw on broadly conserved genes, metabolic pathways, and taxonomic markers. The Baltimore classification complements sequence-based taxonomy by organizing viruses according to how they produce mRNA [@baltimore1971expression].
## Baltimore classification
The Baltimore system asks a practical question: **how does the virus produce positive-sense mRNA that host ribosomes can translate?** The answer highlights which polymerases or reverse-transcription steps are required during infection.
::: {.callout-tip}
## A cooking analogy for Baltimore groups
Think of mRNA as a recipe the host ribosome can cook from directly:
- **+ssRNA (IV)** arrives as a ready-to-use recipe — translate immediately.
- **-ssRNA (V)** arrives written backwards; a viral polymerase must first rewrite it forwards.
- **dsRNA (III)** comes as a sealed double recipe; a viral polymerase transcribes a usable copy.
- **dsDNA (I)** brings a whole cookbook that host machinery transcribes.
- **ssDNA (II)** is half a cookbook that is first completed into dsDNA.
- **Retroviruses (VI)** carry an RNA recipe they reverse-transcribe into a DNA cookbook first.
- **dsDNA-RT (VII)** keep a DNA cookbook but copy it through an RNA intermediate.
:::
| Group | Genome | Route to mRNA |
|---|---|---|
| I | dsDNA | dsDNA is transcribed into mRNA |
| II | ssDNA | ssDNA is converted to dsDNA, then transcribed |
| III | dsRNA | viral RNA-dependent RNA polymerase produces mRNA |
| IV | +ssRNA | the genome can function directly as mRNA |
| V | -ssRNA | viral RNA-dependent RNA polymerase produces +mRNA |
| VI | +ssRNA-RT | RNA is reverse-transcribed into DNA, then transcribed |
| VII | dsDNA-RT | repaired dsDNA is transcribed; an RNA intermediate is reverse-transcribed during replication |
::: {.callout-note}
## Classification systems answer different questions
Baltimore groups describe the route to mRNA; they are not taxonomic ranks. Formal virus taxonomy instead organizes viruses into realms, kingdoms, phyla, classes, orders, families, genera, and species. Two viruses can share a Baltimore group without being close evolutionary relatives.
:::
## Lytic and lysogenic lifestyles
During a **lytic** infection, a phage replicates, assembles new particles, and releases progeny — often by lysing the host cell. A **temperate** phage can instead enter **lysogeny**, in which its genome persists as a **prophage** integrated into the host chromosome or maintained as an extrachromosomal element. Stress or other signals may induce the prophage to resume productive infection [@roux2015virsorter].
```{mermaid}
flowchart TD
A[Phage contacts host cell] --> B{Lifestyle}
B --> C[Lytic cycle]
C --> D[Genome replication]
D --> E[Capsid assembly]
E --> F[Cell lysis and release]
B --> G[Lysogenic state]
G --> H[Prophage persists in or alongside host genome]
H --> I[Host replication]
I --> J[Induction can return to lytic cycle]
```
{#fig-lytic-lysogenic fig-alt="Lytic and lysogenic cycle"}
Why does this matter for bioinformatics? Because each lifestyle leaves different fingerprints in your data:
| Lifestyle | Expected sequence signals |
|---|---|
| **Lytic / free particles** | free viral genomes assembling as separate contigs, circular or complete genomes, high read coverage, hallmark genes such as capsid, terminase, portal, and polymerase |
| **Lysogenic / prophage** | viral regions flanked by host DNA, integrase or recombinase genes, attachment (*att*) sites, mixed host–virus signals on one contig |
Recognizing these signals explains why prophages can appear *inside* bacterial contigs and why tools such as CheckV trim host flanks from proviruses.
## Viromes across environments
| Environment | Typical viral signals | Bioinformatics challenge |
|---|---|---|
| Human gut | bacteriophages, eukaryotic viruses | high inter-individual variation |
| Soil | phages, plant viruses, fungal viruses | inhibitors and very high diversity |
| Marine | marine phages | huge diversity and novelty |
| Wastewater | mixed human, animal, bacterial viruses | mixed sources and contamination |
| Plant | plant RNA viruses, phages, mycoviruses | host RNA or DNA background |
| Animal | wildlife and livestock viruses | zoonotic surveillance context |
Phages are not passive passengers. They drive microbial mortality, nutrient cycling, and horizontal gene transfer, and in the human body they form distinct sub-viromes of the gut, oral cavity, skin, and respiratory tract.
## Why viral dark matter matters
Many viral sequences have no close match in current reference databases — a knowledge gap often called **viral dark matter**. Reference-only searches therefore miss or weakly classify many viral contigs. Modern workflows combine complementary approaches: tools such as VirSorter2 [@guo2021virsorter2] and geNomad [@camargo2024genomad] identify candidate viral sequences, while CheckV estimates completeness and contamination of assembled viral genomes [@nayfach2021checkv]. Predictions remain hypotheses whose confidence depends on contig length, database coverage, and agreement among multiple signals.
When a reference match is missing, these clues still help build confidence that a contig is viral:
- viral hallmark genes (capsid, large terminase subunit, portal, and polymerase);
- high gene density with few cellular housekeeping genes;
- circularity or direct terminal repeats;
- CRISPR spacer matches to a known host;
- consistent, even read coverage; and
- absence of ribosomal RNA and other cellular markers.
### Why viromics is harder than bacterial metagenomics
| Challenge | Why it complicates analysis |
|---|---|
| No universal marker gene | there is no viral 16S; identification needs multiple signals |
| Enormous diversity | viral sequence space is vast and largely uncharted |
| Small genomes | short contigs carry less evidence per sequence |
| Reference bias | databases are incomplete, so novel viruses are missed |
| Contamination | host and bacterial DNA can dominate a library |
| Host DNA background | plant, animal, or human reads can swamp viral reads |
| RNA vs DNA workflows | RNA viromes need reverse transcription and are less stable |
| Prophages | integrated viruses blur the host–virus boundary |
## Linux activity: explore genome types
This activity creates a small tab-separated values (TSV) file, selects RNA genome types, and summarizes the genome categories. It requires only a POSIX-like shell and standard command-line tools. First, set up the standard project folders you will reuse throughout the book.
```{=html}
<div class="dl-row">
<a class="dl-btn" href="../scripts/setup_project.sh" download>⬇ setup_project.sh</a>
</div>
```
```bash
# One-time: create the standard project structure used across the book
bash setup_project.sh # or: bash ~/Downloads/setup_project.sh
```
### 1. Create the dataset
```bash
mkdir -p ~/viromics_course/phase1_fundamentals
cd ~/viromics_course/phase1_fundamentals
cat > viral_genome_types.tsv << 'EOF'
Virus Group Genome Example
T4_phage I dsDNA Bacteriophage
Microvirus II ssDNA Bacteriophage
Rotavirus III dsRNA Animal_virus
Coronavirus IV +ssRNA Animal_virus
Influenza V -ssRNA Animal_virus
HIV VI +ssRNA-RT Retrovirus
Hepatitis_B VII dsDNA-RT Hepadnavirus
EOF
column -t -s $'\t' viral_genome_types.tsv # optional pretty printing
```
### 2. Select RNA genome types
```bash
awk -F'\t' 'NR==1 || $3 ~ /RNA/' viral_genome_types.tsv
```
`-F'\t'` tells `awk` that fields are separated by tabs. `NR==1` retains the header, and `$3 ~ /RNA/` selects records whose third field contains `RNA`.
### 3. Count genome categories
```bash
cut -f3 viral_genome_types.tsv | tail -n +2 | sort | uniq -c
```
The pipeline extracts the third column, removes the header, sorts identical values together, and counts them. Because this teaching dataset contains one example per Baltimore group, each category should have a count of one.
::: {.callout-tip}
## Check your understanding
Modify the `awk` command to select bacteriophages using the fourth column:
```bash
awk -F'\t' 'NR==1 || $4 == "Bacteriophage"' viral_genome_types.tsv
```
:::
::: {.callout-note collapse="true"}
## Exercise: build an environments table
Create `virome_environments.tsv` with columns `Environment`, `Main_viruses`, `Main_hosts`, and `Bioinformatics_challenge` for five environments (human gut, soil, marine, wastewater, plant), then print only the rows where the challenge mentions "diversity".
**One solution:**
```bash
cat > virome_environments.tsv << 'EOF'
Environment Main_viruses Main_hosts Bioinformatics_challenge
Human_gut Bacteriophages Gut_bacteria high_individual_variation
Soil Phages_and_plant_viruses Soil_microbes inhibitors_and_high_diversity
Marine Marine_phages Marine_bacteria huge_diversity_and_novelty
Wastewater Mixed_viruses Mixed_hosts mixed_sources_contamination
Plant Plant_RNA_viruses Plant_cells host_background_signal
EOF
awk -F'\t' 'NR==1 || $4 ~ /diversity/' virome_environments.tsv
```
:::
::: {.time-storage}
**Estimated resources:** one CPU thread, less than 100 MB RAM, less than 1 MB storage, and under one minute.
:::
::: {.callout-warning}
## Common beginner mistakes
- **Trusting one tool.** A single positive call is a hypothesis, not a conclusion — require agreement across evidence.
- **Ignoring CheckV quality.** Reporting fragments as if they were complete genomes overstates your results.
- **Forcing species-level names.** For novel viruses, family-level or higher assignments are usually more honest.
:::
## Key takeaways
::: {.key-takeaways}
- Viromics targets the viral *population* of a sample, sitting between single-virus virology and whole-community metagenomics, and every reported virome is an operational, protocol-dependent measurement rather than a complete inventory.
- Viral genomes span DNA and RNA, single- and double-stranded, linear, circular, and segmented forms; the Baltimore system organizes them by their route to translatable mRNA and complements formal taxonomy [@baltimore1971expression].
- Viruses lack a universal marker gene like 16S rRNA, so identification must combine several imperfect signals — hallmark genes, gene density, composition, coverage, and host association — rather than relying on any single line of evidence [@minot2011humanvirome].
- Lytic and lysogenic lifestyles leave distinct fingerprints in sequence data, which is why prophages appear embedded in host contigs and why proviral host flanks must be trimmed before analysis.
- Much of the virosphere is uncharacterized "viral dark matter," so predictions from tools such as VirSorter2 remain hypotheses whose confidence rises with contig length, database coverage, and agreement across methods [@guo2021virsorter2; @nayfach2021checkv].
:::
## Further reading
- @baltimore1971expression introduces the classification of viruses by their strategy for producing mRNA, the conceptual backbone of the Baltimore groups discussed here.
- @minot2011humanvirome is a foundational human gut virome study illustrating why viral identification depends on multiple, imperfect signals.
- @nayfach2021checkv describes CheckV, the standard for estimating completeness and contamination of assembled viral genomes and for trimming prophage host flanks.
- The ICTV maintains the authoritative framework for virus taxonomy, complementing Baltimore groups [@ictv2026taxonomy]; see the official site at [https://ictv.global](https://ictv.global).
## Chapter figure
{#fig-ch01 fig-alt="Viromics within a microbial ecosystem feeding a bioinformatics pipeline"}
::: {.callout-tip collapse="true"}
## 🎨 Generate this figure
**Save as:** `images/ch01-viromics-ecosystem.png` · **Aspect ratio:** 16:9 · **Style:** clean flat vector infographic, Codanics palette (teal `#008b8b`, navy `#05043b`, white background), no photorealism.
**Prompt:** Create a clean educational infographic showing viromics as a viral population inside a microbial ecosystem. On the left, show a stylized ecosystem containing bacteria, archaea, fungi, plant cells, and animal cells, with bacteriophages, RNA viruses, and DNA viruses highlighted among them. In the center, show viral particles being enriched and their genomes extracted. On the right, show viral contigs flowing into a Linux terminal representing a bioinformatics pipeline. Use a modern scientific style with teal and navy Codanics branding and clear labels.
:::
## Quiz: Fundamentals
**Q1. What is a virome?**
A. all bacteria in a sample
B. all viruses in a sample or ecosystem
C. only disease-causing viruses
D. only RNA viruses
::: {.callout-note collapse='true'}
**Answer:** B. A virome is the viral community associated with a sample or environment, although an experiment generally detects only a protocol-dependent subset.
:::
**Q2. Why is viromics difficult compared with 16S profiling?**
A. viruses have no universal marker gene
B. viruses are always larger than bacteria
C. viral genomes are all identical
D. viruses cannot be assembled
::: {.callout-note collapse='true'}
**Answer:** A. There is no universal viral barcode equivalent to 16S rRNA.
:::
**Q3. What is a prophage?**
A. a temperate phage genome persisting in or alongside a host genome
B. a sequencing adapter
C. a protein domain
D. a host ribosome
::: {.callout-note collapse='true'}
**Answer:** A. A prophage persists in a lysogen, commonly integrated into the host chromosome but sometimes maintained extrachromosomally.
:::
**Q4. Which Baltimore group includes +ssRNA viruses?**
A. I
B. II
C. IV
D. VII
::: {.callout-note collapse='true'}
**Answer:** C. Group IV includes positive-sense single-stranded RNA viruses.
:::
**Q5. What is viral dark matter?**
A. viral sequences with no close reference match
B. contaminated adapters
C. low-quality bases only
D. a type of culture medium
::: {.callout-note collapse='true'}
**Answer:** A. Many viral sequences remain poorly represented in reference databases.
:::
## Interactive quiz: Fundamentals
```{=html}
<div class="interactive-quiz-note"><strong>How to use this quiz:</strong> Select one option, click <em>Check answer</em>, and read the explanation. Use the reset button if you want to try again.</div>
<div class="quiz-set">
<div class="quiz-question" data-answer="B">
<p class="quiz-prompt">1. What is the best description of a virome?</p>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q1" value="A"> <strong>A.</strong> All proteins in a sample</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q1" value="B"> <strong>B.</strong> All viruses in a sample or ecosystem</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q1" value="C"> <strong>C.</strong> Only viruses that cause disease</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q1" value="D"> <strong>D.</strong> Only bacteriophages</label>
<div class="quiz-controls"><button type="button" class="quiz-check">Check answer</button><button type="button" class="quiz-reset">Reset</button></div>
<div class="quiz-explanation">A virome refers to the viral community associated with a sample or environment. It can include bacteriophages, animal viruses, plant viruses, and other viral groups.</div>
<div class="quiz-feedback"></div>
</div>
<div class="quiz-question" data-answer="C">
<p class="quiz-prompt">2. Why is viromics harder than bacterial 16S profiling?</p>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q2" value="A"> <strong>A.</strong> Viruses cannot be sequenced</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q2" value="B"> <strong>B.</strong> Viruses are always rare</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q2" value="C"> <strong>C.</strong> Viruses lack a universal marker gene like 16S rRNA</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q2" value="D"> <strong>D.</strong> All viral genomes are circular</label>
<div class="quiz-controls"><button type="button" class="quiz-check">Check answer</button><button type="button" class="quiz-reset">Reset</button></div>
<div class="quiz-explanation">There is no universal viral barcode equivalent to bacterial 16S rRNA. Viromics therefore depends on multiple signals such as hallmark genes, genome structure, sequence composition, and reference comparison.</div>
<div class="quiz-feedback"></div>
</div>
<div class="quiz-question" data-answer="B">
<p class="quiz-prompt">3. Which statement best contrasts a virus genome with a bacterial genome?</p>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q3" value="A"> <strong>A.</strong> Viruses contain ribosomes and bacteria do not</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q3" value="B"> <strong>B.</strong> Bacteria usually have larger genomes and can live independently</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q3" value="C"> <strong>C.</strong> Viruses always have DNA and bacteria always have RNA</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q3" value="D"> <strong>D.</strong> Bacterial genomes cannot be circular</label>
<div class="quiz-controls"><button type="button" class="quiz-check">Check answer</button><button type="button" class="quiz-reset">Reset</button></div>
<div class="quiz-explanation">Bacterial genomes are usually much larger and encode the core functions needed for independent life. Viral genomes are compact and rely on host cells for replication and translation.</div>
<div class="quiz-feedback"></div>
</div>
<div class="quiz-question" data-answer="C">
<p class="quiz-prompt">4. What is a prophage?</p>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q4" value="A"> <strong>A.</strong> A host ribosome</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q4" value="B"> <strong>B.</strong> A low-quality read</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q4" value="C"> <strong>C.</strong> A temperate phage genome persisting in or alongside a host genome</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q4" value="D"> <strong>D.</strong> A type of sequencing adapter</label>
<div class="quiz-controls"><button type="button" class="quiz-check">Check answer</button><button type="button" class="quiz-reset">Reset</button></div>
<div class="quiz-explanation">A prophage is the persistent form of a temperate phage in a lysogen. It is commonly integrated into the host chromosome but can also be maintained extrachromosomally until induction initiates productive infection.</div>
<div class="quiz-feedback"></div>
</div>
<div class="quiz-question" data-answer="C">
<p class="quiz-prompt">5. Which Baltimore group includes positive-sense single-stranded RNA viruses?</p>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q5" value="A"> <strong>A.</strong> Group I</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q5" value="B"> <strong>B.</strong> Group III</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q5" value="C"> <strong>C.</strong> Group IV</label>
<label class="quiz-option"><input type="radio" name="01-fundamentals-q5" value="D"> <strong>D.</strong> Group VII</label>
<div class="quiz-controls"><button type="button" class="quiz-check">Check answer</button><button type="button" class="quiz-reset">Reset</button></div>
<div class="quiz-explanation">Group IV viruses have positive-sense single-stranded RNA genomes. Their genomes can function directly as mRNA.</div>
<div class="quiz-feedback"></div>
</div>
</div>
```