Data Preparation
The pipeline accepts genomic data from three primary sources: GISAID EpiFlu, NCBI Virus, and custom laboratory collections. This page documents the required file formats, metadata schemas, and acquisition workflows for each source.Overview: Supported Data Sources
Source 1: GISAID EpiFlu
GISAID is the primary recommended source for Influenza A/B sequences due to its comprehensive coverage and standardised metadata.Downloading from GISAID
- Log in at https://gisaid.org → Select EpiFlu™ Database.
- Apply filters:
- Type:
A(Influenza A) orB(Influenza B) - Segment: Select the target segment (e.g.,
MPfor M segment) - Host:
Human - Location: Your target region
- Type:
- Select all results → Click Download → Choose Sequences (XLS/CSV) + Metadata.
- Download format: EpiFlu™ Package — this produces a
.xlsmetadata file paired with a.fastasequences file.
GISAID Metadata Schema (EpiFlu XLS)
The pipeline’ssanitize_metadata.py reads EpiFlu XLS directly via openpyxl. Key column mapping:
Configuration for GISAID EpiFlu
GISAID Data Access Agreement: All data downloaded from GISAID is subject to the GISAID Data Access Agreement. Do not redistribute raw GISAID sequences or metadata. The pipeline stores processed outputs only; raw GISAID files should be retained locally and not committed to public repositories.
Source 2: NCBI Virus (Web Portal)
NCBI Virus provides open-access sequence data for all pathogens. Download limits are higher than GISAID, but metadata is less standardised for Influenza.Downloading from NCBI Virus
- Navigate to https://www.ncbi.nlm.nih.gov/labs/virus/vssi/.
- Search by taxon (e.g., Influenza A virus) and apply filters:
- Nucleotide completeness:
Complete - Host:
Homo sapiens - Geographic Location: Target country
- Collection Date: Start and end year range
- Nucleotide completeness:
- Click Download → Select both:
- Nucleotide (FASTA format)
- Current table view result (CSV metadata)
- Save both files and note their paths.
NCBI Virus Metadata Schema (CSV)
Configuration for NCBI Virus CSV
Source 3: NCBI Datasets API (Automated)
For large-scale or automated retrieval, use thencbi-datasets-cli pathway.
ncbi-datasets-cli to download sequences and auto-convert metadata.
Prerequisite: Set your NCBI API key for higher rate limits:
Sequence File Requirements (FASTA)
Regardless of source, the input FASTA must meet these requirements:FASTA Header Alignment with Metadata
Thestrain field in metadata must exactly match the FASTA sequence header (after the > character). Mismatches cause sequences to be silently dropped during metadata enrichment.
Combining Multiple Downloads
When combining multiple GISAID or NCBI downloads:Reference Files
The pipeline requires two reference files per target segment:
Reference files are stored in
config/references/. To add a new pathogen:
- Download the reference GenBank record:
efetch -db nuccore -id NC_002016.1 -format gb > config/references/flu_a_mp_reference.gb - Convert to GFF3 using
bp_seqfeature_load.plor manually create from the GenBank CDS annotations. - Update
config.references.genomeandconfig.references.annotationto point to the new files. - Update
config.references.reference_idto the accession number (e.g.,NC_002016.1).
Dataset Sizing Recommendations
For HyPhy selection analysis (M05), independently cap the input via
hyphy.subsample.max_sequences: 300 regardless of the total dataset size.