Skip to main content

Container class to represent multiple experiments and assays performed over a set of samples

Project description

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/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MultiAssayExperiment-0.2.2.tar.gz (97.1 kB view details)

Uploaded Source

Built Distribution

MultiAssayExperiment-0.2.2-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file MultiAssayExperiment-0.2.2.tar.gz.

File metadata

  • Download URL: MultiAssayExperiment-0.2.2.tar.gz
  • Upload date:
  • Size: 97.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for MultiAssayExperiment-0.2.2.tar.gz
Algorithm Hash digest
SHA256 383fbe85dc7c69026e9b4df6c5b067bdb65e419aeaf88db89f467239ff11a0b7
MD5 cf90746e5c65c1962e34e345ce4dacfb
BLAKE2b-256 ca1d74e2e0e676c83be762489e776eaf1f5d70856c0850bb8e4ae69026798ea9

See more details on using hashes here.

File details

Details for the file MultiAssayExperiment-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for MultiAssayExperiment-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8011f2b5e57c16d86a1431bd3d6474b0ac2847defc013fd2299943de3d6ed03c
MD5 a02c7c2acb216ccd662b1d1f87f1ae31
BLAKE2b-256 fc4517e31cc6efee409f34c71002ef02b2206cf72d2f6d6ec32a8fb11890fa6a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page