Private Data Ingestion¶
PBI-Scope can ingest private sources from private_data/ in addition to public PhageScope data.
Directory structure¶
Each private source is a subdirectory under the private data root. There are two modes:
Phage + Host mode (full)¶
Phage-only mode¶
When you do not have host genomes, use phage-only mode. Set Host_ID and Host_name to unknown in metadata.csv and omit the hosts/ directory entirely.
metadata.csv format¶
Required columns¶
| Column | Description |
|---|---|
Phage_ID |
Unique phage identifier (must exist in phage.fasta) |
Host_ID |
Host identifier (unknown when no host is available) |
Host_name |
Host species name (unknown when no host is available) |
Source_DB |
Must match the source directory name exactly |
interaction |
Either temperate or virulent |
Any additional columns are stored as entity attributes.
Example: Phage + Host¶
Phage_ID,Host_ID,Host_name,Source_DB,interaction
MyPhage_1,Escherichia_coli_K12,Escherichia coli,MyPrivateDB,virulent
MyPhage_2,Escherichia_coli_K12,Escherichia coli,MyPrivateDB,temperate
Example: Phage-only¶
Phage_ID,Host_ID,Host_name,Source_DB,interaction
MyPhage_1,unknown,unknown,MyPrivateDB,virulent
MyPhage_2,unknown,unknown,MyPrivateDB,temperate
Mandatory rules¶
metadata.csvis requiredphage.fastais requiredhosts/directory is optional — required only whenHost_IDvalues are real identifiers- When
Host_IDandHost_nameare bothunknown, nohosts/directory is needed - Every
Phage_IDin metadata must exist inphage.fasta
Validate before pipeline¶
Runtime behavior¶
- Valid private sources are ingested and linked with
source_type=private - Invalid sources are skipped (public pipeline still completes)
- Re-running pipeline synchronizes removals/additions
Source_DBinmetadata.csvmust match the source folder name exactly- Phage-only sources (no host genomes) are ingested without host mapping entries in
dim_hosts
Validate what was ingested¶
Use DuckDB (or SequenceRetriever) to inspect available source labels:
SELECT Source_DB, source_type, COUNT(*) AS phage_count
FROM fact_phages
GROUP BY Source_DB, source_type
ORDER BY source_type, Source_DB;
If you filter Source_DB = 'test_private' and get 0, first check this query to confirm the exact source name currently present (for example test_private_2).
Output mappings¶
private_phage_mapping.jsonroutes private phage retrievalhost_fasta_mapping.jsonincludes host paths (public + private)
Logs¶
In Docker runs, logs/reports are available in ./pipeline_logs/.
Private-source validation details are written to:
private_data/private_manifest.json(host path)/private-data/private_manifest.json(inside container)
This manifest explicitly lists:
is_validper source- validation
errors - skipped/ingested source counts
For provenance/version-pinning details and public-source diagnostics, see: