You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PROBESt/args.py
+19-5Lines changed: 19 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,8 @@ def arguments_parse():
48
48
non-specific probes.
49
49
50
50
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.
52
53
2. Specify BLAST databases for primer adjustment and non-specific testing.
53
54
3. Configure evolutionary algorithm parameters and primer3/blastn settings.
54
55
"""
@@ -57,13 +58,14 @@ def arguments_parse():
57
58
58
59
# Main arguments
59
60
parser.add_argument("-i", "--input",
60
-
required=True,
61
+
required=False,
62
+
default=None,
61
63
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.")
63
65
64
66
parser.add_argument("-tb", "--true_base",
65
67
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.")
67
69
68
70
parser.add_argument("-fb", "--false_base",
69
71
required=True,
@@ -329,5 +331,17 @@ def arguments_parse():
329
331
# Set default contig_table if not provided
330
332
ifargs.contig_tableisNone:
331
333
args.contig_table=args.output+"/contigs.tsv"
332
-
334
+
335
+
ifnotargs.input:
336
+
fromPROBESt.miscimportcollect_fasta_files
337
+
try:
338
+
inferred=collect_fasta_files([args.true_base])
339
+
exceptValueErrorasexc:
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). "
0 commit comments