GithubHelp home page GithubHelp logo

labbox-ephys's Introduction

Labbox-ephys

โš ๏ธ This repo is obsolete and has been replaced by sortingview.

Old instructions

labbox-ephys-install-tests

Analysis and visualization of neurophysiology recordings and spike sorting results.

Installation instructions (old)

You can either run labbox-ephys as a local web server, as a JupyterLab extension, or as a service in the cloud.

Information for developers (old)

Instructions for developers

Primary developers

Jeremy Magland and Jeff Soules

Center for Computational Mathematics, Flatiron Institute

labbox-ephys's People

Contributors

dependabot[bot] avatar jsoules avatar khl02007 avatar magland avatar wufan0504 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

labbox-ephys's Issues

Problem running in dev mode

I didn't have this problem before, but today I tried running in dev mode and every time after I run START DEV, I will either see

  1. "cannot find page" if I enter address "localhost:15310" directly from browser, or
  2. If I ctrl click the URL from the VS code terminal, my machine freezes.

elec geom not displaying for certain recordings

Elec geom not visible for:

http://ephys1.laboratorybox.org/default/recording/cortexlab-drift-dataset1?feed=sha1://5f1dad33f30081ce1206c10c668cd31936179733/feed.json

whereas it is visible for others:

http://ephys1.laboratorybox.org/default/recording/allen_mouse419112_probeE?feed=sha1://5f1dad33f30081ce1206c10c668cd31936179733/feed.json

I confirmed that the geom information is being sent to the client (by looking at incoming messages on the console). So this has something to do with the elec geom widget rendering.

prepare_snippets_h5: speed up transpose operation

It seems that the bottleneck for prepare_snippets_h5 is the transpose operation inside the Bin1RecordingExtractor. Here's some code from bin1recordingextractor.py:

        buf = kp.load_bytes(self._raw, start=i1, end=i2, p2p=self._p2p)
        X = np.frombuffer(buf, dtype=np.int16).reshape((end_frame - start_frame, self._raw_num_channels))
        
        # old method
        # ret = np.zeros((M, N))
        # for ii, ch_id in enumerate(channel_ids):
        #     ret[ii, :] = X[:, self._channel_map[str(ch_id)]]

        # new (equivalent method)
        X = X.T.copy() # this is the part we want to try to speed up
        ret = X[[int(self._channel_map[str(ch_id)]) for ch_id in channel_ids]]

I think it should be possible to speed up the transpose operation here.

Here's a script that times the transpose operation for various matrix sizes:

import time
import numpy as np
import matplotlib.pyplot as plt

def transpose_speed_test(M, N):
  X = (np.random.normal(0, 1, (N, M)) * 20).astype(np.int16)

  print('.')
  timer = time.time()
  X = X.T.copy()
  elapsed = time.time() - timer
  rate = (N/1000000)/elapsed
  print(f'Elapsed for transpose: {elapsed} sec')
  print(f'Rate: {rate} million frames/sec')
  return rate


M = 384 # number of channels
Ns = [100, 500, 1000, 5000, 10000, 50000, 100000, 500000] # number of timepoints
rates = [
  transpose_speed_test(M, N)
  for N in Ns
]

plt.plot(Ns, rates, 'b.')

Am I naive in thinking that the transfer rate should be roughly constant as N increases? I suppose this depends on the size of the cache.

Revise labbox-ephys installation instructions for Mac

Snags I hit:

  • It's in there already, but users should definitely confirm that docker run hello-world actually works from CLI before proceeding
  • home directory structure in the instructions assumes ubuntu/linux-style with user directory in /home/$USER but on my mac this was /USERS/$user
  • Might be a good idea to specify the version of Python to install via conda; a full exposition is beyond the scope etc etc but they should at least know to target 3.7 and install numpy.
  • Command lines in the "Launch the container" example box use the $LABBOX_EPHYS_DATA_DIR envvar, but we set it as $LABBOX_EPHYS_DATA above.

That said, having completed the instructions, I can connect to a basic labbox-ephys UI on localhost:15310. I see that the instructions for setting up a local compute resource are marked as obsolete so I haven't dug into those.

Problems with API and socket

We are attempting to build a testing environment where we could perform QA, but we have some troubles with API and sockets, the UI loads forever and network tab doesn't return any error so we might have some configuration issue.
In particular I'd like to know
1 - if there is any remote API that frontend can connect to
2 - how to change the url of API and websocket and any other BE serivce from localhost to the custom url

thank you for the help

Problem hosting compute resource

Reported by Fan:

hither-compute-resource start-kachery-server
Unexpected command: start-kachery-server

Oops I need to get the latest hither deployed to pypi... I'll follow up...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.