dieterich-lab / scimodom

GNU Affero General Public License v3.0
0 stars 0 forks source link

Server: 'Job failed: "intersectBed" does not appear to be installed or on the path' only for certain queries #5

Closed eboileau closed 4 years ago

eboileau commented 4 years ago

bedtools v2.29.2 No issue with the dorina CLI.

This is completely reproducible. I have reproduced this without the Flask application as well:

# implement the Redis protocol
>>> conn = Redis(charset="utf-8", decode_responses=True)
# skipping a few lines

# define a working query "region_a": "intron"
>>> working_query = 'results:{"combine": "or", "genes": ["all"], "genome": "hg38", "match_a": "any", "match_b": "any", "region_a": "intron", "region_b": "any", "set_a": ["m6a_HEK293ATOA_hg38_all"], "set_b": null}'
>>> result = conn.lrange(working_query, 0, -1)
>>> len(result)
421312
# define a problematic query "region_a": "3prime"
>>> problematic_query = 'results:{"combine": "or", "genes": ["all"], "genome": "hg38", "match_a": "any", "match_b": "any", "region_a": "3prime", "region_b": "any", "set_a": ["m6a_HEK293ATOA_hg38_all"], "set_b": null}'
>>> result = conn.lrange(problematic_query, 0, -1)
>>> result
['Job failed: "intersectBed" does not appear to be installed or on the path, so this method is disabled.  Please install a more recent version of BEDTools and re-import to use this method.']

Note that bedtools is visible within the python environment

>>> os.getenv("PATH")
'/home/dorina/rmap/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/dorina/bedtools2-master/bin'

and as mentioned above, this works (this is the problematic query above)

dorina run hg38 --debug --seta "m6a_HEK293ATOA_hg38_all" --matcha any --regiona 3prime -p /home/dorina/data | wc -l
414076
eboileau commented 4 years ago

This is only on the server. My local installation works fine both CLI and WUI, for all queries (working and problematic). I have bedtools v2.29.1, but I doubt this is a bedtools (minor) version issue.

eboileau commented 4 years ago

Or directly:

redis-cli
127.0.0.1:6379> LRANGE 'results:{"combine": "or", "genes": ["all"], "genome": "hg38", "match_a": "any", "match_b": "any", "region_a": "3prime", "region_b": "any", "set_a": ["m6a_HEK293ATOA_hg38_all"], "set_b": null}' 0 -1
1) "Job failed: \"intersectBed\" does not appear to be installed or on the path, so this method is disabled.  Please install a more recent version of BEDTools and re-import to use this method."
eboileau commented 4 years ago

Somehow the DB contained a number of problematic queries... a simple flushall() solved it all! I did not experience this locally since redis-server was not constantly running. Would it be a good idea to flush everything on startup ?

conn = Redis(charset="utf-8", decode_responses=True)
conn.flushall()

There is a cleanup script, I need to check what it does, however it's not called from the app. For now, issue resolved.