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
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
MultiAssayExperiment-0.2.3.tar.gz
(97.3 kB
view hashes)
Built Distribution
Close
Hashes for MultiAssayExperiment-0.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee6e0b144dce80183792a016b54948b395b511f112699fb0ce1496261509465f |
|
MD5 | c8fc43bcb5d4390c95fbc035d9aec01d |
|
BLAKE2b-256 | b4a56b3014e63a01ef5f3f3018126d0ffd5cec082fd72f821990c23d30158d59 |
Close
Hashes for MultiAssayExperiment-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b54796cf8f480fed54a33c77224184a4cf23ded0f5d5df5b3a1d1baef6a1d01 |
|
MD5 | f1774b3002c3e0e72d16b972957bf2a8 |
|
BLAKE2b-256 | d170cba7108338fe41de87ce1b35e103e32255fcf6f3fe765afafa9ff2e6c29f |