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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 665f80ff4a5ca27f21b598f61bfcf2af7c9126e2ae8bbd6960cd78cc0bd37a64 |
|
MD5 | 74666e4fb3f2fa11b778e3ad478dac66 |
|
BLAKE2b-256 | 826e4f2f6f9388c4362b78f860106b46c51b9ec92c556b9b893a1567eb7119bc |
Hashes for SummarizedExperiment-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a54fbaf2678592bfb3efbe3c138fd4e7c58d82130b419297b4f8b9064ba6648 |
|
MD5 | cbc8dc97e543bc49afbd75dcd9291439 |
|
BLAKE2b-256 | 930df63ec4bdb02adb98cdcf0858c1f781cb870b7226137f6a85c99f44adc038 |