{"id":21962529,"url":"https://github.com/biocpy/biocutils","last_synced_at":"2025-03-22T20:41:51.235Z","repository":{"id":194663678,"uuid":"691312796","full_name":"BiocPy/BiocUtils","owner":"BiocPy","description":"Miscellaneous utilities for BiocPy, mostly to mimic base functionality in R.  ","archived":false,"fork":false,"pushed_at":"2024-01-19T06:37:57.000Z","size":538,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-09T08:58:11.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://biocpy.github.io/BiocUtils/","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/BiocPy.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}},"created_at":"2023-09-13T23:42:25.000Z","updated_at":"2023-09-14T17:07:34.000Z","dependencies_parsed_at":"2023-09-14T14:29:43.215Z","dependency_job_id":"661b8bac-9ee7-4883-a65a-f4c96a7d2925","html_url":"https://github.com/BiocPy/BiocUtils","commit_stats":null,"previous_names":["biocpy/biocutils"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2FBiocUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2FBiocUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2FBiocUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2FBiocUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BiocPy","download_url":"https://codeload.github.com/BiocPy/BiocUtils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245020314,"owners_count":20548156,"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","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-11-29T10:43:16.459Z","updated_at":"2025-03-22T20:41:51.186Z","avatar_url":"https://github.com/BiocPy.png","language":"Python","readme":"\u003c!-- These are examples of badges you might want to add to your README:\n     please update the URLs accordingly\n\n[![Built Status](https://api.cirrus-ci.com/github/\u003cUSER\u003e/biocutils.svg?branch=main)](https://cirrus-ci.com/github/\u003cUSER\u003e/biocutils)\n[![ReadTheDocs](https://readthedocs.org/projects/biocutils/badge/?version=latest)](https://biocutils.readthedocs.io/en/stable/)\n[![Coveralls](https://img.shields.io/coveralls/github/\u003cUSER\u003e/biocutils/main.svg)](https://coveralls.io/r/\u003cUSER\u003e/biocutils)\n[![Conda-Forge](https://img.shields.io/conda/vn/conda-forge/biocutils.svg)](https://anaconda.org/conda-forge/biocutils)\n[![Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social\u0026label=Twitter)](https://twitter.com/biocutils)\n--\u003e\n\n# Utilities for BiocPy\n\n[![Project generated with PyScaffold](https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold)](https://pyscaffold.org/)\n[![PyPI-Server](https://img.shields.io/pypi/v/biocutils.svg)](https://pypi.org/project/biocutils/)\n[![Monthly Downloads](https://pepy.tech/badge/biocutils/month)](https://pepy.tech/project/biocutils)\n![Unit tests](https://github.com/BiocPy/biocutils/actions/workflows/pypi-test.yml/badge.svg)\n\n## Motivation\n\nThis repository contains a variety of simple utilities for the [BiocPy](https://github.com/BiocPy) project,\nmostly convenient aspects of R that aren't provided by base Python.\nThe aim is to simplify development of higher-level packages like [**scranpy**](https://github.com/BiocPy/scranpy) and [**singler**](https://github.com/BiocPy/singler)\nthat would otherwise have to implement these methods individually.\n\n## Available utilities\n\n### `match`\n\n```python\nimport biocutils\nbiocutils.match([\"A\", \"C\", \"E\"], [\"A\", \"B\", \"C\", \"D\", \"E\"])\n## [0, 2, 4]\n```\n\n### `factor`\n\n```python\nimport biocutils\nbiocutils.factor([\"A\", \"B\", \"B\", \"A\", \"C\", \"D\", \"C\", \"D\"])\n## (['A', 'B', 'C', 'D'], [0, 1, 1, 0, 2, 3, 2, 3])\n```\n\n### `intersect`\n\n```python\nimport biocutils\nbiocutils.intersect([\"A\", \"B\", \"C\", \"D\"], [\"D\", \"A\", \"E\"])\n## ['A', 'D']\n```\n\n### `union`\n\n```python\nimport biocutils\nbiocutils.union([\"A\", \"B\", \"C\", \"D\"], [\"D\", \"A\", \"E\"])\n## ['A', 'B', 'C', 'D', 'E']\n```\n\n### `subset`\n\n```python\nimport biocutils\nbiocutils.subset([\"A\", \"B\", \"C\", \"D\", \"E\"], [0, 2, 4])\n## ['A', 'C', 'E']\n\nimport numpy as np\ny = np.array([10, 20, 30, 40, 50])\nbiocutils.subset(y, [0, 2, 4])\n## array([10, 30, 50])\n```\n\n### `is_list_of_type`\n\nChecks if all elements of a list or tuple are of the same type.\n\n```python\nimport biocutils\nimport numpy as np\n\nx = [np.random.rand(3), np.random.rand(3, 2)]\nbiocutils.is_list_of_type(x, np.ndarray)\n## True\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiocpy%2Fbiocutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiocpy%2Fbiocutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiocpy%2Fbiocutils/lists"}