Skip to main content

MultiAssayExperiment

Container class to represent multiple experiments and assays performed over a set of samples. follows Bioconductor's MAE R/Package.

Install

Package is published to PyPI

pip install multiassayexperiment

Usage

First create mock sample data

import pandas as pd
import numpy as np
from genomicranges import GenomicRanges

nrows = 200
ncols = 6
counts = np.random.rand(nrows, ncols)
df_gr = pd.DataFrame(
    {
        "seqnames": [
            "chr1",
            "chr2",
            "chr2",
            "chr2",
            "chr1",
            "chr1",
            "chr3",
            "chr3",
            "chr3",
            "chr3",
        ]
        * 20,
        "starts": range(100, 300),
        "ends": range(110, 310),
        "strand": ["-", "+", "+", "*", "*", "+", "+", "+", "-", "-"] * 20,
        "score": range(0, 200),
        "GC": [random() for _ in range(10)] * 20,
    }
)

gr = GenomicRanges.fromPandas(df_gr)

colData_sce = pd.DataFrame(
    {
        "treatment": ["ChIP", "Input"] * 3,
    },
    index=["sce"] * 6,
)

colData_se = pd.DataFrame(
    {
        "treatment": ["ChIP", "Input"] * 3,
    },
    index=["se"] * 6,
)

sample_map = pd.DataFrame(
    {
        "assay": ["sce", "se"] * 6,
        "primary": ["sample1", "sample2"] * 6,
        "colname": ["sce", "se"] * 6,
    }
)

sample_data = pd.DataFrame({"samples": ["sample1", "sample2"]})

Now we can create an instance of an MAE -

from multiassayexperiment import MultiAssayExperiment
from singlecellexperiment import SingleCellExperiment
from summarizedExperiment import SummarizedExperiment

tsce = SingleCellExperiment(
    assays={"counts": counts}, rowData=df_gr, colData=colData_sce
)

tse2 = SummarizedExperiment(
    assays={"counts": counts.copy()},
    rowData=df_gr.copy(),
    colData=colData_se.copy(),
)

mae = MultiAssayExperiment(
    experiments={"sce": tsce, "se": tse2},
    colData=sample_data,
    sampleMap=sample_map,
    metadata={"could be": "anything"},
)

For more use cases, checkout the documentation.

Note

This project has been set up using PyScaffold 4.1.1. For details and usage information on PyScaffold see https://pyscaffold.org/.

Release files for multiassayexperiment 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multiassayexperiment 0.2.4
File Size Uploaded
MultiAssayExperiment-0.2.4.tar.gz 97.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for multiassayexperiment 0.2.4
File Interpreter ABI Platform
MultiAssayExperiment-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 109.2 kB

Release files / MultiAssayExperiment-0.2.4.tar.gz

Download URL MultiAssayExperiment-0.2.4.tar.gz
Size 97.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b7a8f18b96db9377be09b6e424e60847f1265f55856c75c5093ce7d7301eefc6
BLAKE2b-256 checksum
How to use checksums
ea18c47e57c660db9276acf70b16b24bfd949d57546f93b229580c940b5a01f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / MultiAssayExperiment-0.2.4-py3-none-any.whl

Download URL MultiAssayExperiment-0.2.4-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad99013de1bf3e04abbeb0d27b6cc02185a2cc693f636e49230a0b5a0460d059
BLAKE2b-256 checksum
How to use checksums
c1799494aae5af756587b06947cfb751285289fff797418f67b761b934e4818f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page