{"id":32611478,"url":"https://github.com/ctlab/hict_library","last_synced_at":"2026-06-13T16:32:42.076Z","repository":{"id":59145533,"uuid":"499890077","full_name":"ctlab/HiCT_Library","owner":"ctlab","description":"Library for interaction with Hi-C contact maps in HDF5 format","archived":false,"fork":false,"pushed_at":"2024-06-26T23:28:01.000Z","size":493,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-27T02:52:52.376Z","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/ctlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-04T17:14:33.000Z","updated_at":"2024-06-26T23:28:05.000Z","dependencies_parsed_at":"2024-06-27T02:45:43.616Z","dependency_job_id":"2b1be175-638b-48cd-8460-c8516cc8ad61","html_url":"https://github.com/ctlab/HiCT_Library","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ctlab/HiCT_Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctlab%2FHiCT_Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctlab%2FHiCT_Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctlab%2FHiCT_Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctlab%2FHiCT_Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctlab","download_url":"https://codeload.github.com/ctlab/HiCT_Library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctlab%2FHiCT_Library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281818072,"owners_count":26566859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-10-30T13:58:13.511Z","updated_at":"2026-06-13T16:32:42.070Z","avatar_url":"https://github.com/ctlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HiCT Python library (JVM API-first)\n\nThis repository now provides a JVM-backed Python API as the primary and maintained interface.\nHeavy operations are executed in `HiCT_JVM`; Python acts as a fast typed client layer.\n\n## Overview\n\nHi-Tree actively uses Split/Merge tree structures (Treaps) to efficiently handle contig reverse and move operations without need for overwriting 2D data.\n\n### Features\n* Support for rearrangement operations (contig/scaffold reversal and translocation);\n* Support for scaffolding operations (grouping multiple contigs into scaffold and ungrouping contigs from scaffold);\n* Export of assembly in FASTA format;\n* Export of selection context in FASTA format;\n* Import of AGP assembly description;\n* Saving/loading work state into the file;\n* Property tests are implemented using pytest and pytest-quickcheck.\n\n#### W.I.P.\n* The minimum assembly unit right now is **contig**, which cannot be split into parts;\n\n## Operation instructions\nYou can try it by using [HiCT Server](https://github.com/ctlab/HiCT_Server) to visualize and edit Hi-C contact maps in [HiCT Web UI](https://github.com/ctlab/HiCT_WebUI).\nIt is recommended to use virtual environments provided by `venv` module to simplify dependency management.\nThis library uses HiCT format for the HiC data and you can convert Cooler's `.cool` or `.mcool` files to it using [HiCT utils](https://github.com/ctlab/HiCT_Utils)\n\n## Documentation\n- JVM API client docs: [`doc/jvm_api_v1.md`](./doc/jvm_api_v1.md)\n- Legacy `ContactMatrixFacet` docs (compatibility only):\n  [`doc/hict.api.ContactMatrixFacet.html`](./doc/hict.api.ContactMatrixFacet.html)\n\n## Building from source\nYou can run `rebuild.sh` script in source directory which will perform static type-checking of module using mypy (it may produce error messages), build library from source and reinstall it, deleting current version.\n\n## JVM API client (v1)\n\nUse `hict.HiCTClient` (alias of `hict_jvm_api.HiCTJVMClient`) as the default entry point.\n\n### Key capabilities\n* Open/attach/close sessions in HiCT_JVM;\n* Fetch Hi-C map regions as numpy RGBA arrays (`PNG_BY_PIXELS`) for ML pipelines;\n* Fetch numeric submatrices directly as dense arrays/tensors (`/matrix/query`);\n* Run scaffolding operations via API (reverse/move/split/group/ungroup/debris);\n* Run converter jobs (single and batch) and monitor status;\n* Link FASTA, export FASTA selections/assembly, import/export AGP;\n* Convert coordinates between BP/BINS/PIXELS with hidden-contig awareness.\n\n### Install\n\n```bash\npip install -e .\n```\n\n### Quick start\n\n```python\nfrom hict import HiCTClient, Unit\n\nclient = HiCTClient(\"http://localhost:5000\")\nsession = client.open_file(\"build/quad/combined_ind2_4DN.hict.hdf5\")\nresolution = session.resolutions[0]\ntile = client.fetch_region_pixels(\n    start_row_px=0,\n    start_col_px=0,\n    rows=256,\n    cols=256,\n    bp_resolution=resolution,\n)\npx = client.convert_units(1_000_000, from_unit=Unit.BP, to_unit=Unit.PIXELS, bp_resolution=resolution)\nsignal = client.fetch_region_signal(\n    start_row=0,\n    start_col=0,\n    rows=256,\n    cols=256,\n    bp_resolution=resolution,\n    unit=Unit.PIXELS,\n    signal_mode=\"TRADITIONAL_NORMALIZED\",\n    dtype=\"float32\",\n)\n```\n\n### Quick links\n* API docs: [`doc/jvm_api_v1.md`](./doc/jvm_api_v1.md)\n* Notebooks:\n  * [`notebooks/jvm_api_quickstart.ipynb`](./notebooks/jvm_api_quickstart.ipynb)\n  * [`notebooks/jvm_api_pytorch_dataloader.ipynb`](./notebooks/jvm_api_pytorch_dataloader.ipynb)\n\n### Tests\n* Unit tests (mocked HTTP transport):\n  * `./run_jvm_api_tests.sh`\n* Optional integration tests against a real running HiCT_JVM:\n  * `./run_jvm_api_optional_data_tests.sh`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctlab%2Fhict_library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctlab%2Fhict_library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctlab%2Fhict_library/lists"}