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

Dies if filtering empty hit table #6

Open
Adamtaranto opened this issue Jan 20, 2020 · 0 comments
Open

Dies if filtering empty hit table #6

Adamtaranto opened this issue Jan 20, 2020 · 0 comments
Assignees
Labels

Comments

@Adamtaranto
Copy link
Owner

Throws error and dies when attempting to filter hits on prop model coverages if pandas table contains no hits.

Fix: Skip all downstream steps if no hits are imported OR if no hits remain after a filtering step.

Example:

Log: Loading nhmmer hits from: TIR32bpuniquealn.tab 
Log: Imported 0 hits from 1 models. 
Log: Filtering hits with < 0.4 model coverage. 
/Users/adamtaranto/anaconda/envs/py3/lib/python3.6/site-packages/pandas/core/ops.py:798: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
  result = getattr(x, name)(y)
Traceback (most recent call last):
  File "/Users/adamtaranto/anaconda/envs/py3/bin/tirmite", line 11, in <module>
    load_entry_point('tirmite', 'console_scripts', 'tirmite')()
  File "/Users/adamtaranto/ScienceProjects/TE-Projects/TIRmite/tirmite/cmd_tirmite.py", line 190, in main
    hitTable = tirmite.filterHitsLen(hmmDB=hmmDB, mincov=args.mincov, hitTable=hitTable)
  File "/Users/adamtaranto/tirmite/__init__.py", line 417, in filterHitsLen
    **hitTable = hitTable.ix[~((hitTable['model'] == model) & ((hitTable['hitEnd'].astype(int) - hitTable['hitStart'].astype(int)) + 1 < minlen))]**
  File "/Users/adamtaranto/anaconda/envs/py3/lib/python3.6/site-packages/pandas/core/ops.py", line 861, in wrapper
    res = na_op(values, other)
  File "/Users/adamtaranto/anaconda/envs/py3/lib/python3.6/site-packages/pandas/core/ops.py", line 800, in na_op
    raise TypeError("invalid type comparison")
TypeError: invalid type comparison

@Adamtaranto Adamtaranto self-assigned this Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant