From bc0cf7321dcd68027d4997facf21e9d2c9015b34 Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Fri, 7 Apr 2023 11:00:39 -0700 Subject: [PATCH] refactor: rename SEQREPO_DATA_PATH --> SEQREPO_ROOT_DIR (#186) --- README.md | 2 ++ docs/source/full_install.rst | 2 ++ gene/__init__.py | 4 ++-- gene/etl/base.py | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 91fc990d..fe329d89 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ You will want to do the following:\ sudo mv /usr/local/share/seqrepo/2021-01-29._fkuefgd /usr/local/share/seqrepo/2021-01-29 ``` +Use the `SEQREPO_ROOT_DIR` environment variable to set the path of an already existing SeqRepo directory. The default is `/usr/local/share/seqrepo/latest`. + ### Database Initialization The Normalizer supports two data storage options: diff --git a/docs/source/full_install.rst b/docs/source/full_install.rst index 980b95e8..188c5dc5 100644 --- a/docs/source/full_install.rst +++ b/docs/source/full_install.rst @@ -38,6 +38,8 @@ You may need to manually finish moving sequence files (replace the `XXXXXX` char sudo mv /usr/local/share/seqrepo/2021-01-29.XXXXXXX /usr/local/share/seqrepo/2021-01-29 +Use the ``SEQREPO_ROOT_DIR`` environment variable to set the path of an already existing SeqRepo directory. The default is ``/usr/local/share/seqrepo/latest``. + Database setup -------------- diff --git a/gene/__init__.py b/gene/__init__.py index 96ac81d7..55f744cb 100644 --- a/gene/__init__.py +++ b/gene/__init__.py @@ -22,8 +22,8 @@ logging.getLogger("biocommons.seqrepo.fastadir.fastadir").setLevel(logging.INFO) # noqa: E501 -SEQREPO_DATA_PATH = Path( - environ.get("SEQREPO_DATA_PATH", "/usr/local/share/seqrepo/latest") +SEQREPO_ROOT_DIR = Path( + environ.get("SEQREPO_ROOT_DIR", "/usr/local/share/seqrepo/latest") ) diff --git a/gene/etl/base.py b/gene/etl/base.py index 2396e2ce..946f9482 100644 --- a/gene/etl/base.py +++ b/gene/etl/base.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from typing import Dict, Optional, List from gene.database import AbstractDatabase -from gene import ITEM_TYPES, SEQREPO_DATA_PATH +from gene import ITEM_TYPES, SEQREPO_ROOT_DIR from biocommons.seqrepo import SeqRepo from pathlib import Path from ftplib import FTP @@ -23,7 +23,7 @@ class Base(ABC): """The ETL base class.""" def __init__(self, database: AbstractDatabase, host: str, data_dir: str, - src_data_dir: Path, seqrepo_dir: Path = SEQREPO_DATA_PATH, + src_data_dir: Path, seqrepo_dir: Path = SEQREPO_ROOT_DIR, *args, **kwargs) -> None: """Instantiate Base class.