Skip to main content

bioflex: Python package for calling BioTuring API

bioflex allows scientists to use simple yet powerful commands to retrieve gene expression data,
cell metadata from thousands of single-cell studies in BioTuring Database.

Installation

pip install bioflex

For access token, register at BioTuring Data Science

Requirements

Examples

Create a connection using access token:

import bioflex
connection = bioflex.connect('70d2acfda3a54ca6a4390699394****')

List available databases:

databases = connection.databases()
[DataBase(id="5010c7d573ae4ff2b9691422b99aa2cd",
          name="BioTuring database",species="human",version=1),
DataBase(id="5010c7d573ae4ff2b9691422b99aa2cd",
          name="BioTuring database",species="human",version=2),
DataBase(id="5010c7d573ae4ff2b9691422b99aa2cd",
          name="BioTuring database",species="human",version=3)]

Get database cell types gene expression summary

database = databases[2]
database.get_celltypes_expression_summary(['CD3D', 'CD3E'])
{'CD3D': [Summary(name="B cell",sum=707108874.0,mean=4192.7096,rate=0.035,count=168652.0,total=4812967),
	Summary(name="CD4-positive, alpha-beta T cell",sum=9489987442.0,mean=4657.5619,rate=0.5283,count=2037544.0,total=3856590),
	...
	Summary(name="corneal progenitor",sum=0.0,mean=0.0,rate=0.0,count=0.0,total=3973),
	Summary(name="nucleus pulposus progenitor cell",sum=0.0,mean=0.0,rate=0.0,count=0.0,total=2310)]}

Create study instance, using study hash ID from BioTuring studies:

study = database.get_study('GSE96583_batch2')
study
Study(id="GSE96583_batch2",
      title="Multiplexed droplet single-cell RNA-sequencing using natural genetic variation (Batch 2)",
      reference="https://www.nature.com/articles/nbt.4042")

Take a peek at study metadata:

study.metalist
[Metadata(id=0,name="Number of mRNA transcripts",type="Numeric"),
 Metadata(id=1,name="Number of genes",type="Numeric"),
 Metadata(id=2,name="Batch id",type="Category"),
 Metadata(id=3,name="Stimulation",type="Category"),
 Metadata(id=4,name="Author's cell type",type="Category")]

Fetch a study metadata:

metadata = study.metalist[4]
metadata
Metadata(id=4,name="Author's cell type",type="Category")
metadata.fetch()
metadata.values
array(['CD8 T cells', 'Dendritic cells', 'CD4 T cells', ...,
       'CD8 T cells', 'B cells', 'CD4 T cells'], dtype='<U17')

Query genes:

exp_mtx = study.query_genes(['CD3D', 'CD3E'], bioflex.UNIT_LOGNORM)
exp_mtx
<29065x2 sparse matrix of type '<class 'numpy.float32'>'
    with 15492 stored elements in Compressed Sparse Column format>

Get study barcodes:

study.barcodes()
['GSM2560249_AAACATACCAAGCT-1',
 'GSM2560249_AAACATACCCCTAC-1',
 ...
 'GSM2560249_AATTGTGATTCACT-1',
 'GSM2560249_AATTGTGATTTCGT-1',
 ...]

Get study features:

study.features()
['5S_RRNA',
 '5_8S_RRNA',
 ...
 'AC006273',
 'AC006277',
 ...]

Get study full matrix:

study.matrix(bioflex.UNIT_LOGNORM)
<29065x64642 sparse matrix of type '<class 'numpy.float32'>'
	with 17570739 stored elements in Compressed Sparse Column format>

Export Study:

study.export_study(bioflex.EXPORT_H5AD)
{'download_link': 'https://talk2data.bioturing.com/api/export/a1003bad3dd146b28c7bda913a2fc3f0',
'study_hash_id': 'GSE96583_batch2'}

For further information please check the documentation.

Metadata

Release files for bioflex 1.1.1

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

Source distribution (sdist)

Source distribution for bioflex 1.1.1
File Size Uploaded
bioflex-1.1.1.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bioflex 1.1.1
File Interpreter ABI Platform
bioflex-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.2 kB

Release files / bioflex-1.1.1.tar.gz

Download URL bioflex-1.1.1.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9d6e4ba9f92dac3e418f9e0577c1cccda2afd4a613d757470bd7021d363fa676
BLAKE2b-256 checksum
How to use checksums
8339e6ca99181ac3986034a377ab5b78b62776d455cf8d7942c5c8ebb66c7667
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / bioflex-1.1.1-py3-none-any.whl

Download URL bioflex-1.1.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
783a430d78155c155812f43b14b90286be7ceed04e7475fbf762bcf21afcd8e9
BLAKE2b-256 checksum
How to use checksums
8ebe5a0b8fff3049e9e7d9b0b0fe3eb6ef9bbbe65dca158896edfb62dfbe05f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.0.0

2 release files

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