Refactor CLI to handle help command and following clig.dev guidelines #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request includes several changes to the
aphylogeo
project, focusing on improving the command-line interface, updating function documentation, and modifying output handling. The most important changes include updating theMakefile
command, modifying themain.py
file to enhance the CLI, and updating utility functions for better output file handling.Command-line interface improvements:
aphylogeo/main.py
: Enhanced thetyper.Typer
app initialization to include help text and a callback function for displaying the title card.aphylogeo/main.py
: Added a newrun
command to replace the previousmain
callback, providing a more intuitive way to run the pipelines and process trees.Makefile
: Updated theaPhylogeo
command to include therun
argument for better clarity.Function documentation updates:
aphylogeo/main.py
: Updated the docstrings forclimate_pipeline
andgenetic_pipeline
functions to improve clarity and consistency.Output handling modifications:
aphylogeo/utils.py
: Modified thewriteOutputFile
function to accept anoutput_file
parameter, allowing for dynamic output file paths.aphylogeo/utils.py
: Updated thefilterResults
function to return data in a list format and removed the file creation step, making the function more flexible. [1] [2]- UpdatedTyper
app initialization toinvoke_without_command=False
to enforce command requirement.Documentation proposal
Command-Line Interface (CLI) for aPhyloGeo
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:
Main Command Structure
Description
A tool for processing climatic and genetic data to generate phylogenetic trees.
Global Options
--install-completion
--show-completion
--help
Commands
1. Climate Pipeline
This command runs the climatic pipeline that processes climatic trees.
Options:
--file-name
--output
--help
Example Usage:
2. Genetic Pipeline
This command runs the genetic pipeline that processes genetic trees.
Options:
--reference-gene-filepath
--output
--help
Example Usage:
3. Run Command
The
run
command executes both pipelines, processes the trees, and performs phylogeographic analyses.Options:
--climatic-tree
--genetic-tree
--output
--help
Example Usage:
To run phylogenetic analysis with pre-generated climatic and genetic trees:
Screenshot:
To run phylogenetic analysis with only pre-generated genetic trees:
Complete Example Workflow
To run both pipelines in sequence, you can execute: