Audited Library Integration for External Namespaces
Project description
ALIEN
ALIEN: Audited Library Integration for External Namespaces is a fully Python-based tool for building namespace-specific GMT libraries for human gene-set workflows.
ALIEN is centered on one job: take configured source libraries, normalize their gene memberships into a canonical table, project them into configured target namespaces, and write combined GMT files with audit metadata.
Install
Install ALIEN from PyPI:
pip install bioalien
The PyPI distribution name is bioalien; the Python import and command-line tool are alien.
Quick Start
Prepare a config with sources and a target annotation, then run:
alien build --config examples/cancer_dependency.yml --workers 16
Ready-made configs are available for GTEx v11 / GENCODE v47 and TCGA recount3 / GENCODE v29 targets. The first three configs write both GTEx and TCGA GMTs; the cancer dependency config is TCGA-only. TCGA configs use GENCODE v29 as the primary annotation helper and recount3 G029 as a metadata fallback for measured IDs missing from GENCODE.
- examples/pathways.yml: Reactome, WikiPathways, KEGG MEDICUS, and GO biological process terms.
- examples/function_location.yml: GO molecular function and cellular component terms.
- examples/disease_phenotype.yml: HPO, DisGeNET, ClinVar, GWAS Catalog, and Jensen disease libraries.
- examples/cancer_dependency.yml: cancer and dependency signatures for TCGA recount3.
The primary outputs are:
gmt/<target_namespace>.gmt: combined GMT for each configured target namespace.metadata/: source manifest, term manifest, gene mapping tables, removed terms, unmapped genes, ambiguity logs, and provenance.qc/: collection, mapping, redundancy, target coverage, and warning summaries.
The two filesystem roots are configured in YAML: project.source_dir is for downloaded/cached source and mapping resources, while project.outdir is the output root containing gmt/, metadata/, and qc/.
Downstream enrichment reports using these GMTs are included in docs/sex_contrast/gtex_thyroid/analysis.md and docs/sex_contrast/tcga_lung/analysis.md. Scripts to regenerate the report data, text, and figures are available in scripts/.
How It Works
ALIEN builds one canonical membership table from configured sources, audits source gene symbols against human mapping resources, then projects each term into the requested output namespaces.
The target namespace is defined in the config. For an Ensembl-style namespace, provide a target name and a GTF annotation:
targets:
- name: human_gencode49
type: ensembl_gtf
annotation:
source: GENCODE
version: "49"
This writes gmt/human_gencode49.gmt.
For human GENCODE releases, any numeric version is enough; ALIEN builds the official FTP URL and caches the GTF under data/alien_sources/gencode/ if it is missing. You can still provide annotation.path to pin a local file explicitly.
source: GENCODE is not special to the config shape; other Ensembl-style GTF origins can use the same adapter by providing a local path or URL. Fully different target ID systems, such as Entrez or UniProt GMT output, are planned as future target adapters.
Targets separate the output gene set from the annotation helper. By default the GTF supplies both. Use output_genes when a dataset file supplies the final Ensembl ID namespace, or gene_filter when the annotation namespace should be intersected with a file/list of allowed IDs. In output_genes builds, id_column contains Ensembl IDs and the optional symbol_column adds dataset-provided symbol metadata for IDs absent from the GTF. annotation.metadata_fallbacks can add secondary GTF metadata only for output genes missing from the primary annotation; primary annotation mappings keep priority.
The build keeps audit outputs beside the GMTs so each namespace projection can be traced back to source terms, symbol repairs, unmapped genes, filters, redundancy decisions, and provenance. The compact metadata/source_manifest.tsv table is the main record of the exact source collections used in a build; for regex-matched Enrichr libraries it records the resolved library, match method, and candidate names.
term_id values must identify one source term unambiguously. If two source libraries reuse the same term_id for different term metadata, ALIEN fails by default and writes metadata/term_id_collisions.tsv so the IDs can be renamed or prefixed before rebuilding.
Redundancy filtering removes exact duplicate terms and then clusters highly overlapping terms by Jaccard similarity within each namespace and family. The default cutoff is 0.85:
redundancy:
jaccard_cutoff: 0.85
Within each redundant cluster, ALIEN keeps one representative using the configured source priority, then term size and name-based tie-breaks.
Source priority is configured per term family and controls which library wins when redundant terms overlap. For example, pathway terms can prefer REACTOME over broader ontology-derived terms:
source_priority:
biology_process_pathway: [REACTOME, WIKIPATHWAYS, KEGG_MEDICUS, GOBP]
See docs/usage.md for the full configuration reference.
Source Inputs
ALIEN 0.1.4 supports managed MSigDB and Enrichr download/cache sources and local file sources:
msigdb_remote: a Python downloader/reader for configured MSigDB release archives, with normalized Parquet caches for repeated builds.enrichr_remote: a Python downloader/reader for Enrichr libraries by public library name.symbol_gmt: a GMT file whose members are gene symbols.
Additional source metadata fields are documented in docs/usage.md.
Python API
from alien import build
result = build("examples/pathways.yml", workers=16)
print(result.namespaces)
You can also pass the same configuration as a Python dictionary, including target output genes such as output_genes: {"path": "expression.tsv.gz", "id_column": "feature_id", "symbol_column": "gene_symbol"} for a known Ensembl ID field.
MSigDB
sources:
- type: msigdb_remote
version: "2026.1"
db_species: HS
collection: C2
This stores the configured MSigDB release archive under project.source_dir/msigdb_remote/ by default, or a source-level cache_dir override when provided. ALIEN verifies the archive by MD5, extracts the matching RDS files, and writes normalized Parquet memberships for later builds.
Remote caches are reused by default. ALIEN also caches normalized MSigDB memberships and prepared NCBI rescue maps, so repeated large builds avoid expensive source-format conversion. Use alien build --force-download or per-source force: true to refresh managed downloads such as MSigDB, Enrichr, GENCODE, HGNC, and NCBI resources. For publication configs, prefer exact Enrichr library names and keep metadata/source_manifest.tsv with the released GMTs. Enabled sources are always required; use enabled: false to exclude a source deliberately.
Scope
The 0.1.4 release officially supports human gene sets using HGNC symbols, Python MSigDB and Enrichr cache integration, optimized repeated-build caches, and Ensembl-style target namespaces. The code is organized so broader namespace integrations can be added later without tying the package to any single downstream analysis project.
Contributing
Contributions are welcome. Useful areas include additional tests, documentation, source adapters, target namespace adapters, mapping-audit improvements, curated filtering/source-priority defaults, and validation against established gene-set resources. See docs/development.md for development setup and current future plans.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bioalien-0.1.4.tar.gz.
File metadata
- Download URL: bioalien-0.1.4.tar.gz
- Upload date:
- Size: 60.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98ed89225a7024d57e19d76ae3da2649510973a269f93dd50ebc097cd2c63771
|
|
| MD5 |
104112e215bac12eddb62962c84e3971
|
|
| BLAKE2b-256 |
c0e28ea72bb3fb6f15e9fd17a9204ab98e514a49ea9f0143044596a50e46b64e
|
Provenance
The following attestation bundles were made for bioalien-0.1.4.tar.gz:
Publisher:
release.yml on deminden/alien
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bioalien-0.1.4.tar.gz -
Subject digest:
98ed89225a7024d57e19d76ae3da2649510973a269f93dd50ebc097cd2c63771 - Sigstore transparency entry: 1550664541
- Sigstore integration time:
-
Permalink:
deminden/alien@7d51147708a98bde92b4d0db2face1aad66c0ca7 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/deminden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7d51147708a98bde92b4d0db2face1aad66c0ca7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bioalien-0.1.4-py3-none-any.whl.
File metadata
- Download URL: bioalien-0.1.4-py3-none-any.whl
- Upload date:
- Size: 49.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
922c6c30c10bfe48cc22d1db695b469fd163838c5a0d1b782bc67161e6b56028
|
|
| MD5 |
b314841d3d48ee4ab7d1caf51ebf0b7d
|
|
| BLAKE2b-256 |
8984ec76b51e29d42d8b3efeb6d9246ba7df4d1e7d2039556efd2b507042d8f6
|
Provenance
The following attestation bundles were made for bioalien-0.1.4-py3-none-any.whl:
Publisher:
release.yml on deminden/alien
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bioalien-0.1.4-py3-none-any.whl -
Subject digest:
922c6c30c10bfe48cc22d1db695b469fd163838c5a0d1b782bc67161e6b56028 - Sigstore transparency entry: 1550664641
- Sigstore integration time:
-
Permalink:
deminden/alien@7d51147708a98bde92b4d0db2face1aad66c0ca7 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/deminden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7d51147708a98bde92b4d0db2face1aad66c0ca7 -
Trigger Event:
push
-
Statement type: