Skip to content

Commit

Permalink
docs: README document and command message updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
oyurekten committed Jun 20, 2024
1 parent c55b2bf commit 1428f25
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 20 deletions.
54 changes: 37 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,55 @@

---

#### **metaboligts-utils** is a *lightweight API* and *command line interface* (CLI) to update ISA metadata files, download and search MetaboLights public studies.
---
### Selected Features
#### **metaboligts-utils** is a *lightweight API* and *command line interface* (CLI) to use or search MetaboLights public studies, update MetaboLights submitted studies, and update [ISA-Tab](https://isa-specs.readthedocs.io/en/latest/isatab.html) metadata files.
---

#### CLI Features
* Download and list MetaboLights public study metadata files.
* Search MetaboLights public studies.
* Download, upload and validate MetaboLights submitted studies
* Create assay file templates.

#### API Features
* **Read and update ISA files** with minimum pyhton package dependency.
* **mtbls** command line interface (CLI) to
* download and list MetaboLights public study metadata files.
* search MetaboLights public studies.
* download, upload and validate MetaboLights submitted studies.
* Read MetaboLights study metadata files
* Calculate hash value of each ISA metadata file or study ISA metadata folder
* Read ISA table files (s_*.txt, a_*.txt, m_*.txt) with **Pagination support**.
* **Multi-column filters and sort options** on ISA table files.
* Define **custom filters and sorters**
* **Apply actions** on ISA table files to manuplate them.
* **Apply actions** on ISA table files to manipulate them.
* **Json serializable** models with [pydantic](https://github.com/pydantic/pydantic) library.

---


### Installation
## Installation
---
The following command installs metabolights-utils from the Python Package Index. You will need an installation of Python 3.8+ and pip3.
The following command installs metabolights-utils from the Python Package Index. You will need Python 3.8+ and pip3 on your operating system.

* (If python3 is not installed) Download and install [Python](https://www.python.org/downloads)
* (If pip3 is not installed) Install [pip3](https://pip.pypa.io/en/stable/installation)
* Install metabolights-utils library
```shell
cd <directory to create a virtual environment>

# install metabolights-utils on new a virtual environment named mtbls-venv (you may change it)
python3 -m venv mtbls-venv
source mtbls-venv/bin/activate
pip install --upgrade pip
pip3 install -U metabolights-utils

# test mtbls command
mtbls --version
```

### Usage **mtbls** command line interface
After installation of metabolights-utils, you can use the mtbls command line interface to download and list MetaboLights studies.
## CLI (**mtbls**) Usage
After installation of metabolights-utils, *mtbls* command will be enabled to use or search MetaboLights studies.

#### Commands for Public Studies
### Commands to use MetaboLights Public Studies
```shell
cd <directory to installed virtual environment.>
# activate your virtual environment
source mtbls-venv/bin/activate

# prints mtbls public command usage
mtbls --help
Expand Down Expand Up @@ -94,7 +111,6 @@ mtbls public list MTBLS3
# lists the content of FILES folder
mtbls public list MTBLS3 FILES


# downloads study metadata files from MetaboLights FTP server.
mtbls public download MTBLS3

Expand Down Expand Up @@ -154,7 +170,7 @@ mtbls public remove MTBLS1

```

#### Search public studies
#### Commands to search MetaboLights Public Studies
```shell

# prints help for public study search command.
Expand Down Expand Up @@ -226,6 +242,9 @@ mtbls public search "(cow + -sheep + -(blood serum | milk))" --body '{"assayTech
# prints only study ids
mtbls public search "(cow | -sheep)" --body '{"assayTechniqueNameFilter": { "joinOperator": "or", "values": ["LC-MS", "GC-MS"] }}' --limit=100 --id

# prints only study ids if study has 'SCIEX QTRAP' term in mass spectrometry assay files
mtbls public search "(SCIEX QTRAP)" --body '{"assayMainTechniqueFilter": { "joinOperator": "or", "values": ["MS"] }}' --limit 100 --id

# prints study ids which have both targeted and untargeted design descriptor terms
mtbls public search --body '{"ontologyFilters": {"design_descriptor":{ "joinOperator": "and", "values": ["targeted", "untargeted"]}}}' --limit=100 --id

Expand All @@ -243,7 +262,7 @@ mtbls public search --body '{"aggregations": [{ "aggregationName": "assay_techni

```

#### Commands for Submitted Studies
#### Commands to update MetaboLights Submitted (private) Studies
```shell

# prints help for submitted studies.
Expand Down Expand Up @@ -364,6 +383,7 @@ mtbls submission validate <MTBLSXXX>
mtbls submission validate <MTBLSXXX> --validation_file_path errors.tsv

```
## API Usage

### Load MetaboLights study model from a directory
---
Expand Down
3 changes: 2 additions & 1 deletion metabolights_utils/commands/cli.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

import click

from metabolights_utils import __VERSION__
from metabolights_utils.commands.model.model_cli import model_cli
from metabolights_utils.commands.public.public_cli import public_cli
from metabolights_utils.commands.submission.submission_cli import submission_cli


@click.group()
@click.version_option(__VERSION__)
def cli():
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def submission_describe(
load_folder_index: bool = False,
):
"""
View summary of any user submitted study content. Run jsonpath expression to filter MetaboLights study model.
View summary of user's submitted (private) study. Run jsonpath expression to filter MetaboLights study model.
study_id: MetaboLights study accession number (MTBLSxxxx).
Expand Down
2 changes: 1 addition & 1 deletion metabolights_utils/commands/submission/submission_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def submission_login(
api_token: str = "",
):
"""
Creates a file path to use connect private FTP server and MetaboLights Rest API.
Creates a file to connect private FTP server and MetaboLights Rest API.
credentials_file_path (optional): File path to store user private FTP and MetaboLights Rest API credentials.
Expand Down

0 comments on commit 1428f25

Please sign in to comment.