From 0a266bb5b3807e10fcba4ea6e07fa12b93c5508c Mon Sep 17 00:00:00 2001 From: moshi Date: Mon, 11 Apr 2022 00:25:12 +0900 Subject: [PATCH] Change: v1.0.3 to v1.0.4 - Change default download dir to common cache dir --- README.md | 2 +- pyproject.toml | 2 +- src/cogclassifier/cogclassifier.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6daa60f..670fc05 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ functional annotation and classification results are output. -h, --help show this help message and exit -i , --infile Input query protein fasta file -o , --outdir Output directory - -d , --download_dir Download COG & CDD FTP data directory (Default: './cog_download') + -d , --download_dir Download COG & CDD resources directory (Default: '~/.cache/cogclassifier') -t , --thread_num RPS-BLAST num_thread parameter (Default: MaxThread - 1) -e , --evalue RPS-BLAST e-value parameter (Default: 0.01) -v, --version Print version information diff --git a/pyproject.toml b/pyproject.toml index 4379c3f..0af41bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cogclassifier" -version = "1.0.3" +version = "1.0.4" description = "A tool for classifying prokaryote protein sequences into COG functional category" authors = ["moshi"] license = "MIT" diff --git a/src/cogclassifier/cogclassifier.py b/src/cogclassifier/cogclassifier.py index 160397d..82ee12b 100644 --- a/src/cogclassifier/cogclassifier.py +++ b/src/cogclassifier/cogclassifier.py @@ -19,7 +19,7 @@ import pandas as pd import requests -__version__ = "1.0.3" +__version__ = "1.0.4" def main(): @@ -38,7 +38,7 @@ def main(): def run( query_fasta_file: Union[str, Path], outdir: Union[str, Path], - download_dir: Union[str, Path] = Path("./cog_download"), + download_dir: Union[str, Path] = Path.home() / ".cache" / "cogclassifier", thread_num: int = 1, evalue: float = 1e-2, ) -> None: @@ -56,7 +56,7 @@ def run( download_dir = Path(download_dir) outdir.mkdir(exist_ok=True) - download_dir.mkdir(exist_ok=True) + os.makedirs(download_dir, exist_ok=True) print("# Step1: Download COG & CDD FTP data") # Setup COG functional category files @@ -639,12 +639,12 @@ def get_args() -> argparse.Namespace: help="Output directory", metavar="", ) - default_dl_dir = "./cog_download" + default_dl_dir = Path.home() / ".cache" / "cogclassifier" parser.add_argument( "-d", "--download_dir", type=Path, - help=f"Download COG & CDD FTP data directory (Default: '{default_dl_dir}')", + help=f"Download COG & CDD resources directory (Default: '{default_dl_dir}')", default=default_dl_dir, metavar="", )