clb21565 / mobileOG-db

code repo for mobileOG-db
GNU General Public License v3.0
32 stars 5 forks source link

Error when no results found #10

Closed sciguy closed 1 year ago

sciguy commented 1 year ago

When running mobileOGs-pl-kyanite.py, if no results are found an error is thrown (below). This may confuse users into thinking there was a problem when the only issue is that no results were found.

The script could check if the file is empty and exit early (around line 15). df_OUT=pd.read_csv(args.i,sep="\t")

Error (when file empty):

Reported 0 pairwise alignments, 0 HSPs. 0 queries aligned. Traceback (most recent call last): File "/app/mobileOG-db/bin/mobileOGs-pl-kyanite.py", line 19, in df_OUT=pd.read_csv(args.i,sep="\t") File "/opt/conda/lib/python3.9/site-packages/pandas/util/_decorators.py", line 311, in wrapper return func(*args, kwargs) File "/opt/conda/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 680, in read_csv return _read(filepath_or_buffer, kwds) File "/opt/conda/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 575, in _read parser = TextFileReader(filepath_or_buffer, kwds) File "/opt/conda/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 933, in init self._engine = self._make_engine(f, self.engine) File "/opt/conda/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 1235, in _make_engine return mapping[engine](f, self.options) File "/opt/conda/lib/python3.9/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 75, in init self._reader = parsers.TextReader(src, kwds) File "pandas/_libs/parsers.pyx", line 551, in pandas._libs.parsers.TextReader.cinit pandas.errors.EmptyDataError: No columns to parse from file

clb21565 commented 1 year ago

just updated-- thanks for the helpful hints and suggestions! let me know if anything else comes up, closing this for now.