This release is a pre-release and may not be stable for production use.
genedataset
genedataset is a package to store and access gene expression datasets and gene definitions. It consists of two main classes, geneset and dataset.
Changes in version 1.0
Some significant changes have been made in this version: 1. “MedianTranscriptLength” property of Geneset has been replaced with “TranscriptLengths”, which holds a list of transcript lengths, one per transcript (eg. [2000,1530]). Note that the value contained is a string, so convert into a list of integers before using the value. 2. The Gene annotation has been upgraded to Ensembl version 88. 3. Dataset no longer supports microarrays, so it’s been simplified, so related methods are deprecated. 4. The package supports both python 3 and 2 - tested on 2.7.14 and 3.6.3.
Installation
pip install -e genedataset
geneset
geneset stores gene information combined from both Ensembl and NCBI/Entrez (mouse and human only), so that you can query it:
from genedataset import geneset
gs = geneset.Geneset().subset(queryStrings='ccr3')
print(gs.geneIds())
['ENSG00000183625', 'ENSMUSG00000035448']
gs.dataframe()
Ensemb lId |
Specie s |
Entrez Id |
GeneSy mbol |
Synony ms |
Descri ption |
Transc riptLe ngths |
Orthol ogue |
|---|---|---|---|---|---|---|---|
ENSG00 000183 625 |
HomoSa piens |
1232 |
CCR3 |
CC-CKR -3 |
CD193 |
CKR3 |
CMKBR3 |
ENSMUS G00000 035448 |
MusMus culus |
12771 |
Ccr3 |
CC-CKR 3 |
CKR3 |
Cmkbr1 l2 |
Cmkbr3 |
dataset
dataset can store gene expression data so that it can be queried. The stored data consists of expression values (usually rna-seq) and sample data packaged into HDF5 format.
from genedataset import dataset
ds = dataset.Dataset("genedataset/data/testdata.1.0.h5")
ds
<Dataset name:testdata 4 samples>
ds.expressionMatrix()
featureId |
s01 |
s02 |
s03 |
s04 |
|---|---|---|---|---|
gene1 |
3.45 |
4.65 |
2.65 |
8.23 |
gene2 |
5.54 |
0.00 |
1.43 |
6.43 |
gene3 |
0.00 |
0.00 |
4.34 |
5.44 |
ds.sampleTable()
sampleId |
celltype |
tissue |
|---|---|---|
s01 |
B1 |
BM |
s02 |
B1 |
BM |
s03 |
B2 |
BM |
s04 |
B2 |
BM |
Dataset creation example
Here is an example to create a Dataset file from text files. Once the file has been created, it can be accessed through the Dataset instance. The advantage of this is to store all related information for a dataset in one file, and gives you a python object that can be used for analyses and for application development.
import pandas
from genedataset import dataset
attributes = {"name": "testdata",
"fullname": "Test Dataset",
"version": "1.0",
"description": "This dataset comes with the package for testing purposes.",
"expression_data_keys": ["counts","cpm"],
"pubmed_id": None,
"species": "MusMusculus"}
samples = pandas.DataFrame([['B1', 'BM'], ['B1', 'BM'], ['B2', 'BM'], ['B2', 'BM']],
index=['s01','s02','s03','s04'],
columns=['celltype','tissue'])
samples.index.name = "sampleId"
counts = pandas.DataFrame([[35, 44, 21, 101], [50, 0, 14, 62], [0, 0, 39, 73]],
index=['gene1', 'gene2', 'gene3'], columns=['s01', 's02', 's03', 's04'])
counts.index.name = "geneId"
cpm = pandas.DataFrame([[3.45, 4.65, 2.65, 8.23], [5.54, 0.0, 1.43, 6.43], [0.0, 0.0, 4.34, 5.44]],
index=['gene1', 'gene2', 'gene3'], columns=['s01', 's02', 's03', 's04'])
cpm.index.name = "geneId"
dataset.createDatasetFile("/datasets", attributes=attributes, samples=samples, expressions=[counts,cpm])
Contact
Jarny Choi, University of Melbourne
e-mail: jarnyc@unimelb.edu.au
Changes
v1.0 - Major upgrade.
v0.1.x - Initial release with minor adjustments to test pypi and github upload/download.
License
Metadata
Release files for genedataset 1.0.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| genedataset-1.0.0a2.tar.gz | 4.1 MB | Without provenance | Details for genedataset-1.0.0a2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| genedataset-1.0.0a2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for genedataset-1.0.0a2-py2.py3-none-any.whl |
Total release size: 8.4 MB
Release files / genedataset-1.0.0a2.tar.gz
| Download URL | genedataset-1.0.0a2.tar.gz |
|---|---|
| Size | 4.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
481fcb6f7f3852e28c9b49851cfbda6da0cd82aba1862e4bab373f059b0cc30c
|
|
BLAKE2b-256 checksum How to use checksums |
39e67e249523960734828f3d3d4b72039048a06754e696b01b569b263af1d669
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / genedataset-1.0.0a2-py2.py3-none-any.whl
| Download URL | genedataset-1.0.0a2-py2.py3-none-any.whl |
|---|---|
| Size | 4.2 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
519f201a22b58999d9cf752d1d672d7fb7130b02de78e18b0a1676baac875c89
|
|
BLAKE2b-256 checksum How to use checksums |
f8db725c9d1b866eea88728a00e88fe6ab59493c143b8348a3bed6981214204e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for genedataset 1.0.0a2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.