Skip to main content

A python package for managing single-cell RNA-seq datasets.

Project description

SingleCell

SingleCell is a python class available in the singlecelldata package for managing single-cell RNA-seq data. It contains three pandas dataframes; data for holding gene expression values (counts/normalized counts), genedata for holding more information about the genes e.g., gene names, and celldata which contains more information about cells such as cell types, labels etc.

Installation

The singlecelldata package can be easily installed using the following command:

pip install singlecelldata

Documentation

The SingleCell class reference manual can be found here

Using the SingleCell class

Basic Example

The SingleCell class can be used to create an object which stores single-cell gene expression data and additional data about genes and cells in their respective dataframes. To create a SingleCell object sc, the following python code can be used:

import pandas as pd
from singlecelldata import SingleCell

dataset = 'biase'

data_path = "data/" + dataset + '/' + dataset + "_data.csv"
celldata_path = "data/" + dataset + '/' + dataset + "_celldata.csv"
genedata_path = "data/" + dataset + '/' + dataset + "_genedata.csv"

# Create pandas dataframes by reading data from files
data = pd.read_csv(data_path, index_col=0)
celldata = pd.read_csv(celldata_path, index_col=0)
genedata = pd.read_csv(genedata_path, index_col = 0)

# Create a single cell object
sc = SingleCell(dataset, data, celldata, genedata)

In the above example, a SingleCell object, sc, was ceated by passing the dataset name and the main data, the cell data and gene data as Pandas dataframes. Pandas is a powerpul python library for creating data structures from a variety of sources. Pandas can open and read data from numerous differernt file types such as csv files and creating dataframes from it. This enables the user to create SingleCell objects from a variety of different data file types.

Detailed Example

More detailed example can be found here

Contact

Contact the author on vans.edw@gmail.com to give feedback/suggestions for further improvements and to report issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

singlecelldata-1.0.1.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

singlecelldata-1.0.1-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page