Python 3 Slack bot to interface with CATMAID server, NBLAST and Zotero. Based on Slack's Python API (see here for documentation).
- Download catbot.py, botconfig.py and ffnblast.py
- Setup and configure botconfig.py (see below)
- Install dependencies
- Run catbot.py
- In Slack use
@catbot help
to get a list of possible commands
slack_client, matplotlib, pymaid, tabulate, rpy2, pyzotero
elmr, flycircuit, vfbr, doMC
botconfig.py needs to hold credentials for CATMAID server, Slack and Zotero (optional)
#General parameters
BOT_NAME = 'catbot'
BOT_ID = ''
AT_BOT = '<@' + BOT_ID + '>'
READ_WEBSOCKET_DELAY = 1 # 1 second delay between reading from firehose
MAX_PARALLEL_REQUESTS = 10 # not more than 10 threads at any given time
#Catmaid credentials
SERVER_URL = ''
AUTHTOKEN = ''
HTTP_USER = ''
HTTP_PW = ''
#Slack credentials
SLACK_KEY = ''
#Zotero credentials
ZOT_KEY = ''
ZOT_GRP_ID = ''
#Nblast databases
FLYCIRCUIT_DB = 'url to dpscanon.rds'
JANELIA_GMR_DB = 'url to gmrdps.rds'
See here on how to setup bot_id and Slack key
See here on Zotero keys and grp ids.
Use @catbot nblast #skid
to have catbot perform a nblast search. This relies on R being installed and configured to use elmr and its dependencies. Please make sure that you can run e.g. the example in ?nblast_fafb
Catbot will return a list of top hits and their nblast scores plus a .html file containing a WebGL rendering of the first few hits (see screenshot).
Optional arguments:
nomirror
to set mirror=F (default = T)
hits=N
to set number of hits to include in the 3D WebGL file (default = 3)
This code is under GNU GPL V3