Last active
          December 22, 2018 18:31 
        
      - 
      
- 
        Save mattgaidica/464d84736600680035d78c14bfec365c to your computer and use it in GitHub Desktop. 
    SpikeSorter API call in Ruby
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require 'rubygems' | |
| require 'spikesorter-sx3' | |
| # Get your account sid and auth token from spikesorter.com | |
| account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
| auth_token = 'your_auth_token' | |
| @client = SpikeSorterSX3::REST::Client.new(account_sid, auth_token) | |
| spikes = @client.spikes | |
| .extract( | |
| data: '//path/to/data.raw', | |
| filter: 'yes', | |
| threshold: '100', | |
| channels: 16, | |
| ) | |
| puts spikes.sid | |
| # output | |
| { | |
| "account_sid": "SSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | |
| "api_version": "2018-10-30", | |
| "date_created": "Sat, 22 Dec 2018 15:09:59 +0000", | |
| "error_code": null, | |
| "compute_cost": -0.80, | |
| "cost_units": "USD", | |
| "data_out_uri": "/{#account_sid}/job/XXXXXXXX/data", | |
| "spike_count": 4944 | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment