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
& 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/.
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.2.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9ccfe4988782024b312e3a5277508bd86174e6d87d046875fbefb9026fd1232 |
|
MD5 | 56ccd123bcb7dd813eaee14fd418cd62 |
|
BLAKE2b-256 | e39bf75b9e57643d4d7a026dbacad30c6e4e95f117398006626551451902ba4d |
Close
Hashes for SummarizedExperiment-0.2.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97848859dff87b988970735b10f3f9fdda7382ad7ae66ffeb10f7a55b34646e9 |
|
MD5 | 38f6922a180b2f6dcad80f74541205e8 |
|
BLAKE2b-256 | d8c789ad697b35e9a3f66adab758e0e937d042ee8406b7174c1befb6eed615ef |