Skip to content

Commit 9df099b

Browse files
committed
empty input -i bypass
1 parent e71db5f commit 9df099b

5 files changed

Lines changed: 26 additions & 9 deletions

File tree

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cff-version: 1.2.0
22
message: "If you use this software, please cite it using the metadata from this file."
33
title: "PROBEst"
4-
version: "0.2.0"
4+
version: "0.2.2"
55
doi: "10.20944/preprints202511.2140.v1"
66
date-released: "2025-11-01"
77
authors:

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ At the core of PROBEst is an AI-enhanced workflow that combines Primer3 or Oligo
1919
git clone https://github.com/CTLab-ITMO/PROBESt.git
2020
cd PROBEst
2121
bash setup/install.sh
22+
# or if you prefer to install with pip (may cause conflicts):
23+
# pip install -e .
2224
#validate installation with
2325
#setup/test_generator.sh
2426
```
@@ -30,8 +32,9 @@ bash setup/install.sh
3032
PROBEst can be run using the following command:
3133

3234
```bash
35+
#conda activate probest
3336
python pipeline.py \
34-
-i {INPUT} \ # fasta // .fa.gz
37+
-i {INPUT} \ # fasta // .fa.gz; may be ommited, than the first file from the `-tb` directory will be used
3538
-tb {TRUE_BASE} \ # directory with blastn database / fasta files
3639
-fb [FALSE_BASE ...] \ # directories with blastn database / fasta files
3740
-c {CONTIG_TABLE} \ # .tsv table with BLAST database information (optional; defaults to `{OUTPUT}/contigs.tsv` when using FASTA directories).

pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def merge_iter(iter: int):
9494
"/scripts/generator/"
9595

9696
# 1. Initial set generation ----
97-
print("\n---- PROBESt v.0.2.0 ----\n")
97+
print("\n---- PROBESt v.0.2.2 ----\n")
9898
print("Arguments passed")
9999

100100
# Create output directory early (needed for BLAST database preparation)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def read_readme():
5353

5454
setup(
5555
name='PROBESt',
56-
version='0.2.1',
56+
version='0.2.2',
5757
packages=find_packages(where=src_dir),
5858
package_dir={'': src_dir},
5959
python_requires='>=3.12',

src/PROBESt/args.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def arguments_parse():
4848
non-specific probes.
4949
5050
Usage:
51-
1. Provide an input FASTA file for probe generation.
51+
1. Provide an input FASTA file for probe generation (-i), or omit -i to use the first
52+
FASTA from the true base (-tb) when -tb is a FASTA file or directory of FASTA files.
5253
2. Specify BLAST databases for primer adjustment and non-specific testing.
5354
3. Configure evolutionary algorithm parameters and primer3/blastn settings.
5455
"""
@@ -57,13 +58,14 @@ def arguments_parse():
5758

5859
# Main arguments
5960
parser.add_argument("-i", "--input",
60-
required=True,
61+
required=False,
62+
default=None,
6163
nargs="*",
62-
help="Input FASTA file(s) or directory(ies) for probe generation. Can be a single file/directory or multiple files/directories. If a directory is provided, all *.fa, *.fna, *.fasta files (and their .gz versions) will be processed. Probes are generated for different contigs separately. Only gene-coding regions are recommended (.fna).")
64+
help="Input FASTA file(s) or directory(ies) for probe generation. Can be a single file/directory or multiple files/directories. If a directory is provided, all *.fa, *.fna, *.fasta files (and their .gz versions) will be processed. Probes are generated for different contigs separately. Only gene-coding regions are recommended (.fna). If omitted, the first FASTA file from --true_base is used (same name sorting as directory scans); --true_base must then be a FASTA file or a directory of FASTA files, not a BLAST DB path only.")
6365

6466
parser.add_argument("-tb", "--true_base",
6567
required=True,
66-
help="Path to the BLAST database for primer adjustment. This database is used to ensure primer specificity.")
68+
help="Path to the BLAST database for primer adjustment, or a directory of FASTA files used to build that database. This database ensures primer specificity. Use several FASTA files that share common sites (e.g. homologous or syntenic regions); without multiple such sequences this workflow is not usable.")
6769

6870
parser.add_argument("-fb", "--false_base",
6971
required=True,
@@ -329,5 +331,17 @@ def arguments_parse():
329331
# Set default contig_table if not provided
330332
if args.contig_table is None:
331333
args.contig_table = args.output + "/contigs.tsv"
332-
334+
335+
if not args.input:
336+
from PROBESt.misc import collect_fasta_files
337+
try:
338+
inferred = collect_fasta_files([args.true_base])
339+
except ValueError as exc:
340+
parser.error(
341+
"When -i/--input is omitted, --true_base must be a FASTA file or a directory "
342+
"containing FASTA files (so the input can match the first file found). "
343+
f"Could not infer input: {exc}"
344+
)
345+
args.input = [inferred[0]]
346+
333347
return args

0 commit comments

Comments
 (0)