Container to represent data from genomic experiments
Project description
SummarizedExperiment
Container to represent data from genomic experiments, follows Bioconductor's SummarizedExperiment. It uses efficient structures already available in the Pandas/numpy eco-system & adds a familiar interface.
Install
Package is published to PyPI
pip install summarizedexperiment
Usage
Currently supports both SummarizedExperiment
& RangeSummarizedExperiment
objects
First create necessary sample data
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 = pd.DataFrame(
{
"treatment": ["ChIP", "Input"] * 3,
}
)
To create a SummarizedExperiment
,
tse = SummarizedExperiment(
assays={"counts": counts}, rowData=df_gr, colData=colData
)
To create a RangeSummarizedExperiment
trse = SummarizedExperiment(
assays={"counts": counts}, rowRanges=gr, colData=colData
)
For more use cases including subset, 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
Built Distribution
Hashes for SummarizedExperiment-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22c5ce380f9aa9debad1a7d1ffbb9b9ff88812e44fb358d67f5cc68b8127a151 |
|
MD5 | dbf79e907e9b615c37d4d45450f3a7cc |
|
BLAKE2b-256 | 1a7858d8654c5302fcb0d136903ccab0a1bd8beba8ebb7a2f4bf08e38703d513 |
Hashes for SummarizedExperiment-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2181d1b3de2171adef7c589aa009f1f92a3f8b7de26195522601e21c8e7b0f3e |
|
MD5 | ece2b8322e99ce49d1a6f78b8980120a |
|
BLAKE2b-256 | da19552a0282e766e520214ff3d5dd43486b8a1b658d7e2cc96ce9f1dfcaeb55 |