Part I · Module 03 · PHYLUCE 1.7.3 workflow

Quality control

Inspect the raw paired-end sequencing reads before adapter and quality trimming. FastQC is used to diagnose individual FASTQ files, and MultiQC combines those reports into a single dataset-level summary.

Objective

Before modifying the reads, we want to understand the quality of the sequencing data. This includes base-quality profiles, read lengths, adapter contamination, sequence composition, duplicated reads and differences among samples.

PHYLUCE 1.7.3 quality-control principle

The official PHYLUCE documentation recommends assessing how much sequence data each sample contains and removing adapter contamination and low-quality bases before assembly. In this tutorial, FastQC and MultiQC provide the visual diagnostic layer; the actual trimming step is performed in the next module.

1. Use a separate QC environment

Do not install modern MultiQC into the PHYLUCE 1.7.3 environment. PHYLUCE 1.7.3 is distributed with a Python 3.6 environment, whereas current MultiQC releases require Python 3.9 or newer. Keeping QC tools in a separate environment avoids dependency conflicts.

If the PHYLUCE environment is currently active, deactivate it:

conda deactivate

Configure the Bioconda and conda-forge channels if they are not already configured:

conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict

Create a dedicated QC environment:

conda create -n uce-qc \
  python=3.11 \
  fastqc=0.12.1 \
  multiqc=1.35

Activate it:

conda activate uce-qc

Verify the installed versions:

fastqc --version
multiqc --version
Versions used in this tutorial

FastQC 0.12.1 and MultiQC 1.35 are used for this QC module. They are kept separate from the fixed PHYLUCE 1.7.3 environment.

2. Define the input and output directories

PROJECT="/path/to/my_UCE_project"
READS="$PROJECT/raw_reads"
QC_RAW="$PROJECT/qc/raw"

THREADS=8

mkdir -p "$QC_RAW"
READS
Directory containing the original demultiplexed FASTQ files.
QC_RAW
Directory where FastQC and MultiQC results for raw reads will be stored.
THREADS
Number of CPU threads used by FastQC. Adjust to your computer.

3. Run FastQC on all raw FASTQ files

The following command searches recursively below raw_reads/, so it works whether all FASTQ files are stored in one directory or in sample-specific subdirectories.

find "$READS" \
  -type f \
  \( -name "*.fastq.gz" -o -name "*.fq.gz" \) \
  -print0 |
xargs -0 fastqc \
  --threads "$THREADS" \
  --outdir "$QC_RAW"

For each FASTQ file, FastQC generates an HTML report and a compressed result archive.

qc/
└── raw/
    ├── sample01_R1_fastqc.html
    ├── sample01_R1_fastqc.zip
    ├── sample01_R2_fastqc.html
    ├── sample01_R2_fastqc.zip
    └── ...

4. Aggregate the reports with MultiQC

Individual FastQC reports are useful, but comparing many samples one by one quickly becomes inefficient. MultiQC scans the FastQC output and summarizes all samples in a single report.

multiqc "$QC_RAW" \
  --outdir "$QC_RAW/multiqc" \
  --title "UCE raw reads"

The main report will be:

qc/raw/multiqc/
├── multiqc_report.html
└── multiqc_data/

Open the report in a web browser:

open "$QC_RAW/multiqc/multiqc_report.html"
Linux note

On many Linux desktop systems, use xdg-open instead of open. You can also open the HTML file manually in a browser.

5. What should you inspect?

Per-base sequence quality

Inspect how Phred quality scores change along the read. A decline toward the 3′ end is common in Illumina reads and is one reason quality trimming may be useful.

Adapter content

Adapter signal indicates that sequencing reads extend into library adapters. Target-capture libraries can contain substantial adapter contamination when inserts are shorter than the sequencing read length.

Sequence length distribution

Before trimming, most reads from a sequencing run are expected to have similar lengths. Unexpected mixtures of read lengths should be understood before continuing.

Per-sequence quality scores

Look for samples containing an unusually large fraction of globally low-quality reads. Such samples may behave differently during assembly and UCE recovery.

Overrepresented sequences

Overrepresented sequences can reflect adapters, technical sequences, contamination, or genuine biological enrichment. They should be interpreted rather than removed automatically.

Sequence duplication

High duplication does not automatically indicate a failed UCE library. Target capture deliberately enriches a restricted portion of the genome, so duplication can be higher than in whole-genome sequencing.

Per-sequence GC content

Compare samples with one another and look for strong outliers. Because UCE sequencing is targeted rather than whole-genome sequencing, the expected GC profile depends on the captured loci and should not be interpreted as though the data were random genomic reads.

6. FastQC warnings are not automatic failures

FastQC uses generic expectations for high-throughput sequencing libraries. UCE target-capture data are not random samples of the whole genome, so some warnings may be expected.

Interpret the biological context

Do not discard a sample only because FastQC reports a warning or failure. Compare samples, inspect the affected metric, and determine whether the signal is explained by adapter contamination, enrichment, read length, library complexity or another known feature of the experiment.

7. Check read abundance

The official PHYLUCE 1.7.3 documentation recommends comparing read counts among samples because libraries with very low read abundance can later recover fewer UCE loci.

If your R1 files use the common _R1_ Illumina naming pattern, the documentation provides the following shell approach:

cd "$READS"

for i in *_R1_*.fastq.gz
do
    echo "$i"
    gunzip -c "$i" | wc -l | awk '{print $1/4}'
done

Each FASTQ record occupies four lines, so dividing the total line count by four gives the number of reads. For paired-end data, corresponding R1 and R2 files should contain the same number of reads.

Filename convention

If your files do not contain _R1_, adjust the wildcard to match your actual filenames. Do not rename raw reads simply to make this example work.

8. Save the raw-read QC report

The raw-read MultiQC report is a baseline. After adapter and quality trimming, the same analyses will be repeated on the cleaned reads so the effect of processing can be evaluated directly.

my_UCE_project/
├── raw_reads/
└── qc/
    └── raw/
        ├── *_fastqc.html
        ├── *_fastqc.zip
        └── multiqc/
            ├── multiqc_report.html
            └── multiqc_data/

9. Pre-flight check

✓ FastQC completed for every raw FASTQ file.
✓ A MultiQC report was generated.
✓ Adapter content was inspected.
✓ Per-base quality was inspected.
✓ Read-length distributions were checked.
✓ Samples with unusually low read counts or unusual QC profiles were identified.
✓ Raw-read reports were retained for comparison after trimming.

References and official documentation

PHYLUCE 1.7.3 — Quality Control

FastQC — Babraham Bioinformatics

FastQC — Official help documentation

MultiQC — Official documentation

Bioconda — FastQC package

Bioconda — MultiQC package

Version policy

The core workflow remains fixed at PHYLUCE 1.7.3. External software is versioned separately so modern tools do not compromise the older PHYLUCE dependency environment.

← Organizing FASTQ files Next: Read processing →