diff --git a/CHANGELOG.md b/CHANGELOG.md index 62c9739..4a3879c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- `phyling download list` now will also print out the markersets that have already been downloaded. + +### Removed + +- Output option in download module. Now all the BUSCO datasets will be saved in the config folder `~/.phyling/HMM`. + +### Changed + +- Change the align module -m/--markerset behavior. It firstly searches against the given path and the config folder `~/.phyling/HMM` if +the path doesn't exist. Users can also directly specify the markerset name that has already been downloaded and saved in the config folder. + ## [2.0.0-beta] - 2023-11-14 ### Added diff --git a/src/phyling/download.py b/src/phyling/download.py index 63ebee1..068fa42 100644 --- a/src/phyling/download.py +++ b/src/phyling/download.py @@ -198,8 +198,8 @@ def download(markerset, **kwargs) -> None: First it checks whether the metadata file is exist under the config folder ~/.phyling. A missing or outdated file will trigger the module to download/update the metadata. - Passing "list" to markerset argument will list all the available markersets. Passing a valid name to the markerset - argument will download the markerset to the given output path. + Passing "list" to markerset argument will list all the available/already downloaded markersets. Passing a valid + name to the markerset argument will download the markerset to the config folder ~/.phyling/HMM. """ metadata_updater = Metadata_updater(database_url=phyling.config.database) markerset_dict = metadata_updater.updater() @@ -208,6 +208,11 @@ def download(markerset, **kwargs) -> None: # Get the dictionary with database as key and convert it into a list url_list = [hmm_markerset for hmm_markerset in markerset_dict.keys()] url_list.sort() + exist_markerset = [] + for markerset in Path(phyling.config.cfg_dir, phyling.config.default_HMM).iterdir(): + if markerset.name in url_list and markerset.is_dir(): + exist_markerset.append(markerset.name) + exist_markerset.sort() print("Available datasets:\n") # Adjust databases display according to the terminal size @@ -219,6 +224,12 @@ def download(markerset, **kwargs) -> None: # Print the database list print(" ".join(word.ljust(col_width) for word in row)) + print() + print("Downloaded datasets:\n") + exist_markerset = [exist_markerset[x : x + col] for x in range(0, len(exist_markerset), col)] + for row in exist_markerset: + # Print the database list + print(" ".join(word.ljust(col_width) for word in row)) else: hmm_markerset_updater = HMM_markerset_updater( database_url=phyling.config.database,