{"library":"refgenie","title":"Refgenie","description":"Refgenie creates a standardized folder structure for reference genome files and indexes, facilitating their sharing and usage across different bioinformatics tools and analyses. The current version is 0.13.0, with new releases typically occurring a few times per year, focusing on bug fixes, feature enhancements, and occasional schema updates.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install refgenie"],"cli":{"name":"refgenie","version":"refgenie 0.13.0 | refgenconf 0.13.1"}},"imports":["from refgenie import RefgenieClient","from refgenie import RefgenieProject","import refgenie.cli"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import refgenie\nimport os\n\n# Initialize RefgenieClient. It will look for ~/.refgenie/refgenie.yaml by default.\n# For a temporary or custom config, provide the path.\n# If no config is found at the default path, an empty client is initialized.\n# For this example, we'll try to use a default or an empty one.\n\n# Create a dummy refgenie.yaml for demonstration if it doesn't exist\nconfig_path = os.path.expanduser(\"~/.refgenie/refgenie.yaml\")\nif not os.path.exists(os.path.dirname(config_path)):\n    os.makedirs(os.path.dirname(config_path))\nif not os.path.exists(config_path):\n    with open(config_path, 'w') as f:\n        f.write(\"refgenie:\\n  genome_config_version: 0.2\\n  genomes: {}\\n\")\n\nrg = refgenie.RefgenieClient(config_file=config_path)\n\nprint(f\"Refgenie client initialized. Config file: {rg.config_file}\")\n\n# List available genomes (will be empty if no assets are pulled)\ngenomes = rg.list_genomes()\nprint(f\"Available genomes: {list(genomes.keys())}\")\n\n# Example: trying to get an asset (will likely fail if not pulled/built)\n# To make this runnable without pre-pulled assets, we'll skip direct asset retrieval\n# Try to get a non-existent asset to show expected behavior without erroring\ntry:\n    # This assumes 'human_genome' is a valid genome and 'fasta' is an asset for it\n    # For a real scenario, you would run `refgenie pull human_genome/fasta` first\n    # or build your own assets.\n    # asset_path = rg.get_asset(\"human_genome/fasta\")\n    # print(f\"Path to human_genome fasta: {asset_path}\")\n    print(\"To get an asset, first ensure it's pulled or built locally.\")\n    print(\"Example: 'refgenie pull hg38/fasta' from command line.\")\nexcept Exception as e:\n    print(f\"Could not retrieve asset (expected if not pulled): {e}\")\n\n# Clean up dummy config for demonstration\n# os.remove(config_path)\n# os.rmdir(os.path.dirname(config_path)) # Only if directory is empty\n","lang":"python","description":"Initialize a RefgenieClient, list available genomes, and demonstrate how to interact with assets. This example includes a setup for a dummy config file to make it runnable even if Refgenie hasn't been initialized via the CLI, though actual asset retrieval requires prior `refgenie pull` or `refgenie build` commands.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}