NEURON interfaces to MySQL and the SPUD feature extraction algorithm (Neymotin et al. 2008)

 Download zip file   Auto-launch 
Help downloading and running models
Accession:97868
See the readme.txt for information on setting up this interface to a MySQL server from the NEURON simulator. Note the SPUD feature extraction algorithm includes its own readme in the spud directory.
Reference:
1 . Neymotin S, Uhlrich DJ, Manning KA, Lytton WW (2008) Data mining of time-domain features from neural extracellular field data Applic. of Comput. Intel. in Bioinf. and Biomed.: Current Trends and Open Problems 151:119-140
Model Information (Click on a link to find other models with that property)
Model Type:
Brain Region(s)/Organism:
Cell Type(s):
Channel(s):
Gap Junctions:
Receptor(s):
Gene(s):
Transmitter(s):
Simulation Environment: NEURON;
Model Concept(s): Methods;
Implementer(s): Lytton, William [billl at neurosim.downstate.edu]; Neymotin, Sam [samn at neurosim.downstate.edu];
Files displayed below are from the implementation
// $Id: mysql_utils.hoc,v 1.11 2007/04/25 16:41:16 billl Exp $ 

objref g_sql_ref //global objref for sql funcs
g_sql_ref=new List()
mydbg=0

//creates a table in db currently connected to
//$s1 = table name
//$o2 = list of column names (as String objects or strdefs)
//$3 = whether to create index for each col
func CreateTable () { local idx,createidx localobj mys1,mytab,lcols

  mys1 = new String()  //sql command string
  mytab = new String() //table name

  if(argtype(1)==1){
    mytab = $o1
  } else if(argtype(1)==2){
    mytab = new String()
    mytab.s = $s1
  } else {
    printf("CreateTable ERR0: first arg must be string!\n")
    return 0
  }

  if(numarg()>2) createidx = $3 else createidx = 1

  sprint(mys1.s,"create table %s (",mytab.s)

  lcols = $o2

  //build table create string
  for(idx=0;idx<lcols.count;idx+=1){
    strcat(mys1,lcols.o(idx))
    strcat(mys1," double")
    if(idx < lcols.count - 1){
      strcat(mys1,",")
    } else {
      strcat(mys1,");")
    }
  }

  if(mydbg) printf("cmd=%s\n",mys1.s)

  //do actual mysql call to create table
  if(Query_mysql(mys1.s) == -1 ){
    printf("CreateTable ERRB: couldn't create table %s\n",$s1)
    return 0
  }

  //create indices
  if(createidx){
    for(idx=0;idx<lcols.count;idx+=1){
      sprint(mys1.s,"create index i%d on %s(%s);",idx,mytab.s,lcols.o(idx).s)
      if(mydbg) printf("idx cmd = %s\n",mys1.s)
      if(Query_mysql(mys1.s) == -1 ){
        printf("CreateTable Warning: Couldn't create index for col %s\n",lcols.o(idx))
      } else {
        if(mydbg) printf("Created MySQL index for col %s\n",lcols.o(idx).s)
      }
    }
  }

  return 1
}

// SelectedColNames() -- overwrites tstr
// returns List containing column names from last Select call
obfunc SelectedColNames(){ local icols,ii localobj ls,xo,yo,str2

  g_sql_ref=new List() //global list
  ls=new List()        //non-global list

  //# cols from last select
  icols = NumCols_mysql()

  //loop allocates space for strings passed to GetColNames_mysql
  for ii=0,icols-1 g_sql_ref.append(new String("                              "))
  tstr="GetColNames_mysql("
  str2=new String()
  for ii=0,icols-1{
    sprint(str2.s,"g_sql_ref.o(%d).s,",ii)
    strcat(tstr,str2.s)
  }
  chop(tstr) //get rid of last ','
  strcat(tstr,")")

  execute(tstr)

  //copy sqll into non-global list
  for ii=0,g_sql_ref.count-1{
    str2=new String()
    str2.s=g_sql_ref.o(ii).s
    ls.append(str2)
  }

  //return non-global list
  return ls
}

//converts the results of a sql select
//into an nqs db & returns it
//$s1 = sql query
obfunc sql2nqs () { local nrows,ncols,idx localobj nq,ls,xo
  if(Select_mysql($s1)==-1.0){printf("sql2nqs ERRA: Couldn't perform select") return nil}
  ls = SelectedColNames()
  nq = new NQS()
  for ltr(xo,ls) nq.resize(xo.s)
  nrows = NumRows_mysql()  ncols = ls.count
  nq.pad(nrows)
  nq.listvecs()
  if(GetRows_mysql(nq.vl)==-1.0){
    printf("sql2nqs ERRB: couldn't retrieve rows from sql select\n") return nil }
  return nq
}

//converts nqs database to sql format automatically creates indices
//$o1 = nqs
//$s2 = name of table in mysql db
//$3 = whether to create column nqs_row_id storing orig nqs row index
//$4 = whether to create mysql index on each col
// NB: table must not have 'index' as a col name: mysql reserved word
func nqs2sql () { local idx,ncols,nrows,makeidcol,makeidx localobj lcolnames,nq
  nq = $o1
  ncols=nq.m  nrows=nq.size(1)
  if(numarg()>=3) makeidcol = $3 else makeidcol = 0
  if(numarg()>=4) makeidx = $4 else makeidx = 1
  lcolnames = new List()
  nq.listvecs()
  for idx=0,ncols-1 lcolnames.append(nq.s[idx])
  if (makeidcol) { 
    nq.vl.append(nq.ind) vrsz(nrows,nq.ind) nq.ind.indgen(1) 
    lcolnames.append(new String("nqs_row_id"))
  }
  if(!CreateTable($s2,lcolnames,makeidx)) {
    printf("nqs2sql ERRA: couldn't create table %s\n",$s2) return 0 }
  if(!Insert_mysql($s2,nq.vl)) {
    printf("nqs2sql ERRB: couldn't insert nqs data into table %s\n",$s2) return  0 }
  return 1
}

func nqs2sql2 () { local idx,ncols,nrows,makeidcol,makeidx localobj lcolnames,nq
  nq = $o1 
  sprint(tstr,"/tmp/nqs2sl%f",rdm.uniform(0,1))
  tabform="\t" dblform="%f"
  nq.pr(tstr,"NOHEADER")
  sprint(tstr,"load data local infile '%s' into table %s",tstr,$s2)
  Query_mysql(tstr)
  return 1
}

Neymotin S, Uhlrich DJ, Manning KA, Lytton WW (2008) Data mining of time-domain features from neural extracellular field data Applic. of Comput. Intel. in Bioinf. and Biomed.: Current Trends and Open Problems 151:119-140

References and models cited by this paper

References and models that cite this paper

Adeli H, Zhou Z, Dadmehr N (2003) Analysis of EEG records in an epileptic patient using wavelet transform. J Neurosci Methods 123:69-87 [PubMed]

Ascoli GA, De Schutter E, Kennedy DN (2003) An information science infrastructure for neuroscience. Neuroinformatics 1:1-2 [Journal] [PubMed]

Carnevale NT, Hines ML (2006) The NEURON Book

Chamberlin DD,Boyce RF (1974) SEQUEL: A structured English query language, International Conference on Management of Data Proceedings of the 1974 ACM SIGFIDET (now SIGMOD) workshop on Data description, access and control, Ann Arbor, Michigan :249-264

Cooley JW, Connor CE (1965) An algorithm for the machine calculation of complex Fourier series Math Comput 19:297-301

Dunn JC (1973) A fuzzy relative of the ISODATA process and its use in detecting compact Well-Separated clusters Journal of Cybernetics 3:32-57 [Journal]

Golarai G, Cavazos JE, Sutula TP (1992) Activation of the dentate gyrus by pentylenetetrazol evoked seizures induces mossy fiber synaptic reorganization. Brain Res 593:257-64 [PubMed]

Hartigan JA, Wong MA (1979) Algorithm as 136: a k-means clustering algorithm J R Stat Soc Ser C 28:100-108

Hines ML, Carnevale NT (1997) The NEURON simulation environment. Neural Comput 9:1179-209 [PubMed]

Hines ML, Carnevale NT (2000) Expanding NEURON's repertoire of mechanisms with NMODL. Neural Comput 12:995-1007 [PubMed]

Johnson SG,Frigo M (2007) A modified split-radix FFT with fewer arithmetic operations IEEE Transactions on Signal Processing 55:111-119

Lytton WW (2006) Neural Query System: Data-mining from within the NEURON simulator. Neuroinformatics 4:163-76 [Journal] [PubMed]

   Neural Query System NQS Data-Mining From Within the NEURON Simulator (Lytton 2006) [Model]

Lytton WW, Omurtag A (2007) Tonic-clonic transitions in computer simulation. J Clin Neurophysiol 24:175-81 [PubMed]

   Tonic-clonic transitions in a seizure simulation (Lytton and Omurtag 2007) [Model]

Macqueen JB (1967) Some methods for classification and analysis of multivariate observations Proceedings Of 5th Berkeley Symposium On Mathematical Statistics And Probability 1:281-297

Sweldens W (1997) The lifting scheme: A construction of second generation wavelets SIAM Journal on Mathematical Analysis 29:511-546

Uhlrich DJ, Manning KA, O'Laughlin ML, Lytton WW (2005) Photic-induced sensitization: acquisition of an augmenting spike-wave response in the adult rat through repeated strobe exposure. J Neurophysiol 94:3925-37 [PubMed]

Neymotin SA, Hilscher MM, Moulin TC, Skolnick Y, Lazarewicz MT, Lytton WW (2013) Ih Tunes Theta/Gamma Oscillations and Cross-Frequency Coupling In an In Silico CA3 Model PLoS ONE 8(10):e76285 [Journal] [PubMed]

   Ih tunes oscillations in an In Silico CA3 model (Neymotin et al. 2013) [Model]

Neymotin SA, Lee H, Park E, Fenton AA, Lytton WW (2011) Emergence of physiological oscillation frequencies in a computer model of neocortex. Front Comput Neurosci 5:19-75 [Journal] [PubMed]

   Emergence of physiological oscillation frequencies in neocortex simulations (Neymotin et al. 2011) [Model]

(18 refs)