Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hrshdhgd/kegg-ingest


https://github.com/hrshdhgd/kegg-ingest

Last synced: 29 days ago
JSON representation

Awesome Lists containing this project

README

        

# kegg-ingest CLI

`kegg-ingest` is a command line interface for interacting with the KEGG database. This tool allows you to fetch, process, and manage data from KEGG. All ingests are saved in a `duckdb` database and also exported as a tsv file.

## Installation

To install `kegg-ingest`, use pip:

```sh
pip install kegg-ingest
```

## Commands

### `get`

Fetch and process data from KEGG. (e.g.: https://rest.kegg.jp/get/map011000)

**Usage:**

```sh
kegg-ingest get --db [--batch-size ] [--use-kegg/--no-use-kegg] [--output ]
```

**Options:**

- `--db`: KEGG Database to ingest (required).
- `--batch-size, -b`: Batch size for processing (default: 10, max: 10).
- `--use-kegg/--no-use-kegg`: Use KEGG API to fetch data (default: True). Alternatively uses [`bioservices`](https://github.com/cokelaer/bioservices)
- `--output, -o`: Output file to write to (tsv format).

**Example:**

```sh
kegg-ingest get --db pathway
```
This downloads all KEGG pathways in batches of 5 (e.g.: https://rest.kegg.jp/get/map01100+map01110+map01120+map01200+map01210 so on and so forth.)

### `clear-db`

Clear the entire database.

**Usage:**

```sh
kegg-ingest clear-db
```

### `drop`

Drop a specific table from the database.

**Usage:**

```sh
kegg-ingest drop
```

**Arguments:**

- `table_name`: Name of the table to drop.

**Example:**

```sh
kegg-ingest drop get_pathway
```

### `preview`

Show the contents of a table.

**Usage:**

```sh
kegg-ingest preview [--limit ]
```

**Arguments:**

- `table_name`: Name of the table to preview.

**Options:**

- `--limit`: Number of rows to preview (default: 5).

**Example:**

```sh
kegg-ingest preview get_pathway --limit 10
```

### `overview`

Print an overview of the database.

**Usage:**

```sh
kegg-ingest overview
```

### `query`

Run a query on the database.

**Usage:**

```sh
kegg-ingest query
```

**Arguments:**

- `query_text`: SQL query to run.

**Example:**

```sh
kegg-ingest query "SELECT * FROM get_pathway WHERE description LIKE '%metabolism%'"
```

## License

This project is licensed under the MIT License. See the LICENSE file for details.

---
# Acknowledgements

This [cookiecutter](https://cookiecutter.readthedocs.io/en/stable/README.html) project was developed from the [monarch-project-template](https://github.com/monarch-initiative/monarch-project-template) template and will be kept up-to-date using [cruft](https://cruft.github.io/cruft/).