Before initiating production downloads, the CDI Data Acquisition System validates repository workflows using a representative test manifest.
Download Manifest
↓
Test Manifest
↓
ENA Validation
↓
NCBI/SRA Validation
↓
Production Readiness
The objective of repository validation is to confirm that:
Download manifests are constructed correctly.
Repository access is functioning as expected.
Download scripts execute successfully.
FASTQ files can be retrieved successfully.
Expected file counts match downloaded files.
Downloaded files can be parsed and inspected.
Successful repository validation provides confidence that the workflow is functioning correctly before large-scale acquisition begins.
Repository Validation Results
Example validation checks:
wc -l data/manifests/test-manifest.tsv
find data/raw/fastq \
-name "*.fastq.gz" \
| wc -l
Validation summary:
Test Manifest Records 6
Downloaded FASTQ Files 6
Status PASS
Overall result:
Repository Validation Status
ENA: PASS
NCBI/SRA: PASS
READY FOR PRODUCTION DOWNLOAD
Validation Framework
The CDI Data Acquisition System uses a multi-layer validation strategy.
Code
flowchart TD
A[Repository Validation]
--> B[File Count Validation]
B --> C[Integrity Validation]
C --> D[Metadata Validation]
D --> E[FASTQ Structure Validation]
E --> F[Validation Report]
flowchart TD
A[Repository Validation]
--> B[File Count Validation]
B --> C[Integrity Validation]
C --> D[Metadata Validation]
D --> E[FASTQ Structure Validation]
E --> F[Validation Report]
Each validation layer addresses a different source of acquisition risk and contributes to overall dataset reliability.
Validation Project Structure
data/
├── metadata/
├── manifests/
├── logs/
├── raw/
│ ├── sra/
│ └── fastq/
│
├── inventory/
│ └── fastq-inventory.tsv
│
└── validation/
├── file-validation.tsv
├── metadata-validation.tsv
└── validation-report.tsv
The validation directory stores outputs generated during the validation process.
File-Level Validation
File-level validation focuses on verifying the integrity and completeness of downloaded sequencing assets.
Common checks include:
File existence
File size
File format
Compression status
Readability
Expected file counts
These checks help identify incomplete, missing, or corrupted downloads before downstream analysis begins.
Verify Downloaded File Count
Count downloaded FASTQ files:
find data/raw/fastq \
-name "*.fastq.gz" \
| wc -l
Compare against the expected count recorded in the download manifest:
wc -l data/manifests/ena-fastq-urls.txt
Expected outcome:
Manifest Files = Downloaded Files
Agreement between expected and observed file counts provides the first indication that the download process completed successfully.
Checksum Verification
Whenever repositories provide checksums, downloaded files should be verified before proceeding to downstream analyses.
Common checksum methods include:
Checksum validation confirms that downloaded files match the versions distributed by the repository.
Linux:
macOS:
Validation principle:
Repository Checksum
↓
Local Checksum
↓
Match
↓
Validated File
Checksum verification helps detect:
Incomplete downloads
Corrupted files
Interrupted transfers
Unexpected file modifications
Compression Integrity Validation
Most sequencing files are distributed as compressed archives.
Before analysis, compressed files should be tested for corruption.
gzip -tv data/raw/fastq/* .gz
Expected output:
OK
Files failing this check should be re-downloaded before further processing.
Sample Count Validation
Researchers should verify that expected sample counts match downloaded data.
Examples:
Expected Runs: 188
Downloaded FASTQ Files: 188
Status: PASS
or for paired-end studies:
Expected Runs: 54
Expected FASTQ Files: 108
Downloaded FASTQ Files: 108
Status: PASS
Discrepancies should be investigated before proceeding.
Duplicate Detection
Duplicate samples may occur when:
Studies overlap
Samples are submitted multiple times
Metadata contain redundant entries
Multiple repositories expose the same underlying dataset
Duplicate detection helps prevent inflated sample counts and biased analyses.
FASTQ Structure Validation
For sequencing projects, validating FASTQ structure is particularly important.
Each FASTQ record should contain four lines:
@SEQ_ID
SEQUENCE
+
QUALITY
Quick inspection:
zcat sample.fastq.gz | head
This confirms that the file can be decompressed and follows the expected FASTQ structure.
A more robust validation can be performed using SeqKit:
seqkit stats data/raw/fastq/* .fastq.gz
Successful execution confirms that the files can be parsed by downstream bioinformatics tools.
Paired-End Validation
Many sequencing studies generate paired-end reads.
Each sample should contain:
sample_1.fastq.gz
sample_2.fastq.gz
Verify that forward and reverse files exist for every sample:
ls data/raw/fastq/* _1.fastq.gz | wc -l
ls data/raw/fastq/* _2.fastq.gz | wc -l
Expected outcome:
Forward Reads = Reverse Reads
This validation is particularly important for paired-end datasets such as PRJNA802976.
Automated Validation Workflow
To support reproducibility, validation should be automated whenever possible.
Example system component:
scripts/bash/05d-verify-downloads.sh
Workflow:
Repository Validation
↓
File Count Check
↓
FASTQ Inspection
↓
SeqKit Validation
↓
Repository Comparison
↓
Validation Report
Automated validation minimizes manual errors and ensures consistency across projects.
Validation Documentation
Validation results should be recorded as part of the acquisition workflow.
Recommended records include:
Validation date
Repository source
Files checked
Sample counts
Missing files
Detected issues
Corrective actions
Validation reports
Documentation improves transparency, reproducibility, and auditability.
Healthy Reference Microbiome Example
To validate the CDI Data Acquisition System, paired-end amplicon sequencing data from BioProject PRJNA802976 were retrieved independently from both ENA and NCBI.
Validation workflow:
Expected Sequencing Runs
↓
ENA Download
↓
NCBI Download
↓
FASTQ Verification
↓
Repository Comparison
↓
Validated Dataset
Only after successful validation should samples be considered for reference dataset assembly.
Common Validation Challenges
Researchers frequently encounter:
Missing metadata
Corrupted files
Inconsistent naming conventions
Duplicate records
Repository updates
Missing FASTQ pairs
Manifest mismatches
A structured validation workflow helps address these challenges systematically.
Validation as Risk Reduction
Data validation is not merely a technical exercise.
It reduces the risk of:
Incorrect analyses
Missing samples
Reproducibility failures
Misleading conclusions
Validation protects the integrity of downstream scientific work.
Validation Report Example
The CDI Data Acquisition System was validated using three paired-end sequencing runs retrieved independently from ENA and NCBI.
Repository validation summary:
Repository Validation Summary
ENA FASTQ files: 6
NCBI FASTQ files: 6
Verification complete.
SeqKit validation confirmed successful parsing of all FASTQ files.
Example results:
Run Accession Reads Read Length
SRR17868090 52,037 301 bp
SRR17868091 102,787 301 bp
SRR17868092 97,511 301 bp
Interpretation:
FASTQ File Count
Expected: 6
Observed: 6
Status: PASS
Paired-End Validation
Forward Reads: 3
Reverse Reads: 3
Status: PASS
FASTQ Validation
Readable Files: 6
Status: PASS
Repository Comparison
ENA Read Counts = NCBI Read Counts
ENA Read Lengths = NCBI Read Lengths
Status: PASS
Overall result:
Repository Validation: PASS
File Validation: PASS
FASTQ Validation: PASS
Repository Comparison: PASS
Overall Status:
VALIDATED
The validation report provides a reproducible record of dataset integrity and serves as the final quality gate before cloud transfer, reference dataset assembly, and downstream analysis.
Summary
Data validation transforms downloaded sequencing files into trusted analytical assets.
Repository Validation
↓
File Validation
↓
FASTQ Validation
↓
Repository Comparison
↓
Validated Dataset
A validated dataset provides confidence that acquisition objectives have been achieved and that downstream analyses are based on complete and reliable data.
Looking Ahead
Once datasets have been validated, the next challenge is managing storage, transfers, and scalable access to acquired data.
In the next chapter, we explore cloud storage and transfer strategies that support reproducible and collaborative data acquisition workflows while preserving the integrity of validated datasets.