{"id":22731126,"url":"https://github.com/genentech/firmament","last_synced_at":"2026-03-01T18:32:04.502Z","repository":{"id":259283186,"uuid":"866922959","full_name":"Genentech/Firmament","owner":"Genentech","description":"Provides method to perform gene signature search","archived":false,"fork":false,"pushed_at":"2025-04-15T05:35:06.000Z","size":1736,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-06T23:20:57.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Genentech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-03T06:06:43.000Z","updated_at":"2025-04-15T10:55:00.000Z","dependencies_parsed_at":"2024-10-24T04:10:24.284Z","dependency_job_id":"bf0667df-a4e3-43c2-b0e3-ee153c783691","html_url":"https://github.com/Genentech/Firmament","commit_stats":null,"previous_names":["genentech/firmament"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Genentech/Firmament","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2FFirmament","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2FFirmament/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2FFirmament/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2FFirmament/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Genentech","download_url":"https://codeload.github.com/Genentech/Firmament/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2FFirmament/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29978547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T19:19:32.634Z","updated_at":"2026-03-01T18:32:04.467Z","avatar_url":"https://github.com/Genentech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI-Server](https://img.shields.io/pypi/v/firmament.svg)](https://pypi.org/project/firmament/)\n![Unit tests](https://github.com/genentech/firmament/actions/workflows/run-tests.yml/badge.svg)\n# Firmament\n\nFirmament is a Python package for performing high-throughput gene signature searches on large collections of single-cell RNA-seq datasets stored as H5Ad objects. It helps identify datasets containing sets of cells enriched with cells expressing a gene signature.\n\nThe package leverages the [signature score calculation methods](https://github.com/lilab-bcb/pegasus/blob/master/signature_score.pdf) from the [pegasus](https://github.com/lilab-bcb/pegasus) package to compute and search for gene signatures. Firmament's two-phase approach (offline computation + online search) enables efficient signature score searches across 100M+ single cells.\n\n## Installation\n\n```shell\npip install firmament\n```\n\n## Usage\n\n### Computing Signature Scores\n\nEasily compute Z-scores for gene signatures across your single-cell data:\n\n```python\nimport anndata\nimport firmament\n\n# Load your data\nad = anndata.read_h5ad(\"path/to/your/data.h5ad\")\n\n# Compute Z-scores\nzscore_df = firmament.compute.calc_zscores(\n    ad, \n    layer=None,  # Use .X matrix (or specify a layer name)\n    cell_type_labels=\"level1class\"  # Column in adata.obs containing cell type labels\n)\n\nprint(zscore_df)\n```\n\n    ### output\n                Tspan12     Tshz1    Fnbp1l  Adamts15    Cldn12     Rxfp1  \\\n    1772071015_C02 -0.996770 -0.162126 -0.171727 -0.454830 -0.370999 -0.424958   \n    1772071017_G12 -0.773850 -0.321869 -0.658392 -0.516157 -0.128007 -0.273857   \n    1772071017_A05 -0.830232 -0.829437  0.106758 -0.402295 -0.438613 -0.577686   \n    1772071014_B06  0.046787 -0.065567 -0.399475 -0.278929 -0.757392 -0.670489   \n    1772067065_H06 -1.004179 -0.033353 -0.709410 -0.278839 -0.722943 -0.405029   \n    ...                  ...       ...       ...       ...       ...       ...   \n\nOne can imagine a system stores these computed signature Z-score matrices to rapidly identify cell types or individual cells enriched for the expression of specific genes across large data collections.\n\n## Searching for Gene Signature Enrichment\n\nSearch for cells or cell types enriched for specific gene signatures:\n\n```python\nfrom firmament import signature_search\n\n# Search for cells enriched for a set of genes\nresults = signature_search(\n    \"path/to/your/data.h5ad\",\n    genes=[\"Fnbp1l\", \"Tspan12\", \"Vipas39\"],\n    layer_name=None,  # Use .X matrix (or specify a layer name)\n    cell_type_label_column_name=\"level1class\",\n    verbose=True\n)\n\nprint(results)  # Can also be converted into a Pandas DataFrame\n```\n\n    ### output\n\n        fdr_prop\ttotal_count\tfdr_count\tzscore_hist\tpval_hist\tmean_zscore\tset_zscore\tset_pval\tlabel\n    0\t0.001997\t3005\t6\t{'bins': ['-3.20', '-3.14', '-3.09', '-3.03', ...\t{'bins': ['0.01', '0.02', '0.03', '0.04', '0.0...\t-0.932011\t-51.090881\t1.0\toverall\n\n\n### Batch Processing\n\nFor larger collections of files, you can use the `batch_signature_search` function to perform searches _on-the-fly_ across multiple datasets.\n\n\u003c!-- pyscaffold-notes --\u003e\n\n## Note\n\nThis project has been set up using [BiocSetup](https://github.com/biocpy/biocsetup)\nand [PyScaffold](https://pyscaffold.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenentech%2Ffirmament","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenentech%2Ffirmament","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenentech%2Ffirmament/lists"}