Package: chado-tools
chado-toolsPython3 command line script providing various tools for accessing CHADO databases.ContentsInstallationRequired dependenciesFrom sourceUsing pipUsing BiocondaUsing a Docker containerUsageDatabase connectionAvailable commandsExamplesNote concerning testsLicenseFeedback/IssuesInstallationThere 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 ithereor email us atpath-help@sanger.ac.uk.Required dependenciesPython 3.6PostgreSQL 9.6 or higherFrom sourceDownload the latest release from this github repository, or clone the repository to obtain the most recent updates.
Then install the software:python3 setup.py installFor running tests please see thenotebelow.Using pipYou can install the program from thePython Package Index (PyPI)using the commandpip install chado-toolsUsing BiocondaThe program is also available asBioconda package. Install it with the commandconda install -c bioconda chado-toolsUsing a Docker containerThe program is also available as a standalone Docker container. The latest build can be downloaded fromDockerHubwith the commanddocker pull sangerpathogens/chado-toolsWhen running the container with Docker, use the flags--interactive --ttyand map all required environment variables (see below) with flag--env.UsageThe installation will put a single script calledchadoin your PATH.
The usage is:chado <command> [<subcommand>] [options]To list the available commands and brief descriptions, just runchado -horchado --help.To display the version of the program, typechado -vorchado --version.Usechado <command> -horchado <command> --helpto get a detailed description and the usage of that command.Database connectionYou 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=chadouserThe software seeks for these environment variables on your system. If they do not exist, it will use thedefault connection settings, which you can edit manually if you really want.Analogously, you can specify a default password with the environment variableCHADO_PASS.
The flag-penforces 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 thedefault filewith flag-c(including password). The software will then ignore any environment variables.Available commandsCommandDescriptionconnectconnect to a CHADO database for an interactive sessionqueryquery a CHADO database and export the result into a text fileexecuteexecute a function defined in a CHADO databaseextractrun a pre-compiled query against the CHADO databaseinsertinsert a new entity of a specified type into the CHADO databasedeletedelete an entity of a specified type from the CHADO databaseimportimport data from file into the CHADO databaseexportexport data from the CHADO database to fileadminperform admin tasks, such as creating or dumping a CHADO databaseExamplesCreate a new CHADO database calledeukaryotesaccording to the current GMOD schema:chado admin create eukaryotes
chado admin setup -s gmod eukaryotesDump this database into an archive calledeukaryotes.dump:chado admin dump eukaryotes eukaryotes.dumpList all organisms in theeukaryotesdatabase:chado extract organisms eukaryotesQuery the database to check the meaning of a certaincvterm_id:chado query -q "SELECT name FROM cvterm WHERE cvterm_id = 25" eukaryotesExport a FASTA file containing the sequences of the organismPfalciparum:chado export fasta -a Pfalciparum -o Pfalciparum.fasta -t contigs eukaryotesNote concerning testsSome of the integration tests rely on access to a PostgreSQL server. In order to successfully run those tests,
modify thedefault connection settingssuch that they describe an existing
PostgreSQL database server to which you can connect. The tests can then be run aspython3 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.Licensechado-tools is free software, licensed underGPLv3.Feedback/IssuesPlease report any issues to theissues pageor emailpath-help@sanger.ac.uk.