Registry / data / refgenconf

refgenconf

JSON →
library0.13.1pypypi✓ verified 87d ago

RefGenConf provides a standardized configuration object for reference genome assemblies. It enables robust and centralized management of paths to reference genome assets, ensuring consistency for bioinformatics tools. The current version is 0.13.1, and the project maintains an active development and release cadence.

pip install refgenconf
INSTALL
IMPORT
SIG · REFGENCONF
R
refgenconf
datapythonv0.13.1
Install
4.1s avg
Import
965ms
Disk
39MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.13.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.818s · 37.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.1s · import 0.726s · 39MB
39MB installed
● package 39MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RefGenConf
from refgenconf import RefGenConf

This example demonstrates how to initialize RefGenConf with a configuration file and retrieve paths to specific assets. It includes setup for a temporary config file for immediate execution. In practice, users typically rely on a `refgenie.yaml` file managed by the `refgenie` command-line tool.

import refgenconf import os import yaml # --- Quickstart Setup: Create a dummy config file for demonstration --- # In a real scenario, this would typically be '~/.refgenie/refgenie.yaml' # initialized via 'refgenie init' command. config_path = "temp_refgenie_config.yaml" dummy_config_data = { "refgenie": { "genome_assembly": { "assets": { "fasta": {"path": "/path/to/fasta.fa", "description": "Genome fasta file"}, "chrom_sizes": {"path": "/path/to/chrom.sizes", "description": "Chromosome sizes file"} } } } } with open(config_path, "w") as f: yaml.dump(dummy_config_data, f) # --------------------------------------------------------------------- # Initialize RefGenConf with the config file path rgc = refgenconf.RefGenConf(config_path) # Access a genome assembly's assets genome = "genome_assembly" asset_key = "fasta" if rgc.has_genome(genome) and rgc.has_asset(genome, asset_key): asset_path = rgc.seek(genome, asset_key) print(f"Path to {asset_key} for {genome}: {asset_path}") # Example: Access metadata metadata = rgc.get_asset_data(genome, asset_key) print(f"Metadata for {asset_key}: {metadata}") else: print(f"Genome '{genome}' or asset '{asset_key}' not found in config.") # Clean up the dummy config file os.remove(config_path)
Debug
Known issues
breakingRefGenConf versions prior to 0.10.0 used a different configuration file schema. Upgrading from older versions (e.g., 0.9.x to 0.10.x or newer) often requires migrating your `refgenie.yaml` file.
fix
Use `refgenie upgrade` (if applicable with your `refgenie` version) or manually update your `refgenie.yaml` to conform to the latest schema. Refer to the official RefGenConf/Refgenie documentation for schema changes.
affects: <0.10.0
gotchaRefGenConf typically relies on a `refgenie.yaml` configuration file, usually located at `~/.refgenie/refgenie.yaml`. If this file is missing or malformed, initialization will fail, or assets will not be found.
fix
Ensure `refgenie` is initialized by running `refgenie init` in your terminal. If using a custom path, explicitly provide it during `RefGenConf` initialization (e.g., `RefGenConf(filepath='/path/to/my_refgenie.yaml')`).
affects: All
gotchaAsset names and genome assembly identifiers are case-sensitive and must exactly match the entries in the `refgenie.yaml` configuration. Incorrect casing or typos will result in `KeyError` or 'Asset not found' errors.
fix
Use `refgenie list` in your terminal or inspect your `refgenie.yaml` file to verify the exact names of genomes and assets. Ensure your code uses these names precisely.
affects: All
Errors
Common errors & fixes
FileNotFoundError: [Errno 2] No such file or directory: '~/.refgenie/refgenie.yaml'
The default RefGenConf configuration file was not found at its expected location.
fix
Initialize `refgenie` by running `refgenie init` in your terminal. If you intend to use a different file, pass its path explicitly to `RefGenConf(filepath='your/custom/path.yaml')`.
refgenconf.exceptions.RefgenconfError: Malformed configuration file
The `refgenie.yaml` file does not conform to the expected schema, possibly due to manual edits or an outdated format.
fix
Run `refgenie upgrade` to attempt an automatic migration. If that doesn't work, review the RefGenConf documentation for the correct schema or regenerate the configuration by re-initializing `refgenie` and adding assets.
KeyError: 'some_genome_or_asset_name'
You are trying to access a genome assembly or an asset that is not defined in your `refgenie.yaml` file, or the name is misspelled/incorrectly cased.
fix
Check your `refgenie.yaml` file or use `refgenie list` to confirm the exact names of registered genomes and assets. Ensure your Python code uses these names precisely as they appear in the configuration.
Upgrade
Version history
0.13.1latest on PyPI · released Apr 1, 2026
Audit
Dependencies
ubiquergrequiredUtility functions and data structures.
yacmanrequiredYAML-based configuration management.
peppyoptionalFor project-level configuration, though not a direct runtime dependency for basic RefGenConf usage, it's part of the broader ecosystem.
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
refgenconf — pip install refgenconf · libregistry