Skip to content

Command‐Line Interface (CLI) for aPhyloGeo

Samuel SIKATI KENMOGNE edited this page Dec 5, 2024 · 1 revision

The aPhyloGeo tool now includes a command-line interface (CLI) built with Typer, allowing users to run pipelines and process genetic and climatic trees directly from the terminal. This feature enhances usability and facilitates integration into automated workflows.

Usage

To see the available commands and options, you can run:

python aphylogeo/main.py --help

Main Command Structure

python aphylogeo/main.py [OPTIONS] COMMAND [ARGS]...

Description

A tool for processing climatic and genetic data to generate phylogenetic trees.

Global Options

Option Description
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it or customize the installation.
--help Show help message and exit.

Commands

1. Climate Pipeline

This command runs the climatic pipeline that processes climatic trees.

python aphylogeo/main.py climate-pipeline [OPTIONS]

Options:

Option Type Description
--file-name TEXT The name of the file containing the climatic data. [default: ./datasets/example/geo.csv]
--output TEXT The name of the file to save the climatic trees. [default: ./datasets/example/climaticTrees.nwk]
--help Show help message and exit.

Example Usage:

python aphylogeo/main.py climate-pipeline --file-name './datasets/example/geo.csv' --output './datasets/example/climaticTrees.nwk'

2. Genetic Pipeline

This command runs the genetic pipeline that processes genetic trees.

python aphylogeo/main.py genetic-pipeline [OPTIONS]

Options:

Option Type Description
--reference-gene-filepath TEXT The path to the reference gene file. [default: ./datasets/example/sequences.fasta]
--output TEXT The name of the file to save the genetic trees. [default: ./datasets/example/geneticTrees.json]
--help Show help message and exit.

Example Usage:

python aphylogeo/main.py genetic-pipeline --reference-gene-filepath './datasets/example/sequences.fasta' --output './datasets/example/geneticTrees.json'

3. Run Command

The run command executes both pipelines, processes the trees, and performs phylogeographic analyses.

python aphylogeo/main.py run [OPTIONS]

Options:

Option Type Description
--climatic-tree TEXT The name of the file containing the climatic trees. [default: None]
--genetic-tree TEXT The name of the file containing the genetic trees. [default: None]
--output TEXT The name of the file to save output results. [default: ./results/output.json]
--help Show help message and exit.

Example Usage:

To run phylogenetic analysis with pre-generated climatic and genetic trees:

python aphylogeo/main.py run --climatic-tree './datasets/example/climaticTrees.nwk' --genetic-tree './datasets/example/geneticTrees.json' --output './result.csv'

Screenshot:

image

To run phylogenetic analysis with only pre-generated genetic trees:

python aphylogeo/main.py run --genetic-tree './datasets/example/geneticTrees.json' --output './result.csv'

image

Complete Example Workflow

To run both pipelines in sequence, you can execute:

  1. Generate Climatic Trees:

    python aphylogeo/main.py run climate-pipeline --file-name './datasets/example/geo.csv' --output './datasets/example/climaticTrees.nwk'
  2. Generate Genetic Trees:

    python aphylogeo/main.py genetic-pipeline --reference-gene-filepath './datasets/example/sequences.fasta' --output './datasets/example/geneticTrees.json'
  3. Process Both Trees:

    python aphylogeo/main.py run --climatic-tree './datasets/example/climaticTrees.nwk' --genetic-tree './datasets/example/geneticTrees.json' --output './result.csv'