Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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()

 | EnsemblId          | Species     | EntrezId | GeneSymbol | Synonyms                     | Description                      | TranscriptLengths                             | Orthologue              |
 |--------------------|:-----------:|---------:|-----------:|-----------------------------:|---------------------------------:|----------------------------------------------:|------------------------:|
 | ENSG00000183625    | HomoSapiens | 1232     | CCR3       | CC-CKR-3|CD193|CKR3|CMKBR3   | C-C motif chemokine receptor 3   | [2000, 1581, 400, 436, 212, 1284, 1201, 1786] | ENSMUSG00000035448:Ccr3 |
 | ENSMUSG00000035448 | MusMusculus | 12771    | Ccr3       | CC-CKR3|CKR3|Cmkbr1l2|Cmkbr3 | chemokine (C-C motif) receptor 3 | [3272]                                        | ENSG00000183625:CCR3    |

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

Changes

  • v1.0 - Major upgrade.

  • v0.1.x - Initial release with minor adjustments to test pypi and github upload/download.

License

MIT License

Metadata

Release files for genedataset 1.0.0a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genedataset 1.0.0a3
File Size Uploaded Provenance Actions
genedataset-1.0.0a3.tar.gz 4.1 MB Without provenance Details for genedataset-1.0.0a3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for genedataset 1.0.0a3
File Interpreter ABI Platform Actions
genedataset-1.0.0a3-py2.py3-none-any.whl Python 2, Python 3 none any Details for genedataset-1.0.0a3-py2.py3-none-any.whl

Total release size: 8.4 MB

Release files / genedataset-1.0.0a3.tar.gz

Download URL genedataset-1.0.0a3.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
530a922441cc27a56e5faa752571fd13577afc8db4f71a4e5caa940cb9c169e2
BLAKE2b-256 checksum
How to use checksums
f22b035825347a03bd3e3bfaf4298e08b62f6fd2467b2ebce4363f03ba6f29d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / genedataset-1.0.0a3-py2.py3-none-any.whl

Download URL genedataset-1.0.0a3-py2.py3-none-any.whl
Size 4.2 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e8aa03345a4300ee378337c9f233e8a8ceb1251f70ab308f334b7b209696ab2f
BLAKE2b-256 checksum
How to use checksums
0063cbac6aaed6e51c4d0ccd7c4912f1a2aaa615e64fe47da1febf07115fc60f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for genedataset 1.0.0a3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page