Skip to content

Commit 576df22

Browse files
committed
.
1 parent ba3fd91 commit 576df22

2 files changed

Lines changed: 25 additions & 13 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ virasign --help
9696
- `-d, --database`: Database name `RVDB,RefSeq`, or an accession (e.g. `OZ254622.1`) (default: `RVDB`).
9797
- `--rvdb-version`: Which RVDB release to download (default: `31.0`). See [available versions](https://rvdb.dbi.udel.edu/previous-release).
9898
- `-a, --accession`: Extra NCBI accessions to include in the run (merged with selected database).
99-
- `--db-dir`: Reuse an existing database folder (optional; example: `/path/to/Databases/`).
99+
- `--db-dir`: Base directory where Virasign will create/use `Databases/` (optional; example: `/path/to/project/`).
100100

101101
- **Viral identification thresholds (controls what is reported)**
102102
- `--min_identity`: Min read alignment identity (%) (default: RVDB `80`, RefSeq `95`).
@@ -137,7 +137,7 @@ virasign -i input_dir --db-dir /path/to/Databases/
137137
# Use both databases with special added accessions and 16 threads (without -o, creates Virasign_output)
138138
virasign -i input_dir -d RVDB,RefSeq -a PX852146.1,NC_123456.1 -t 16
139139

140-
# Use both databases with specifying RVDB version
140+
# Use both databases with a specific RVDB version
141141
virasign -i input_dir -d RVDB,RefSeq --rvdb-version 31.0
142142

143143
# Use a single accession as the database

virasign/virasign.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,8 @@ def resolve_databases_storage_dir(db_dir_parent) -> Path:
638638
Root directory that contains RVDB/, RefSeq/, Custom/.
639639
640640
Without --db-dir: ./Databases (under cwd).
641-
With --db-dir: use that path as the storage root exactly — no automatic extra Databases/
642-
segment (avoids .../Databases/Databases). Put RVDB/ and RefSeq/ directly under that path.
641+
With --db-dir: create/use a Databases/ subfolder inside the given base directory,
642+
unless the provided path already ends with Databases/ (avoids .../Databases/Databases).
643643
"""
644644
if db_dir_parent:
645645
raw = str(db_dir_parent).strip()
@@ -650,7 +650,7 @@ def resolve_databases_storage_dir(db_dir_parent) -> Path:
650650
base = base.resolve(strict=False)
651651
except (OSError, RuntimeError):
652652
base = Path(os.path.normpath(str(base)))
653-
out_before_collapse = base
653+
out_before_collapse = base / "Databases"
654654
out = collapse_redundant_databases_dirs(out_before_collapse)
655655
if str(out) != str(out_before_collapse):
656656
logger.info(
@@ -7166,17 +7166,20 @@ def find_samples(input_path):
71667166

71677167
def main(args=None):
71687168
"""Main entry point for the reference selection pipeline."""
7169+
7170+
# Version string (used in --version and help header)
7171+
try:
7172+
from . import __version__ as virasign_version
7173+
except Exception:
7174+
virasign_version = "unknown"
7175+
71697176
parser = argparse.ArgumentParser(
7170-
description="Select best reference sequence from database for each sample",
7177+
description=f"Virasign v{virasign_version}: viral taxonomic classification and reference selection tool for nanopore sequencing data",
71717178
formatter_class=argparse.RawDescriptionHelpFormatter,
71727179
epilog="""
71737180
Examples:
71747181
Basic usage with default RVDB database:
7175-
virasign -i input_dir -o output_dir
7176-
7177-
One gzipped FASTQ or a folder of FASTQs:
7178-
virasign -i reads.fastq.gz
7179-
virasign -i my_fastq_folder
7182+
virasign -i input_dir
71807183
71817184
Use specific RVDB version:
71827185
virasign -i input_dir -o output_dir -d RVDB --rvdb-version 31.0
@@ -7185,6 +7188,15 @@ def main(args=None):
71857188
virasign -i input_dir -d RVDB,RefSeq -o output_dir -a PX852146.1,NC_123456.1 -t 16
71867189
"""
71877190
)
7191+
7192+
# Version flag (standard CLI behavior: print and exit)
7193+
parser.add_argument(
7194+
"-v",
7195+
"--version",
7196+
action="version",
7197+
version=f"%(prog)s {virasign_version}",
7198+
help="Show installed Virasign version and exit.",
7199+
)
71887200

71897201
parser.add_argument(
71907202
"-i", "--input",
@@ -7208,7 +7220,7 @@ def main(args=None):
72087220
dest="db_dir",
72097221
type=str,
72107222
default=None,
7211-
help="Database storage root: folder that will contain RVDB/, RefSeq/, Custom/ (no extra Databases/ is appended; default without this flag: ./Databases).",
7223+
help="Base directory for database storage. Virasign will create/use a Databases/ subfolder here (default without this flag: ./Databases). Example: --db-dir /data/project -> stores in /data/project/Databases/.",
72127224
)
72137225

72147226
parser.add_argument(
@@ -7286,7 +7298,7 @@ def main(args=None):
72867298
dest="cluster_identity",
72877299
help="Identity threshold for RVDB clustering (default: 0.98, i.e., 98%%). Only used if clustering is enabled with --enable-clustering."
72887300
)
7289-
7301+
72907302
parser.add_argument(
72917303
"--rvdb-version",
72927304
type=str,

0 commit comments

Comments
 (0)