SummarizedExperiment
Container to represent genomic experiments, follows Bioconductor's SummarizedExperiment.
Install
Package is published to PyPI,
pip install summarizedexperiment
Usage
Currently supports SummarizedExperiment & RangedSummarizedExperiment 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.from_pandas(df_gr)
colData = pd.DataFrame(
{
"treatment": ["ChIP", "Input"] * 3,
}
)
To create a SummarizedExperiment,
from summarizedexperiment import SummarizedExperiment
tse = SummarizedExperiment(
assays={"counts": counts}, row_data=df_gr, col_data=colData
)
To create a RangedSummarizedExperiment
from summarizedexperiment import RangedSummarizedExperiment
trse = RangedSummarizedExperiment(
assays={"counts": counts}, row_ranges=gr, col_data=colData
)
For more examples, checkout the documentation.
Note
This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.
Release files for summarizedexperiment 0.3.6
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.3.6.tar.gz | 1.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| SummarizedExperiment-0.3.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.0 MB
Release files / SummarizedExperiment-0.3.6.tar.gz
| Download URL | SummarizedExperiment-0.3.6.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b851b59452b716eaef6e3d8bb42aea509a9abc04962a95e29320942e12a1580
|
|
BLAKE2b-256 checksum How to use checksums |
1e702fadcd27e08e43e322c581d28f23e73a4514c02f15500b9a5eef2449efa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / SummarizedExperiment-0.3.6-py3-none-any.whl
| Download URL | SummarizedExperiment-0.3.6-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f58f2d7cac00986cad3e5dfae3085e18cd4d8fd1a67cb0fc62e6fd5f71f1228
|
|
BLAKE2b-256 checksum How to use checksums |
24dc9803692b8e81c2e2d4767cd2c0bfbd7cb3c4f7ca68051e012b7346df9bf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|