Skip to main content

Tools to access CHADO databases

Project description

chado-tools

Python3 command line script providing various tools for accessing CHADO databases.

Build Status
License: GPL v3
install with bioconda
Container ready
codecov

Contents

Installation

There are a number of ways to install chado-tools and details are provided below. If you encounter an issue when installing chado-tools please contact your local system administrator. If you encounter a bug please log it here or email us at path-help@sanger.ac.uk.

Required dependencies

  • Python 3.6
  • PostgreSQL 9.6 or higher

From source

Download the latest release from this github repository, or clone the repository to obtain the most recent updates. Then install the software:

python3 setup.py install

NOTE: Some of the integration tests rely on temporary PostgreSQL databases. In order to successfully run those tests, modify the default connection settings such that they describe an existing PostgreSQL database server to which you can connect. The tests can then be run as

python3 setup.py test

Using pip

You can install the program from the Python Package Index (PyPI) using the command

pip install chado-tools

Using Bioconda

The program is also available as Bioconda package. Install it with the command

conda install -c bioconda chado-tools

Usage

The installation will put a single script called chado in your PATH. The usage is:

chado <command> [options]
  • To list the available commands and brief descriptions, just run chado -h or chado --help.
  • To display the version of the program, type chado -v or chado --version.
  • Use chado <command> -h or chado <command> --help to get a detailed description and the usage of that command.

Database connection

You can set up default values for database host, port and user with environment variables. To do so, add the following lines to your .bashrc (replacing the example values):

export CHADO_HOST=localhost
export CHADO_PORT=5432
export CHADO_USER=chadouser

The software seeks for these environment variables on your system. If they do not exist, it will use the default connection settings, which you can edit manually if you really want.

By default the software will assume that no password is required to connect as the user specified as CHADO_USER. The flag -p enforces asking the user for a password.

Alternatively, you can supply your own YAML configuration file in the same format as the default file with flag -c (including password). The software will then ignore any environment variables.

Available commands


Command Description
connect connect to a CHADO database for an interactive session
query query a CHADO database and export the result into a text file
execute execute a function defined in a CHADO database
extract run a pre-compiled query against the CHADO database
insert insert a new entity of a specified type into the CHADO database
delete delete an entity of a specified type from the CHADO database
import import data from file into the CHADO database
export export data from the CHADO database to file
admin perform admin tasks, such as creating or dumping a CHADO database

Examples

Create a new CHADO database called eukaryotes according to the current GMOD schema:

chado admin create eukaryotes
chado admin setup -s gmod eukaryotes

Dump this database into an archive called eukaryotes.dump:

chado admin dump eukaryotes eukaryotes.dump

List all organisms in the eukaryotes database:

chado extract organisms eukaryotes

Query the database to check the meaning of a certain cvterm_id:

chado query -q "SELECT name FROM cvterm WHERE cvterm_id = 25" eukaryotes

Export a FASTA file containing the sequences of the organism Pfalciparum:

chado export fasta -a Pfalciparum -o Pfalciparum.fasta -t contigs eukaryotes

License

chado-tools is free software, licensed under GPLv3.

Feedback/Issues

Please report any issues to the issues page or email path-help@sanger.ac.uk.

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

chado-tools-0.2.12.tar.gz (118.3 kB view details)

Uploaded Source

Built Distribution

chado_tools-0.2.12-py3-none-any.whl (157.4 kB view details)

Uploaded Python 3

File details

Details for the file chado-tools-0.2.12.tar.gz.

File metadata

  • Download URL: chado-tools-0.2.12.tar.gz
  • Upload date:
  • Size: 118.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for chado-tools-0.2.12.tar.gz
Algorithm Hash digest
SHA256 259423a8ab7bf31a4ea2d73cce542fc503369c6f087a96247fa0659a3122fa11
MD5 da3960d8ac3b4e0fb40f3e07d0fa25b2
BLAKE2b-256 65433e8fca8c8365e729ad36acc1918a3a885bd28bdaa6c1b2adc317f4f4518f

See more details on using hashes here.

File details

Details for the file chado_tools-0.2.12-py3-none-any.whl.

File metadata

  • Download URL: chado_tools-0.2.12-py3-none-any.whl
  • Upload date:
  • Size: 157.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for chado_tools-0.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 fbe7b4fd8ae1757ffe6f53b4e819bbb8ab4286bd071c81de3ee755104288221b
MD5 be175b77c7f422a8cdd4f68b6ae8edad
BLAKE2b-256 de335db6eef856f03a7d54cb192d864d7611119c4de189124ef2a77dc91d83c6

See more details on using hashes here.

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