<< Main Manual 

Using the Utility Scripts

NeuronetExperimenter comes with several utility scripts to make various operations easier, particularly those operations relating to the structure and content of the .net files. These scripts are installed into /usr/bin when you 'make install'. All the scripts have nne_ prepended to facilitate TAB-completion from most terminals. For example, typing 'nne_all2allN[TAB]' will autocomplete to 'nne_all2allNetwork'.



> nne_addConnections

usage: nne_addConnections
--network [network_filename] --connectionType [default='Excitatory'] --from [neuronType] --to [neuronType=number,...]

This script iterates over the 
network passed as argument and connects each neuron of the from type to a random neuron of the to type with a type connection. The number flag indicates how many outbound connections from each one of these neurons is made.

> nne_addNeurons

usage: nne_addNeurons
--network [network_filename] --neurons [type=number,...]

This script is like the nne_createNeurons script except it adds the neurons to a currently existing network.

> nne_all2allMatrix

usage: nne_all2allMatrix --output [output_filename
] --number [number of neurons] --allowAutapses [default=False]

This script generates an adjacency matrix for an all-to-all coupled network. For example,

> nne_all2allMatrix --output test.txt --number 50

will create an adjacency matrix with 50 rows and columns in the test.txt file, with all 1's except down the diagonal (no autapses). To add autapses, add the flag
--allowAutapses to the list of arguments when running the script.

> nne_all2allNetwork

usage: nne_all2allNetwork --network [network_filename] --type [default=Excitatory] --allowAutapses [default=False]                                                                                                       

This script takes the network passed in and writes out the same network with the neurons connected all-to-all. For example,

> nne_all2allNetwork --output zca.net --type Excitatory

will make the zca.net file connected all-to-all with 
Excitatory connections (with no autapses). To add autapses, add the flag --allowAutapses to the list of arguments when running the script. The type of connection should be defined in the models/connectionTypes.txt file. The input .net file should have each neuron listed sequentially like the output from the following script.

> nne_changeAttribute

usage: nne_changeAttribute --type [neuron_type] --change '[attribute operator(=,*,+,-,**,+=,*=,-=,**=) value]' --network [network_filename]

i.e.: nne_changeAttribute -n default.net -t rhmd_m -c 'g_CAN *= 2'

Additionally, specifying 'Neuron' as the type of neuron will change the attribute in all neurons.

This script makes it easy to change all the parameters or state variables of the neurons of a certain type. For example, to multiply all the 
gnap parameters for all the neurons called Butera by 2 use:

> nne_changeAttribute --network Butera.net --type Butera --change 'gnap *= 2'

You can also use this script to set the parameter values based on a distribution. For example, to set ek from a gaussian distribution with a mean of -55 and standard deviation of 5 use:

> nne_changeAttribute --network Butera.net --type Butera --change 'ek = gauss(-55,5)'

> nne_createNeurons

usage: nne_createNetwork --network [network_filename] --neurons [type=number,...]

This script generates a simple network of neurons with a given type. For example,

> nne_createNetwork --network test.net --neurons zca=50

will save a network of 50 'zca' neurons into test.net. The neurons are listed sequentially in the .net file so that the file can be used by Python scripts such as the previous one described in this document.

You can also add multiple types of neurons from this script as well. For example,

> nne_createNetwork --network test.net --neurons zca=50,Butera=100

will create a network with 50 'zca' neurons and 100 'Butera' neurons (total=150 neurons) and save these to test.net. Note that you can only use the neurons that are defined in your most recent NeuronetExperimenter binary.

> nne_getAdjacencyMatrixFromNetwork

usage: nne_getAdjacencyMatrixFromNetwork --network [network_filename]

This script returns a separate file representing the adjacency matrix 
for each connection type across the whole network.

> nne_getAttributes

usage: nne_getAttributes --network [network_filename]--get [ic1, param2,...]

This script prints directly to the console for each neuron (as a row) for each of the attributes (either state variables or parameters as columns) found in the network file. This is useful if you want to plot the distribution of some parameter or initial condition. You can send the results directly to a file with the '>' symbol. For example,

> nne_getAttributes --network test.net --get v,ca,gnap > out.txt

> nne_getNeuronTypes

usage: nne_getNeuronTypes

This script prints directly to the console a list of all the neuron types that have been compiled into the NeuronetExperimenter binary. The script does not require any options.

> nne_lesionNetwork

usage: nne_lesionNetwork --network [network_filename] --number [number of neurons to lesion]

This script randomly removes
from the network the number of neurons specified, while preserving the rest of the connections within the network.

> nne_loadBalanceNetwork

usage: nne_loadBalanceNetwork --network [network_filename]

This script shuffles the neurons so that if there are multiple types of neurons they alternate to make the network structure more balanced for parallel execution. The contents and topology will not change, but the order of the neurons in the file will change.

> nne_networkStats

usage: nne_networkStats --network [network_filename]

This script generates a set of network statistics to get an overview of topology, parameter distribution, etc.

> nne_removeAllConnections

usage: nne_
removeAllConnections --network [network_filename]

This script removes all the connections for all the neurons in the network.

> nne_removeConnectionsFromNeurons

usage: nne_
removeConnectionsFromNeurons --network [network_filename] --ids [id1,id2,id3]

This script removes all the connections from the neurons specified by the list of ID numbers.

> nne_removeNeurons

usage: nne_removeNeurons
--network [network_filename] --ids [id1,id2,id3]

This script removes specific neurons by ID # from a network while preserving the rest of the networks contents and topology. For example, to remove neurons with the IDs 4, 12, 21, use the command:

> nne_removeNeurons --network test.net --ids 4,12,21

> nne_removeNeuronsWithType

usage: nne_
removeNeuronsWithType --network [network_filename] --type [neuron type]

This script removes all the neurons with the specified neuron type from the network.

> nne_replayNetworkHistory

usage: nne_replayNetworkHistory --network [network_filename]

This script reruns the script operations found in the .history file corresponding to the .net file passed as argument.

> nne_setAdjacencyMatrixForNetwork

usage: nne_setAdjacencyMatrixForNetwork --adjacency [matrix_filename] --connectionType [default='Excitatory'] --network [network_filename]--map [neuron_type=connection_type,...]

This script uses the adjacency matrix and connection type passed as options and applies the connections to the network passed as argument. The 'map' option is useful, instead of the 'connectionType' option, if you have a neuron type that has a specific connection type associated with the neuron type. For example, in the following example, the 'zca' neurons are Excitatory and the 'Butera' neurons are Inhibitory, while the connectivity is completely described by the adjacency matrix passed as argument.

> nne_setAdjacencyMatrixForNetwork -a adjacencyMatrix.txt -n test.net -m zca=Excitatory,Butera=Inhibitory

> nne_summarizeNetwork

usage: nne_
summarizeNetwork --network [network_filename]

This script prints out a list of the neurons in order, along with neuron type, number of initial conditions, the number of parameters, and the number of inbound and outbound connections. 

<< Main Manual