{"id":21962523,"url":"https://github.com/biocpy/multiassayexperiment","last_synced_at":"2026-03-06T20:31:56.079Z","repository":{"id":62592389,"uuid":"504330556","full_name":"BiocPy/MultiAssayExperiment","owner":"BiocPy","description":"Container class to represent and manage multi-omics genomic experiments","archived":false,"fork":false,"pushed_at":"2025-04-21T16:29:13.000Z","size":4365,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T17:35:37.199Z","etag":null,"topics":["multiassayexperiment"],"latest_commit_sha":null,"homepage":"https://biocpy.github.io/MultiAssayExperiment/","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,"zenodo":null}},"created_at":"2022-06-16T23:08:24.000Z","updated_at":"2025-04-01T18:35:22.000Z","dependencies_parsed_at":"2023-09-22T00:23:36.836Z","dependency_job_id":"be687de3-ba44-418c-949f-dc7e3d9f8f9b","html_url":"https://github.com/BiocPy/MultiAssayExperiment","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2FMultiAssayExperiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2FMultiAssayExperiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2FMultiAssayExperiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2FMultiAssayExperiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BiocPy","download_url":"https://codeload.github.com/BiocPy/MultiAssayExperiment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250516325,"owners_count":21443601,"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":["multiassayexperiment"],"created_at":"2024-11-29T10:42:52.259Z","updated_at":"2026-03-06T20:31:56.028Z","avatar_url":"https://github.com/BiocPy.png","language":"Python","readme":"[![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/MultiAssayExperiment.svg)](https://pypi.org/project/MultiAssayExperiment/)\n![Unit tests](https://github.com/BiocPy/MultiAssayExperiment/actions/workflows/run-tests.yml/badge.svg)\n\n# MultiAssayExperiment\n\nContainer class to represent and manage multi-omics genomic experiments. `MultiAssayExperiment` (MAE) simplifies the management of multiple experimental assays conducted on a shared set of specimens, follows Bioconductor's [MAE R/Package](https://bioconductor.org/packages/release/bioc/html/MultiAssayExperiment.html).\n\n## Install\n\nTo get started, install the package from [PyPI](https://pypi.org/project/multiassayexperiment/)\n\n```shell\npip install multiassayexperiment\n```\n\n## Usage\n\nAn MAE contains three main entities,\n\n- **Primary information** (`column_data`): Bio-specimen/sample information. The `column_data` may provide information about patients, cell lines, or other biological units. Each row in this table represents an independent biological unit. It must contain an `index` that maps to the 'primary' in `sample_map`.\n\n- **Experiments** (`experiments`): Genomic data from each experiment. either a `SingleCellExperiment`, `SummarizedExperiment`, `RangedSummarizedExperiment` or any class that extends a `SummarizedExperiment`.\n\n- **Sample Map** (`sample_map`): Map biological units from `column_data` to the list of `experiments`. Must contain columns,\n    - **assay** provides the names of the different experiments performed on the biological units. All experiment names from experiments must be present in this column.\n    - **primary** contains the sample name. All names in this column must match with row labels from col_data.\n    - **colname** is the mapping of samples/cells within each experiment back to its biosample information in col_data.\n\n    Each sample in ``column_data`` may map to one or more columns per assay.\n\nLet's start by first creating few experiments:\n\n```python\nfrom random import random\n\nimport numpy as np\nfrom biocframe import BiocFrame\nfrom genomicranges import GenomicRanges\nfrom iranges import IRanges\n\nnrows = 200\nncols = 6\ncounts = np.random.rand(nrows, ncols)\ngr = GenomicRanges(\n    seqnames=[\n            \"chr1\",\n            \"chr2\",\n            \"chr2\",\n            \"chr2\",\n            \"chr1\",\n            \"chr1\",\n            \"chr3\",\n            \"chr3\",\n            \"chr3\",\n            \"chr3\",\n        ] * 20,\n    ranges=IRanges(range(100, 300), range(110, 310)),\n    strand = [\"-\", \"+\", \"+\", \"*\", \"*\", \"+\", \"+\", \"+\", \"-\", \"-\"] * 20,\n    mcols=BiocFrame({\n        \"score\": range(0, 200),\n        \"GC\": [random() for _ in range(10)] * 20,\n    })\n)\n\ncol_data_sce = BiocFrame({\"treatment\": [\"ChIP\", \"Input\"] * 3},\n    row_names=[f\"sce_{i}\" for i in range(6)],\n)\n\ncol_data_se = BiocFrame({\"treatment\": [\"ChIP\", \"Input\"] * 3},\n    row_names=[f\"se_{i}\" for i in range(6)],\n)\n\nsample_map = BiocFrame({\n    \"assay\": [\"sce\", \"se\"] * 6,\n    \"primary\": [\"sample1\", \"sample2\"] * 6,\n    \"colname\": [\"sce_0\", \"se_0\", \"sce_1\", \"se_1\", \"sce_2\", \"se_2\", \"sce_3\", \"se_3\", \"sce_4\", \"se_4\", \"sce_5\", \"se_5\"]\n})\n\nsample_data = BiocFrame({\"samples\": [\"sample1\", \"sample2\"]}, row_names= [\"sample1\", \"sample2\"])\n```\n\nFinally, we can create an `MultiAssayExperiment` object:\n\n```python\nfrom multiassayexperiment import MultiAssayExperiment\nfrom singlecellexperiment import SingleCellExperiment\nfrom summarizedexperiment import SummarizedExperiment\n\ntsce = SingleCellExperiment(\n    assays={\"counts\": counts}, row_data=gr.to_pandas(), column_data=col_data_sce\n)\n\ntse2 = SummarizedExperiment(\n    assays={\"counts\": counts.copy()},\n    row_data=gr.to_pandas().copy(),\n    column_data=col_data_se.copy(),\n)\n\nmae = MultiAssayExperiment(\n    experiments={\"sce\": tsce, \"se\": tse2},\n    column_data=sample_data,\n    sample_map=sample_map,\n    metadata={\"could be\": \"anything\"},\n)\n```\n\n    ## output\n    class: MultiAssayExperiment containing 2 experiments\n    [0] sce: SingleCellExperiment with 200 rows and 6 columns\n    [1] se: SummarizedExperiment with 200 rows and 6 columns\n    column_data columns(1): ['samples']\n    sample_map columns(3): ['assay', 'primary', 'colname']\n    metadata(1): could be\n\nFor more use cases, checkout the [documentation](https://biocpy.github.io/MultiAssayExperiment/).\n\n\u003c!-- pyscaffold-notes --\u003e\n\n## Note\n\nThis project has been set up using PyScaffold 4.5. For details and usage\ninformation on PyScaffold see https://pyscaffold.org/.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiocpy%2Fmultiassayexperiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiocpy%2Fmultiassayexperiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiocpy%2Fmultiassayexperiment/lists"}