Skip to main content

pyJASPAR

A Pythonic interface to JASPAR transcription factor motifs

pyJASPAR uses Biopython and SQLite3 to provide a serverless interface to JASPAR database to query and access TF motif profiles across various releases of JASPAR.

https://zenodo.org/badge/DOI/10.5281/zenodo.4509415.svg https://travis-ci.org/asntech/pyjaspar.svg?branch=main https://img.shields.io/pypi/pyversions/pyjaspar.svg https://img.shields.io/pypi/v/pyjaspar.svg https://anaconda.org/bioconda/pyjaspar/badges/version.svg https://anaconda.org/bioconda/pyjaspar/badges/downloads.svg https://img.shields.io/github/issues/asntech/pyjaspar.svg

pyJASPAR provides access to the following releases of JASPAR database: JASPAR2026, JASPAR2024, JASPAR2022, JASPAR2020, JASPAR2018, JASPAR2016, JASPAR2014.

Note: This is a serverless SQLite wrapper around the Biopython JASPAR module Bio.motifs.jaspar.db which requires JASPAR MySQL database sever connection details.

Documentation

A detailed documentation is available in different formats: HTML | PDF | ePUB

Installation

Note: The JASPAR2026 release is available for peer-review purpose via GitHub only. It will be made public after the official release of JASPAR2026 database.

Quick installation using conda

pyJASPAR is available on Bioconda for installation via conda.

conda install -c bioconda pyjaspar

Install using pip

pyJASPAR is also available on PyPi for installation via pip.

pip install pyjaspar

pyJASPAR uses BioPython and it supports python 3.x.

Install pyjaspar from source

You can install a development version by using git from GitHub.

Install development version from GitHub

If you have git installed, use this:

git clone https://github.com/asntech/pyjaspar.git
cd pyjaspar
python setup.py sdist install

How to use pyJASPAR?

Once you have installed pyjaspar, you can create jaspardb class object:

>>> from pyjaspar import jaspardb

#Create the JASPAR2026 release object
>>> jdb_obj = jaspardb(release='JASPAR2026')

#Fetch motif by ID
>>> motif = jdb_obj.fetch_motif_by_id('MA0095.2')
>>> print(motif.name)
YY1

#Fetch motifs by TF name
>>> motifs = jdb_obj.fetch_motifs_by_name('KFL4')
>>> print(len(motifs))
1

# Get a dictionary of frequency count matrics
>>> print(motifs[0].counts)
{'A': [2465.0, 2105.0, 7021.0, 1173.0, 45602.0, 852.0, 1617.0, 1202.0],
'C': [49209.0, 47865.0, 45405.0, 52875.0, 161.0, 52366.0, 51112.0, 51045.0],
'G': [1583.0, 1214.0, 1422.0, 793.0, 6598.0, 1470.0, 1870.0, 1005.0],
'T': [2560.0, 4633.0, 1969.0, 976.0, 3456.0, 1129.0, 1218.0, 2565.0]}

#Get CORE vertebrates non-redundent collection
>>> motifs = jdb_obj.fetch_motifs(
        collection = ['CORE'],
        tax_group = ['Vertebrates'],
        all_versions = False)
>>> print(len(motifs))
1019
## loop through the motifs list and perform analysis
>>> for motif in motifs:
        pass

Note: Above methods return Bio.motifs.jaspar.Motif object. You can find more details here

Find available releases

>>> print(jdb_obj.get_releases())
['JASPAR2026', 'JASPAR2024','JASPAR2022','JASPAR2020', 'JASPAR2018', 'JASPAR2016', 'JASPAR2014']

Cite

  • Aziz Khan. pyJASPAR: a Pythonic interface to JASPAR transcription factor motifs. (2021). Zenodo, doi:10.5281/zenodo.4485856

@software{aziz_khan_2021_4509415,
  author       = {Aziz Khan},
  title        = {{pyJASPAR: a Pythonic interface to JASPAR transcription factor motifs}},
  month        = feb,
  year         = 2021,
  publisher    = {Zenodo},
  version      = {v4.0.0},
  doi          = {10.5281/zenodo.4485856},
  url          = {https://doi.org/10.5281/zenodo.4485856}
}

Metadata

Release files for pyjaspar 4.0.0

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

Source distribution (sdist)

Source distribution for pyjaspar 4.0.0
File Size Uploaded
pyjaspar-4.0.0.tar.gz 57.0 MB Details

Built distribution (wheel)

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

Total release size: 114.2 MB

Release files / pyjaspar-4.0.0.tar.gz

Download URL pyjaspar-4.0.0.tar.gz
Size 57.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b31893b0791770c044f2b7b424d89abe7cca6d698fe98467bc1cd276a7a2cd90
BLAKE2b-256 checksum
How to use checksums
e4b6df3470cb7bda17a3cc5afa6e0d5e165db9662ec11efa6e95bdcc9ef967b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release files / pyjaspar-4.0.0-py3-none-any.whl

Download URL pyjaspar-4.0.0-py3-none-any.whl
Size 57.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
01b393f668c3cb552d3d58262a50005b1410e389e0a6bf5d570e976fbdaf01b3
BLAKE2b-256 checksum
How to use checksums
5eafc5112b33abd99c9f296cdc552cca9e0915e7b905dc3e4c99f7b91f442bb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

3.0.0

1 release file

2.1.1

2 release files

2.1.0

1 release file

2.0.0

1 release file

1.6.0

2 release files

1.5.5

1 release file

1.5.0

1 release file

1.0.0

1 release file

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