Container to represent data from genomic experiments
Project description
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/.
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
Close
Hashes for SummarizedExperiment-0.3.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77c55b6797cafd2935e6722a01ed6d0add69a5d50f67ebd371a78b55a2670980 |
|
MD5 | 2985c8258bfc81d972cf6cd0bc05bd36 |
|
BLAKE2b-256 | 01fc07a3d27d8e1a94182770341329facb288798aeb7c0c9f48dbd3583a768ee |
Close
Hashes for SummarizedExperiment-0.3.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bad8cbee963b065379685fbdc8d49f3709fa56620e0227996b3c53c9c985894f |
|
MD5 | faf99a150a7a5c900314f0e3156e941c |
|
BLAKE2b-256 | e64cd2b42f150a8cf4595dd756812f69b416e6cdfa49d551bad1f510b87e1fe2 |