Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] fix sig check manifest rebuilding #1915

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/sourmash/cli/sig/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def subparser(subparsers):
'-q', '--quiet', action='store_true',
help='suppress non-error output'
)
subparser.add_argument(
'-d', '--debug', action='store_true',
help='provide debugging output'
)
subparser.add_argument(
'-o', '--output-missing', metavar='FILE',
help='output picklist with remaining unmatched entries to this file',
Expand Down
4 changes: 2 additions & 2 deletions src/sourmash/sig/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ def check(args):
check signature db(s) against a picklist.
"""
from sourmash.picklist import PickStyle
set_quiet(args.quiet)
set_quiet(args.quiet, args.debug)
moltype = sourmash_args.calculate_moltype(args)
picklist = sourmash_args.load_picklist(args)
pattern_search = sourmash_args.load_include_exclude_db_patterns(args)
Expand Down Expand Up @@ -1335,7 +1335,7 @@ def check(args):
sys.exit(-1)

# has manifest, or ok to build (require_manifest=False) - continue!
manifest = sourmash_args.get_manifest(idx, rebuild=True)
manifest = sourmash_args.get_manifest(idx, require=True)
manifest_rows = manifest._select(picklist=picklist)
total_rows_examined += len(manifest)
total_manifest_rows += manifest_rows
Expand Down
2 changes: 2 additions & 0 deletions src/sourmash/sourmash_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ def get_manifest(idx, *, require=True, rebuild=False):
Retrieve a manifest for this idx, loaded with `load_file_as_index`.

If a manifest exists and `rebuild` is False, return the manifest.
Even if a manifest exists and `rebuild` is True, rebuild the manifest.
If a manifest does not exist or `rebuild` is True, try to build one.
If a manifest cannot be built and `require` is True, error exit.

Expand All @@ -785,6 +786,7 @@ def get_manifest(idx, *, require=True, rebuild=False):

# need to build one...
try:
debug_literal("get_manifest: rebuilding manifest")
m = CollectionManifest.create_manifest(idx._signatures_with_internal(),
include_signature=False)
debug_literal("get_manifest: rebuilt manifest.")
Expand Down