This repository demonstrates version-controlled dataset layouts without copying controlled-access payloads into Git. Using git-drs, we manage genomic data model files from the ANVIL project with DRS pointers that enable secure, authorization-independent data access.
The ANVIL_1000G_PRIMED_data_model repository is a reference proof-of-concept that shows:
-
Git moves references. ANVIL moves bytes.
- Repository contains only portable DRS URI pointers, not payload data
- Each user authenticates independently to ANVIL for data access
- No credentials, signed URLs, or provider-specific tokens in Git
-
Four perspectives on one reference model:
- Data reference author - Publish reviewable, versioned dataset layouts without downloading payloads
- Data consumer - Clone pointers, authenticate independently, hydrate everything or only matching patterns
- Unauthorized reader - Inspect repository history but cannot access controlled data without authorization
- Repository maintainer - Review deterministic pointers and diagnose provider issues
The repository tracks the following TSV (Tab-Separated Values) data model files as DRS pointers:
- sequencing_dataset.tsv - Sequencing dataset metadata
- subject.tsv - Subject/individual information
- sample.tsv - Biosampling metadata
- sample_set.tsv - Groups of samples
- population_descriptor.tsv - Population descriptors and ancestry information
- sequencing_file.tsv - Information about individual sequencing files
- plink_file_wide.tsv - PLINK format genetic data
These files describe the structure and relationships of genomic samples and datasets from the 1000 Genomes Project PRIMED (Population Reference Integration with Metadata and Expression Data) initiative.
Instead of storing large data files in Git, this repository stores portable DRS pointers that reference data in ANVIL:
version https://calypr.github.io/spec/v1
oid drs://authority/object-id
size 987654321
sha256 8d969eef…
Benefits:
- ✅ Small Git repository (only metadata and pointers)
- ✅ Version control for data layouts and structure
- ✅ No payload bytes, tokens, or credentials in Git
- ✅ Each user authenticates independently for access
- ✅ Works with authorization controls at the DRS provider level
Git visibility reveals file paths and DRS identifiers, but never grants authorization to underlying data. This means:
- Unauthorized readers can clone the repo and see file structure
- They receive a clear denial when attempting to hydrate controlled data
- Each user supplies their own ANVIL credentials independently
- No credentials, tokens, or signed URLs are stored in Git
Before you begin, ensure you have:
-
git-drs installed
git drs install
Follow the full installation at https://github.com/calypr/git-drs
-
Git (version 2.9 or later)
-
Google Cloud SDK with ADC
gcloud auth application-default login
This enables git-drs to request fresh access tokens from ANVIL/Terra
-
ANVIL Account
- Sign up at https://www.anvilproject.org
- Access to ANVIL Data Explorer at https://explore.anvilproject.org
- Required for both authors (adding references) and consumers (hydrating data)
-
Optional: GitHub Account
- For publishing repositories to GitHub
- Not required if staying local
This workflow follows the git-drs zero-payload pattern: add once, publish with ordinary Git, configure per clone.
# Set up Google Cloud authentication
gcloud auth application-default login
# Create and initialize repository
mkdir my-anvil-repo
cd my-anvil-repo
git init
git drs init
# Configure the Terra remote (author-side, only in local .git/config)
git drs remote add anvil terra- Navigate to ANVIL Data Explorer
- Select the dataset: ANVIL_1000G_PRIMED_data_model
- Filter by file format: .tsv files
- Download the manifest TSV (this contains all file metadata including DRS URIs)
# Generate git-drs add-ref commands from the manifest
manifest=/tmp/anvil-manifest-38dc7537.tsv
scripts/anvil-add-ref-commands.sh "$manifest" > /tmp/add-anvil-refs.sh
# Review the commands before executing
cat /tmp/add-anvil-refs.sh
git drs add-ref --remote anvil drs://drs.anv0:v2_6d1cf5f0-99a8-3cd9-b580-01102f3abfe7 sequencing_dataset.tsv
git drs add-ref --remote anvil drs://drs.anv0:v2_b6b829f3-6046-3f29-896f-495a23f24c14 subject.tsv
git drs add-ref --remote anvil drs://drs.anv0:v2_093066ee-45f8-3664-9363-c602913ef0c7 sequencing_file.tsv
git drs add-ref --remote anvil drs://drs.anv0:v2_a31c73cb-3bc8-3688-a1e5-05f2d63d0cf9 plink_file_wide.tsv
git drs add-ref --remote anvil drs://drs.anv0:v2_d8add534-63b4-3077-9df5-5ebc8d138415 sample.tsv
git drs add-ref --remote anvil drs://drs.anv0:v2_d6f6836d-688a-33b9-b3d9-f4e829830c0e sample_set.tsv
git drs add-ref --remote anvil drs://drs.anv0:v2_e68887be-c583-375a-a773-48771192c8fa population_descriptor.tsv
# Validate without writing (dry-run)
bash /tmp/add-anvil-refs.sh --dry-run
# Execute to add references as DRS pointers
bash /tmp/add-anvil-refs.shThis populates .gitattributes and creates DRS pointer files like:
version https://calypr.github.io/spec/v1
oid drs://drs.anv0:v2_6d1cf5f0-99a8-3cd9-b580-01102f3abfe7
size 10384
sha256 76f4ef9e3b8814870583eea92fbf4ba8
# Verify only pointers, not payloads, will be committed
git status
# Commit pointer files
git add .gitattributes '*.tsv'
git commit -m "Add references to ANVIL 1000G PRIMED data model"
# Create a remote repository
git branch -M main
git remote add origin https://github.com/<user>/ANVIL_1000G_PRIMED_data_model.git
git push -u origin mainWhat's in GitHub:
- Portable DRS pointers and
.gitattributes - File paths and metadata
- Git history and versioning
What's NOT in GitHub:
- Payload bytes or cached content
- Tokens, credentials, or ADC files
- Signed download URLs or provider secrets
# Set up authentication
gcloud auth application-default login
# Clone the pointer-only repository
git clone https://github.com/<user>/ANVIL_1000G_PRIMED_data_model.git
cd ANVIL_1000G_PRIMED_data_modelAt this point, *.tsv files are DRS pointers, not actual data.
# Repository-local remote configuration; not cloned from origin
# This is the key security boundary: every clone must recreate its own config
git drs remote add anvil terra --checkout hydrateThis enables git-drs to:
- Resolve DRS URIs via the AnVILResolver
- Request fresh access tokens via Google ADC
- Verify file checksums during download
# Download all authorized TSV files (fetch metadata and data)
git drs pull -I "*.tsv"
# Or hydrate only a specific subset
git drs pull -I "sample.tsv"Download invariant:
- Fetch current metadata and fresh access token
- Download to temporary file
- Verify size and SHA256 checksum
- Atomically promote to cache
- Hydrate worktree only after validation passes
# Check that files are now hydrated (actual content, not pointers)
git status
head sample.tsv| Property | Author | Consumer |
|---|---|---|
| Credentials | Google ADC (gcloud login) | Google ADC (gcloud login) |
| Authorization | Independent to ANVIL | Independent to ANVIL |
| Git payload | Only pointers + metadata | Only pointers + metadata |
| Hydration | Optional (for verification) | Required (to access data) |
| Isolation | Home, config, cache separate | Home, config, cache separate |
git drs ls-filesFiles in this repository will appear as DRS pointers until hydrated:
# Before hydration: shows pointer files
git status
# After hydration: shows actual content
git drs pull -I "*.tsv"
git statusTo add a new data file to the repository (author workflow):
- Obtain the DRS URI and metadata from ANVIL Data Explorer
- Use git-drs to create a reference:
git drs add-ref --remote anvil drs://drs.anv0:v2_<object-id> data/newfile.tsv
- Verify the change:
git status
- Commit and push:
git add .gitattributes data/ git commit -m "Add new reference to <file>" git push
git-drs uses three separate identifiers to ensure security and portability:
| Identity | Type | Purpose | Example |
|---|---|---|---|
| Remote Identity | DRS URI | Canonical reference stored in Git | drs://drs.anv0:v2_6d1cf5f0-99a8-3cd9 |
| Cache OID | SHA256 | Filesystem-safe key, never replaces remote | sha256("git-drs-anvil-ref:v1\n" + drs_uri) |
| Content SHA256 | SHA256 | Integrity verification during download | Content hash from ANVIL metadata |
Key principle: The DRS URI stays canonical and portable. Cache keys and content checksums serve distinct purposes and never override the remote identity.
- Author perspective: Adds references with ADC-authorized metadata validation
- Git: Commits only canonical DRS URI, size, and checksum
- Consumer perspective: Clones pointer-only repository, authenticates independently
- Hydration: Requests fresh authorized access URL and verifies bytes
.git/configremote configuration- Credentials (via Google ADC)
- Cached file content
- Temporary files and access tokens
- Signed download URLs
For independent two-user scenarios:
# Arrange: Separate homes, configs, ADCs, caches
export HOME=/tmp/user_a
export HOME=/tmp/user_b
# Act: Author commits, consumer clones and authenticates
git drs add-ref --remote anvil <drs-uri> <file>
git commit -m "Add reference"
git clone <repo>
git drs remote add anvil terra --checkout hydrate
# Assert: Verify bytes; check isolated credentials
git drs pull
file <filename> # verify content, not pointer- Go to ANVIL Data Explorer
- Filter by dataset: ANVIL_1000G_PRIMED_data_model
- Filter by file type: .tsv (Metadata files)
- Download the manifest (TSV with DRS URIs and checksums for all files)
Files in this dataset have DRS URIs following the pattern:
drs://drs.anv0:v2_<unique-object-identifier>
Example from sequencing_dataset.tsv:
drs://drs.anv0:v2_6d1cf5f0-99a8-3cd9-b580-01102f3abfe7
These URIs are:
- Canonical and stable across versions
- Portable across any GA4GH DRS-compliant client
- Authority for both object metadata and access resolution
- Safely committable to Git without revealing credentials
ANVIL_1000G_PRIMED_data_model/
├── README.md # This file
├── .git/ # Git repository metadata (shared)
├── .gitattributes # DRS filter configuration (shared)
├── sequencing_dataset.tsv # DRS pointer file (shared, ~10 KB)
├── subject.tsv # DRS pointer file (shared, ~80 KB)
├── sample.tsv # DRS pointer file (shared, ~76 KB)
├── sample_set.tsv # DRS pointer file (shared, ~450 KB)
├── population_descriptor.tsv # DRS pointer file (shared, ~200 KB)
├── sequencing_file.tsv # DRS pointer file (shared, ~1.4 MB)
├── plink_file_wide.tsv # DRS pointer file (shared, ~850 KB)
└── etc/ # Documentation (shared)
└── anvil-manifest-*.tsv # ANVIL metadata manifest (reference)
Legend:
- (shared) — Published to GitHub, contains only pointers and metadata
- DRS pointer file — Text file referencing ANVIL data (visible in
git diff, small on disk) - Hydrated content — Downloaded locally after
git drs pull, stored in cache (not in.git)
This is correct and expected behavior. Until you run git drs pull, files exist as pointers:
# Before hydration
cat sample.tsv
# Output: version https://calypr.github.io/spec/v1
# oid drs://drs.anv0:v2_d8add534-63b4-3077-9df5-5ebc8d138415
# size 76883
# sha256 d31b1a54fff9ccc0cb5145b9cf86615c
# After hydration
git drs pull -I "*.tsv"
cat sample.tsv
# Output: (actual TSV content with headers and data rows)This means your Google ADC credentials don't have access to the controlled data:
-
Verify ADC is configured:
gcloud auth application-default print-access-token
If this fails, run
gcloud auth application-default login -
Verify you have ANVIL access:
- Log in to https://www.anvilproject.org
- Navigate to the dataset in ANVIL Data Explorer
- Confirm you can see the data there
-
Check cached credentials:
gcloud auth application-default print-access-token | wc -c # If this returns ~1000 characters, ADC is working
-
Try a specific file:
git drs pull -I "sample.tsv"
Ensure git-drs is properly installed:
git drs --versionIf not installed, install globally:
# Clone the repo
git clone https://github.com/calypr/git-drs.git
cd git-drs
# Install
make install
git drs install # Global filter configThis is expected. Remote configuration is not cloned; it's stored only in .git/config locally:
# After cloning, recreate the remote:
git drs remote add anvil terra --checkout hydrate
# Or check what remotes exist:
git drs remote listThe repository only contains pointers, not data. If it's larger:
-
Check if data is accidentally committed (should never happen with filters configured):
du -sh .git git count-objects -v
-
Data files live in the cache, not the repository:
# Cache is outside the repo (per-user, per-machine) # Find it: git drs cache info
- git-drs Repository: https://github.com/calypr/git-drs
- git-drs Documentation: https://github.com/calypr/git-drs/blob/main/README.md
- ANVIL + Terra POC Design:
docs/anvil-terra-poc.md(in git-drs repo) - GA4GH DRS Specification: https://github.com/ga4gh/data-repository-service-schemas
- ANVIL Project Website: https://www.anvilproject.org
- ANVIL Data Explorer: https://explore.anvilproject.org
- ANVIL Documentation: https://anvilproject.org/learn
- Terra Platform: https://app.terra.bio
- 1000 Genomes Project: https://www.internationalgenome.org
- 1000 Genomes PRIMED: https://www.internationalgenome.org/1000-genomes-primed-project
This repository is a reference proof-of-concept. Changes to the reference model or workflow should:
- For data updates: Contact the ANVIL PRIMED project stewards
- For git-drs improvements: Submit issues and PRs to https://github.com/calypr/git-drs
- For documentation: Edit README.md or related documentation in this repo
Adding new files:
# Get DRS URI from ANVIL Data Explorer
git drs add-ref --remote anvil drs://drs.anv0:v2_<object-id> <path>/<filename.tsv>
# Validate (dry-run)
git drs add-ref --remote anvil --manifest references.tsv --dry-run
# Commit and publish
git add .gitattributes
git commit -m "Add reference to <description>"
git pushThis repository contains pointers to data from the ANVIL/1000 Genomes Project PRIMED initiative. The actual data use policy depends on the dataset's consent group and data use permissions:
- Access terms are enforced by ANVIL/Terra at authorization time
- Pointers in Git are subject to standard open-source licensing
- Actual data bytes are governed by the ANVIL Data Use Agreements
See https://www.anvilproject.org/data for details on specific datasets and their data use agreements.
This is a reference proof-of-concept. Features still in development:
- Producer setup: Safe clone-local remote configuration mechanism
- Resilience: Expired-URL re-resolution and bounded retry
- Performance: Concurrent manifest validation and downloads
- Compatibility: Independent two-user, denied-user, and credential-leak testing
- ANVIL Support: https://www.anvilproject.org/support
- git-drs Issues: https://github.com/calypr/git-drs/issues
- Terra Support: https://support.terra.bio
- Documentation: See
docs/anvil-terra-poc.mdin the git-drs repository
Repository Type: Reference proof-of-concept for git-drs + ANVIL integration
Last Updated: August 2026
POC Status: Vertical slice implemented; production validation in progress