chado-tools
Python3 command line script providing various tools for accessing CHADO databases.
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
For running tests please see the note below.
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
Using a Docker container
The program is also available as a standalone Docker container. The latest build can be downloaded from DockerHub with the command
docker pull sangerpathogens/chado-tools
When running the container with Docker, use the flags --interactive --tty and map all required environment variables (see below) with flag --env.
Usage
The installation will put a single script called chado in your PATH.
The usage is:
chado <command> [<subcommand>] [options]
- To list the available commands and brief descriptions, just run
chado -horchado --help. - To display the version of the program, type
chado -vorchado --version. - Use
chado <command> -horchado <command> --helpto 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.
Analogously, you can specify a default password with the environment variable CHADO_PASS.
The flag -p enforces asking the user for a password, which is useful if you don't want to store a default password in your environment.
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
Note concerning tests
Some of the integration tests rely on access to a PostgreSQL server. 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.
They create temporary databases on that server and clean those up when finished, so this shouldn't interfere with
anything you have stored in any database on that server. If you are concerned about this, though, make sure to point
the tool to an empty test server.
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.
Metadata
Release files for chado-tools 0.2.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chado-tools-0.2.14.tar.gz | 118.6 kB | Without provenance | Details for chado-tools-0.2.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chado_tools-0.2.14-py3-none-any.whl | Python 3 | none | any | Details for chado_tools-0.2.14-py3-none-any.whl |
Total release size: 276.5 kB
Release files / chado-tools-0.2.14.tar.gz
| Download URL | chado-tools-0.2.14.tar.gz |
|---|---|
| Size | 118.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f251a7a4b2aed8ecee397923c3c2b580a7ac8f761765ddec4cd6a7516ae152de
|
|
BLAKE2b-256 checksum How to use checksums |
fdc228a3a52ea832d21a35cd7bdce3c046f8e605f762780ab384ac1a992d569a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / chado_tools-0.2.14-py3-none-any.whl
| Download URL | chado_tools-0.2.14-py3-none-any.whl |
|---|---|
| Size | 157.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd877249d6368221c939f197c38a2aafdd6912611d3fce6b66b5c461b13cd072
|
|
BLAKE2b-256 checksum How to use checksums |
f713e46ea849b1b7c133826eea12133690cda2000cb157ce2adafac20b54a3e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for chado-tools 0.2.14
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.