Container class for representing and managing multi-omics genomic experiments
Project description
MultiAssayExperiment
Container 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.
Install
To get started, install the package from PyPI
pip install multiassayexperiment
Usage
An MAE contains three main entities,
-
Primary information (
column_data): Bio-specimen/sample information. Thecolumn_datamay provide information about patients, cell lines, or other biological units. Each row in this table represents an independent biological unit. It must contain anindexthat maps to the 'primary' insample_map. -
Experiments (
experiments): Genomic data from each experiment. either aSingleCellExperiment,SummarizedExperiment,RangedSummarizedExperimentor any class that extends aSummarizedExperiment. -
Sample Map (
sample_map): Map biological units fromcolumn_datato the list ofexperiments. Must contain columns,- assay provides the names of the different experiments performed on the biological units. All experiment names from experiments must be present in this column.
- primary contains the sample name. All names in this column must match with row labels from col_data.
- colname is the mapping of samples/cells within each experiment back to its biosample information in col_data.
Each sample in
column_datamay map to one or more columns per assay.
Let's start by first creating few experiments:
from random import random
import numpy as np
from biocframe import BiocFrame
from genomicranges import GenomicRanges
from iranges import IRanges
nrows = 200
ncols = 6
counts = np.random.rand(nrows, ncols)
gr = GenomicRanges(
seqnames=[
"chr1",
"chr2",
"chr2",
"chr2",
"chr1",
"chr1",
"chr3",
"chr3",
"chr3",
"chr3",
] * 20,
ranges=IRanges(range(100, 300), range(110, 310)),
strand = ["-", "+", "+", "*", "*", "+", "+", "+", "-", "-"] * 20,
mcols=BiocFrame({
"score": range(0, 200),
"GC": [random() for _ in range(10)] * 20,
})
)
col_data_sce = BiocFrame({"treatment": ["ChIP", "Input"] * 3},
row_names=[f"sce_{i}" for i in range(6)],
)
col_data_se = BiocFrame({"treatment": ["ChIP", "Input"] * 3},
row_names=[f"se_{i}" for i in range(6)],
)
sample_map = BiocFrame({
"assay": ["sce", "se"] * 6,
"primary": ["sample1", "sample2"] * 6,
"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"]
})
sample_data = BiocFrame({"samples": ["sample1", "sample2"]}, row_names= ["sample1", "sample2"])
Finally, we can create an MultiAssayExperiment object:
from multiassayexperiment import MultiAssayExperiment
from singlecellexperiment import SingleCellExperiment
from summarizedexperiment import SummarizedExperiment
tsce = SingleCellExperiment(
assays={"counts": counts}, row_data=gr.to_pandas(), column_data=col_data_sce
)
tse2 = SummarizedExperiment(
assays={"counts": counts.copy()},
row_data=gr.to_pandas().copy(),
column_data=col_data_se.copy(),
)
mae = MultiAssayExperiment(
experiments={"sce": tsce, "se": tse2},
column_data=sample_data,
sample_map=sample_map,
metadata={"could be": "anything"},
)
## output
class: MultiAssayExperiment containing 2 experiments
[0] sce: SingleCellExperiment with 200 rows and 6 columns
[1] se: SummarizedExperiment with 200 rows and 6 columns
column_data columns(1): ['samples']
sample_map columns(3): ['assay', 'primary', 'colname']
metadata(1): could be
For more use cases, checkout the documentation.
Note
This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multiassayexperiment-0.6.0.tar.gz.
File metadata
- Download URL: multiassayexperiment-0.6.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb8cb60e2e6bd9d20817d13260df3e8d6f6d0837bdcc147a33d6dcd1490adff5
|
|
| MD5 |
8949325130aac6c0087af73034229a54
|
|
| BLAKE2b-256 |
f49c7684be05c45a33fc06fe2c6d7af03fdce371d4db069a2513b6de34d39865
|
Provenance
The following attestation bundles were made for multiassayexperiment-0.6.0.tar.gz:
Publisher:
publish-pypi.yml on BiocPy/MultiAssayExperiment
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multiassayexperiment-0.6.0.tar.gz -
Subject digest:
eb8cb60e2e6bd9d20817d13260df3e8d6f6d0837bdcc147a33d6dcd1490adff5 - Sigstore transparency entry: 789958349
- Sigstore integration time:
-
Permalink:
BiocPy/MultiAssayExperiment@43f749e281f4472c540f3e1a1640b2098f6011c1 -
Branch / Tag:
refs/tags/0.6.0 - Owner: https://github.com/BiocPy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@43f749e281f4472c540f3e1a1640b2098f6011c1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file multiassayexperiment-0.6.0-py3-none-any.whl.
File metadata
- Download URL: multiassayexperiment-0.6.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c56fd34dbcb7c6060f01a48458c4e50c24cb8262ff19270a899081a21e34e242
|
|
| MD5 |
49fa60fb51c40db9866a657b7e82c120
|
|
| BLAKE2b-256 |
88c4700a4b24b2b0f81d8e2560e7072fbdb2dfc4073750167b2f7a3b570cc701
|
Provenance
The following attestation bundles were made for multiassayexperiment-0.6.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on BiocPy/MultiAssayExperiment
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multiassayexperiment-0.6.0-py3-none-any.whl -
Subject digest:
c56fd34dbcb7c6060f01a48458c4e50c24cb8262ff19270a899081a21e34e242 - Sigstore transparency entry: 789958352
- Sigstore integration time:
-
Permalink:
BiocPy/MultiAssayExperiment@43f749e281f4472c540f3e1a1640b2098f6011c1 -
Branch / Tag:
refs/tags/0.6.0 - Owner: https://github.com/BiocPy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@43f749e281f4472c540f3e1a1640b2098f6011c1 -
Trigger Event:
push
-
Statement type: