Metatranscriptomics-2026-09-09

Metatranscriptomics: From Reads to Functional Profiles

NM

Nasir Mahmood Abbasi, PhD

Bioinformatics Educator

Metatranscriptomics Basics

Metatranscriptomic sequencing captures RNA present in a sampled community. A useful analysis follows each read through quality control, rRNA classification, host depletion when relevant, and functional assignment, while recording how many reads remain at every stage.

Format: Conceptual guide. For readers planning or reviewing a microbial RNA-sequencing workflow: you will map each stage's input, output and decision criteria, then assess a small synthetic read-count example. No sequence files are supplied; the command patterns require the reader's own paired FASTQs, references and installed tools.

What the data can tell you

DNA-based metagenomics describes genetic potential in a community. RNA sequencing adds a time- and place-specific view of transcripts detected in the sample. A detected transcript supports the presence of that RNA sequence in the library; it does not by itself establish organism growth, protein abundance, enzyme activity, or a causal response.

Most microbial RNA can be ribosomal RNA, and host-associated material may contain many host reads. Laboratory depletion and computational filters affect the reads available for downstream profiling. Keep counts at each step, and interpret functional assignments in light of database coverage and sample handling.

Plan the read path

The command patterns assume paired-end FASTQ files named sample_R1.fastq.gz and sample_R2.fastq.gz; these are placeholders, not supplied data. Before adapting them, identify the organism(s), assay/library protocol, sample-specific host (if applicable), and matching reference/database releases. Work in a project directory with separate qc_reports/, trimmed/, sortmerna_work/, and nonhost/ outputs, and preserve original reads. These are illustrative command patterns, not a tested end-to-end pipeline or installation recipe. Check that each executable is available and capture its version/help output before adopting options (for example, fastqc --version, multiqc --version, fastp --version, sortmerna --version, and bowtie2 --version); stop if the installed interface differs from the cited manual. Paired-read handling differs among tools: do not pass two filenames as a comma-separated HUMAnN input, and follow the HUMAnN paired-end guide linked below for the supported preparation route for the installed release.

  1. Inspect raw reads. Run FastQC and aggregate reports with MultiQC. Review per-base quality, adapter content, and overrepresented sequences rather than treating a report score as an automatic pass/fail.
  2. Trim when the QC evidence supports it. fastp accepts paired inputs using -i/-I and paired outputs using -o/-O. Its HTML and JSON reports document the filtering performed.
  3. Classify rRNA. SortMeRNA accepts the two mates as two --reads arguments. With --paired_in, if either mate aligns as rRNA, both mates are assigned to the aligned output; this preserves pairs for filtering but can place a non-rRNA mate with its rRNA partner. Inspect outputs and logs, and verify exact options against the installed release.
  4. Remove host reads if needed. Bowtie2 can map paired reads to a host reference index. The paired-unmapped output holds pairs that did not align concordantly; mapping summaries describe alignment categories, so do not equate one percentage with all host-derived material. Additional references and alignment settings are study-specific.
  5. Choose functional profiling. HUMAnN expects one input file per invocation; its standard workflow reports gene-family and pathway tables and may also produce a taxonomic profile. The original comma-separated paired-file example is not a valid single-input contract. Consult current HUMAnN guidance for preparing paired-end reads; this page does not prescribe a universal conversion. For a custom DIAMOND translated search, use the documented query syntax for the installed release and record the database and parameters. A raw alignment table is not itself a vetted pathway-abundance estimate.

Command patterns and file contracts

QC and paired trimming

mkdir -p qc_reports trimmed
fastqc -o qc_reports sample_R1.fastq.gz sample_R2.fastq.gz
multiqc qc_reports -o qc_reports
fastp -i sample_R1.fastq.gz -I sample_R2.fastq.gz \
  -o trimmed/sample_R1.fastq.gz -O trimmed/sample_R2.fastq.gz \
  -h trimmed/fastp.html -j trimmed/fastp.json --thread 8

Expected deliverables are per-input FastQC reports, a MultiQC summary, paired trimmed FASTQ files, and fastp HTML/JSON reports. These commands require FastQC, MultiQC, and fastp already installed; they do not establish that trimming improved a particular dataset. Review pre- and post-trimming evidence. For gzip FASTQs, a cheap structural check is gzip -t sample_R1.fastq.gz sample_R2.fastq.gz followed by counting records with zcat sample_R1.fastq.gz | awk 'END {print NR/4}' and the equivalent R2 command; counts should agree, be positive whole numbers, and each four-line record should have valid FASTQ structure. After trimming, repeat the checks on both output mates and stop if counts differ or outputs are empty; investigate reports/logs rather than proceeding with desynchronized files.

rRNA filtering with paired input

mkdir -p sortmerna_work
sortmerna --ref /path/to/rRNA_reference.fasta \
  --reads trimmed/sample_R1.fastq.gz \
  --reads trimmed/sample_R2.fastq.gz \
  --workdir sortmerna_work \
  --fastx --other --paired_in

Replace the reference path with a supported reference FASTA. SortMeRNA 4 writes its outputs under the work directory, so inspect the generated files and use their actual names downstream. Its documented paired-read behavior matters: --paired_in puts both reads into the aligned output if either read aligns, while the non-aligned output is intended to contain pairs with no rRNA alignment. This choice favors retaining intact pairs among the non-rRNA reads; it can also discard the mate that did not itself match rRNA.

Do not assume output suffixes. SortMeRNA release and output-format settings determine actual file names. Inspect the work directory and run log, confirm both mates remain synchronized, and use the observed paths in later steps.

Host depletion with paired reads

mkdir -p indices nonhost
bowtie2-build host_reference.fasta indices/host
bowtie2 -x indices/host \
  -1 path/to/nonrRNA_R1.fastq.gz -2 path/to/nonrRNA_R2.fastq.gz \
  --very-sensitive --threads 8 \
  --un-conc-gz nonhost/nonhost_%.fastq.gz \
  -S host_mapped.sam 2> bowtie2_host.log

Bowtie2's --un-conc-gz writes pairs that fail to align concordantly, using the percent sign in the filename for mate-specific outputs. The example does not guarantee that every host-derived read is removed: discordant mapping behavior, reference completeness, and alignment policy matter. Review the SAM summary and retain the log with the sample record.

Planning exercise. On paper or in a sample manifest, write one row per stage (raw, trimmed, rRNA-filtered, host-depleted, profiled) with input path, output path, read or pair count, tool/database version, and the criterion for continuing. As a synthetic arithmetic check, if 1,000 read pairs enter a filter and 120 pairs are classified as rRNA, 880 pairs remain only if the filter reports pair-level counts and no pairs are lost for another reason; state the units and reconcile observed counts before interpreting the difference. Stop when mate counts disagree, a stage's output is absent, or the log cannot explain a count change.

Read functional outputs cautiously

HUMAnN's gene-family and pathway tables are computational estimates whose meaning depends on input preparation, reference databases, and normalization. Functional assignments can be missed or misassigned when reference coverage is limited. A raw change in table values across samples is not automatically a comparable change in transcription; choose a normalization and statistical analysis appropriate to the experimental design, then report both.

  • Track input, quality-filtered, rRNA, host-mapped, and functional-search counts with consistent read- or pair-level units.
  • Record software versions, database names/releases, parameters, and any paired-read conversion.
  • Distinguish transcript detection and abundance estimates from protein abundance, enzymatic activity, growth, or causal biological effects.
  • For host-associated sequencing, follow consent, data-use agreements, and controlled-access requirements before sharing reads; computational filtering is not a substitute for privacy review.

Troubleshoot the point where counts change

  • Many reads classified as rRNA: compare the computational classification with laboratory depletion records and the reference database used. A high rRNA fraction can reduce usable sequencing depth; it does not alone identify whether depletion failed.
  • Many reads map to host: check that the intended host reference/index was used and inspect the Bowtie2 summary. Tissue composition, reference mismatch, and alignment settings can all affect the fraction.
  • Few functional assignments: check read quality and length, database compatibility, and search logs before changing thresholds. Relaxing stringency may increase candidate matches while also changing false-match risk; document the rationale.
  • One sample dominates a pathway comparison: compare its depth, filtering fractions, library preparation, and normalization with other samples. Do not remove a sample solely because it disagrees with the expected biology.

References and version capture

Record the output of each installed tool's version command alongside the analysis, together with the exact reference/database release and command line; version strings alone do not make databases or parameters reproducible.

Author: Nasir Mahmood Abbasi, PhD - Category: Metatranscriptomics

Back to topMetatranscriptomics: From Reads to Functional Profiles