Skill: metagenome-host-removal
Use When
- The user has shotgun metagenomic reads contaminated with host DNA.
- The user wants to remove human, mouse, or other host reads before taxonomic or assembly analysis.
- The user needs to quantify the host contamination rate in a metagenomic sample.
Inputs
- Required:
- FASTQ file(s) — single-end or paired-end reads (
.fastq,.fq,.fastq.gz,.fq.gz). - Host reference genome index — pre-built Bowtie2 or BWA-MEM2 index.
- FASTQ file(s) — single-end or paired-end reads (
- Optional:
--aligner— Aligner to use (bowtie2orbwa-mem2, default:bowtie2).--threads N— Number of threads (default: 4).--outdir DIR— Output directory (default:host_removal_results).--sensitivity— Bowtie2 sensitivity preset (--very-sensitive,--sensitive; default:--very-sensitive).
Workflow
- Align reads to the host reference genome using Bowtie2 or BWA-MEM2.
- Extract unmapped reads (
samtools view -f 4for SE;-f 12for PE unmapped pairs). - Sort unmapped reads by name (
samtools sort -n). - Convert back to FASTQ (
samtools fastq). - Report: total reads, host reads removed, non-host reads retained, host contamination rate.
Output Contract
- Host-depleted FASTQ(s) — One or two FASTQ files with host reads removed (
<outdir>/<sample>_hostdepleted_R1.fastq.gz,_R2.fastq.gzfor PE). - Host contamination summary — Total reads, host reads, non-host reads, host contamination percentage.
Limits
- Bowtie2 or BWA-MEM2 must be installed and available on
$PATH. samtoolsmust be installed and available on$PATH.- Host genome index must be pre-built (use
bowtie2-buildorbwa-mem2 index). - Human reference: GRCh38 (hg38) is recommended for human host removal.
- For clinical samples, host removal rate should be >95%; lower rates suggest index mismatch or sample issues.
- This skill does not build the host index; the user must provide a pre-built index path.
- Common failure cases:
- Host genome index path incorrect or index files incomplete, causing aligner to abort.
- Using the wrong host reference genome (e.g., mouse index for a human-derived sample).
- Paired-end read extraction flags incorrect, producing orphan reads without mates.
Scan to join WeChat group