SummarizedExperiment
Container to represent genomic experiments, follows Bioconductor's SummarizedExperiment.
Install
Package is published to PyPI
pip install summarizedexperiment
Usage
Currently supports SummarizedExperiment & RangeSummarizedExperiment classes
First create necessary 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 = pd.DataFrame(
{
"treatment": ["ChIP", "Input"] * 3,
}
)
To create a SummarizedExperiment,
from summarizedexperiment import SummarizedExperiment
tse = SummarizedExperiment(
assays={"counts": counts}, rowData=df_gr, colData=colData
)
To create a RangeSummarizedExperiment
from summarizedexperiment import RangeSummarizedExperiment
trse = RangeSummarizedExperiment(
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/.
Release files for summarizedexperiment 0.2.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| SummarizedExperiment-0.2.14.tar.gz | 1.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| SummarizedExperiment-0.2.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.0 MB
Release files / SummarizedExperiment-0.2.14.tar.gz
| Download URL | SummarizedExperiment-0.2.14.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ebd25866c62c397e1e1c82521510d4772234e0032200c3fde78f977946dc64ce
|
|
BLAKE2b-256 checksum How to use checksums |
d7d5bec669b339f0331570a9edf93eda11f341b14b0fe5f99051192ec49ca092
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / SummarizedExperiment-0.2.14-py3-none-any.whl
| Download URL | SummarizedExperiment-0.2.14-py3-none-any.whl |
|---|---|
| Size | 21.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7e5fdd1d7baf9c23f53d5f98f8b8738fdff9c6b6adfad1e506fcc0a0acdc870
|
|
BLAKE2b-256 checksum How to use checksums |
51885264e72fbcc86c45c35cb012215fd6595cea0fac1b055c64bf2863e333c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|