Skip to content

Commit

Permalink
check for a manifest in the sample, throw an error if there is not
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoslicki committed Oct 18, 2023
1 parent b48e122 commit 4321efe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions run_YACHT.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import srcs.utils as utils
import json
import warnings
import zipfile
warnings.filterwarnings("ignore")
from tqdm import tqdm
from loguru import logger
Expand Down Expand Up @@ -74,6 +75,13 @@
logger.info('Loading the manifest file generated from the training data.')
manifest = pd.read_csv(manifest_file_path, sep='\t', header=0)

# check if there is a manifest in the sample sig file
with zipfile.ZipFile(sample_file, 'r') as zip_file:
if 'SOURMASH-MANIFEST.csv' not in zip_file.namelist():
raise FileNotFoundError(f'The input file {sample_file} appears to be missing a manifest associated with it. '
f'Try running: sourmash sig merge {sample_file} -o <new signature with the manifest present>. '
f'And then run YACHT using the output of that command.')

# load sample signature and its signature info
logger.info('Loading sample signature and its signature info.')
try:
Expand Down

0 comments on commit 4321efe

Please sign in to comment.