Skip to content

Latest commit

 

History

History
73 lines (56 loc) · 2.7 KB

README.md

File metadata and controls

73 lines (56 loc) · 2.7 KB

catbot

Python 3 Slack bot to interface with CATMAID server, NBLAST and Zotero. Based on Slack's Python API (see here for documentation).

Quickstart

  1. Download catbot.py, botconfig.py and ffnblast.py
  2. Setup and configure botconfig.py (see below)
  3. Install dependencies
  4. Run catbot.py
  5. In Slack use @catbot help to get a list of possible commands

Dependencies

Python

slack_client, matplotlib, pymaid, tabulate, rpy2, pyzotero

R

elmr, flycircuit, vfbr, doMC

Configuration

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.

Using catbot to NBLAST

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).

nblast_example

nblast_webGL_result

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)

License:

This code is under GNU GPL V3