Skip to content

Commit

Permalink
Fix/argument handling 20240807 (#7)
Browse files Browse the repository at this point in the history
* version: -> 0.9.7

* fix: changed argument order in handle_args so that placement of positional arguments does not cause `argument not found` errors (s. #6)
* fix: changed default db format from bed to hmmer
* doc: removed misleading references to db format from readme
* doc: corrected argument types of `annotation_db`, `bwa_index` to positional
  • Loading branch information
cschu authored Aug 7, 2024
1 parent 9bad566 commit a0b8e82
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,18 @@ cayman \
<input_options> \
</path/to/db> \
</path/to/bwa_index> \
--db_format hmmer \
[--out_prefix <prefix>] \
[--min_identity <float>] \
[--min_seqlen <int>] \
[--cpus_for_alignment <int>]
```

`cayman`'s default input format is bed4. `--db_format hmmer` is required when using the csv-formatted hmmer annotations from [Zenodo](https://zenodo.org/records/10473258).

### Mandatory parameters

* `<input_options>`

1. Read files need to be in fastq format (best with `fastq` or `fq` file ending) and can be gzip compressed.

2. The `<input_options>` parameters depend on the library layout of your samples:
* Paired-end data can be specified with `--reads1 </path/to/reads1> --reads2 </path/to/reads2>`. Each read will be counted as `0.5`.
* Single-end data can be specified with `--singles </path/to/reads>`. Each read will be counted as `1`.
Expand Down
2 changes: 1 addition & 1 deletion cayman/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" module docstring """
__version__ = "0.9.6"
__version__ = "0.9.7"
__toolname__ = "cayman"
22 changes: 12 additions & 10 deletions cayman/handle_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def handle_args(args):
formatter_class=argparse.RawTextHelpFormatter,
parents=(log_ap,),
)

ap.add_argument(
"annotation_db",
type=str,
Expand All @@ -44,10 +45,20 @@ def handle_args(args):
),
)

ap.add_argument(
"bwa_index",
type=str,
help=textwrap.dedent(
"""\
Path to the bwa reference index.
"""
),
)

ap.add_argument(
"--db_format",
type=str,
default="bed",
default="hmmer",
choices=("bed", "hmmer"),
help="Format of the annotation database.",
)
Expand All @@ -67,15 +78,6 @@ def handle_args(args):
# help="Separator-character for the annotation database file Default: '\\t'."
# )

ap.add_argument(
"bwa_index",
type=str,
help=textwrap.dedent(
"""\
Path to the bwa reference index.
"""
),
)

ap.add_argument(
"-1",
Expand Down

0 comments on commit a0b8e82

Please sign in to comment.