BACKGROUND
there is little doubt that neurons are elementary building blocks of the nervous system  <cit> .
it is less clear, however, whether multi-neuron modules  can be meaningfully defined, either anatomically  <cit>  or physiologically  <cit> .
the existence of such multi-neuron modules would greatly simplify the description of nervous system structure and function.
an example of such simplification can be found in electrical engineering.
an electronic circuit is often represented in terms of modules such as operational amplifiers, logical gates and memory registers rather than as a wiring diagram showing each transistor, resistor and diode.
however, unlike electrical engineers who designed these modules themselves, neurobiologists did not design the brain, and evolution rarely leaves records of its experimentation.
therefore, if multi-neuron modules have indeed evolved they need to be discovered.
in this paper, we search for anatomically defined multi-neuron modules in the caenorhabditis elegans nervous system.
we choose c. elegans as a model organism because its wiring diagram is largely known, including the identities of all  <dig> neurons and most synapses between them  <cit> .
our approach follows the reasoning developed previously in the context of gene regulation and other networks  <cit> .
if a certain multi-neuron module performs some stereotypical function it may appear in the nervous system repeatedly.
therefore, search for multi-neuron connectivity patterns that appear more often than by "chance"  may yield these multi-neuron modules.
of course, there may be functionally important modules that appear infrequently and would be missed by our analysis.
in the electronic circuit analogy, our approach would discover logical gates in a processor wiring diagram but not a rectifier in a power supply, which is essential but appears only once.
to search for n-neuron modules, we sort all n-neuron combinations into classes defined by their inter-connectivity pattern and count the number of combinations in each class.
by comparing these counts with the mean counts from random networks, constructed based on our expectations, we detect significantly over-represented patterns, or motifs.
in order to avoid assigning significance to a n-neuron pattern just because it contains n-1-neuron motifs we incorporate the n-1-neuron statistics into the expectations used to search for n-neuron motifs  <cit> .
to do this, we perform our search sequentially, by starting with doublets  and then increasing the number n of neurons included in the pattern sequentially up to quintuplets .
we look for motifs in the wiring diagram of the c. elegans nerve ring  assembled in two datasets  <cit> .
datasets  <dig> and  <dig> were obtained from serial-sections electron microscopic  reconstructions of two different animals  <cit> ; for details see methods.
the datasets contain the numbers of synapses formed in a subset of c. elegans neurons.
two given neurons may be connected by more than one synapse, which we call the multiplicity of connection.
however, the small size of the dataset compels us to use the binary representation of these connections .
in order to obtain binary connectivity matrices, we threshold the multiplicity of connections at various values Θ: pairs having less than Θ synapses are considered unconnected while those having at least Θ synapses are considered connected.
such procedure is justified because more than a single synaptic contact may be necessary for an observable physiological effect of one neuron on another.
since we do not know the physiologically relevant count of synapses, we repeat our calculation for  <dig> ≤ Θ ≤  <dig>
unfortunately, datasets  <dig> and  <dig> contain a caveat of synaptic ambiguities, which arises from the limitations of em in c. elegans.
when one pre-synaptic neuron makes contact with two adjacent processes of different neurons , it is not known which of these processes acts as a post-synaptic terminal; both might be involved.
we address this ambiguity by performing our analysis in two ways.
in the main text we present the results obtained on the datasets that include both send and send_joint synaptic connections.
we repeated the analysis on the datasets where send_joint synapses were split equally between the two potential post-synaptic partners.
specifically, we calculated multiplicity of connections by adding send_joint synapses at 50% synaptic strength.
in the limit of high multiplicity, this is equivalent to assigning the post-synaptic neuron by chance.
we find essentially the same results for this connectivity dataset .
RESULTS
bi-directionally connected doublets  are over-represented
we classify all possible doublets  of the c. elegans neurons into three classes: unconnected, uni-directionally connected and bi-directionally connected, and compare the number of doublets in each class to that expected in a random network .
the random network ensemble consists of connectivity matrices that preserve the numbers of incoming and outgoing synapses for each neuron but not the identities of the partners  <cit> .
the motivation behind this choice of the random matrix ensemble and the details of the algorithm are explained in methods.
we find that the number of doublets in each class deviates from the mean of the random matrix counts, as shown in figure  <dig> for a representative threshold Θ =  <dig>  for the purposes of module search, the most interesting finding is the over-representation of the reciprocally connected doublets , for two reasons.
first, if a set of neurons were to function as a module it should not consist of two  disconnected subsets.
this consideration rules out pattern # <dig>  second, since our search for modules is aimed at identifying over-represented inter-connectivity patterns we are less interested in under-represented ones.
this consideration rules out pattern # <dig>  we note that pattern counts are not independent, but are subject to sum rules.
for example, the number of neurons in the network fixes the total doublet count.
also, the total number of connections is equal to the count of pattern # <dig> plus twice the count of pattern # <dig>  these sum rules place stringent constraints on possible combinations of doublet counts.
yet, for patterns with greater number of neurons , these constraints become less stringent because the number of patterns increases .
we repeat the above calculations for other datasets and threshold values and consistently find the significant over-representation of bi-directionally connected doublets .
in c. elegans, such over-representation was reported previously on a qualitative level  <cit> .
interestingly, an over-representation of bi-directionally connected doublets was also found for pyramidal neurons in mammalian neocortex  <cit> .
this suggests that motifs may represent evolutionary conservation or convergence driven by similar computational constraints.
next, we discuss whether c. elegans can provide a clue to the functional significance of the over-representation of reciprocally connected doublets.
can bilateral  symmetry of the c. elegans neuronal network account for the over-representation of the reciprocally connected doublets?
indeed, about two thirds of c. elegans neurons have a bilaterally symmetric partner.
if connections between these pairs obeyed bilateral symmetry then they could not be uni-directional, creating a bias in favor of bi-directional connections.
to see whether this is the case, we calculate the percentage of bi-directional connected doublets, which consist of a bilateral neuron pair.
we find that these percentages are small:  <dig> % and  <dig> % in datasets  <dig> and  <dig>  respectively.
therefore, bilateral symmetry is not sufficient to explain the observed result.
the over-representation of reciprocally connected doublets in c. elegans has been explained  <cit>  as a consequence of correlation between adjacency and connectivity of neurons.
the argument is that, if there is a synapse from neuron a to neuron b, they must be adjacent.
if neurons a and b are adjacent then a synapse from b to a is more likely than chance, increasing the probability of a reciprocal connection.
analysis of original em reconstructions  <cit>  supports this argument  <cit> .
adjacency in this case does not refer to the nearby placement of cell bodies but to the number of em sections  in which the processes of the two neurons are in contact  <cit> .
although correlation between adjacency and connectivity may account for the over-representation of reciprocally connected doublets, why such correlation would exist in c. elegans remains unclear.
it could be that the number of neuronal pairs, which can be adjacent, is limited by physical constraints.
this would restrict the adjacent pairs only to the ones that need to connect for functional reasons.
indeed, volume exclusion explains neuron dimensions in the cortical column .
in the c. elegans network, however, the small number of neurons should in principle allow a contact between any pair of neurons.
this argument is supported by the observation that many neuronal processes are longer than the distance between the corresponding cell bodies, suggesting that the connection can be made.
however, processes tend to run in bundles and make synapses only in their  neighborhoods  <cit> .
this suggests that other  constraints may restrict the number of adjacent neurons.
alternatively, it could be that network functionality requires over-representation of reciprocal connections .
these issues must be explored in the future.
several triplet classes  are over-represented
we classify all connected triplets in the c. elegans wiring diagram into  <dig> classes and count the number of triplets in each class.
we compare the actual number of triplets in each class to the null-hypothesis random matrix ensemble defined as follows.
in order to include the observed over-representation of reciprocally connected doublets, we construct random networks that preserve the numbers of bi-directional and uni-directional connections for each neuron.
figure  <dig> shows triplet counts for each class relative to the mean of the random matrix ensemble.
for threshold Θ =  <dig> we find that several triplet counts are noticeably different from the mean of the random matrix ensemble, e.g.
patterns # <dig>  # <dig>  # <dig> and, possibly, # <dig> and/or # <dig> in figure  <dig>  similar results were found for other values of the threshold .
are these differences between triplet counts in actual and random networks significant?
one might answer this question by calculating, for each class, a significance p-value, i.e.
the probability of finding a random matrix with deviation from the mean exceeding or equal to that for the actual network.
although such an approach would be correct if over-representation of a single class were examined, it would over-estimate the true significance  when many different classes are evaluated simultaneously.
this situation is known as multiple hypothesis testing and requires an adjustment of the raw p-values .
we chose to perform multiple hypothesis testing adjustment by controlling the family-wise error rate, i.e.
the probability of mistakenly reporting at least one non-over-represented pattern, by using the single-step min p procedure  <cit> .
the adjusted p-values for every class and threshold represent the probability of finding a random matrix r, in which at least one class i has smaller  raw p-value than that found for a given class and threshold in the actual network.
this measure can be calculated by counting the number of random matrices, which have a smaller  raw p-value  than that in the actual network for a given class and threshold.
by dividing this number of matrices by the total size of the random matrix ensemble, we estimate the multiple hypotheses testing corrected significance measure pm for each class and threshold, figure  <dig> .
according to the significance measure, pm, one of the most consistently over-represented motifs is the feedforward loop , previously noticed in c. elegans  <cit>  and other networks  <cit> .
for the full list of feedforward loops see supplementary information .
could some known feature of neuronal organization account for the observed over-representation of the feedforward loop?
we consider two hypotheses:
i. the three-layered feedforward neuronal network is not sufficient to account for over-representation of the feedforward loop
if one views the c. elegans nervous system as a three-layer feedforward network, where sensory neurons synapse mostly on interneurons, and interneurons synapse on other interneurons or motorneurons, this could explain the over-representation of the feedforward loop.
we argue that this is not the case for two reasons.
first, the feedforward loop is also over-represented among interneurons .
second, the three-layer model of the c. elegans nervous system is overly simplified.
for example, there are feedback connections from interneurons to sensory neurons and from motorneurons to interneurons.
to evaluate whether detected feedforward loops fit the three-layer feedforward network, we analyze the function of the neurons in these loops.
about 40% of the detected feedforward loops either contain all neurons from the same functional group or at least one connection goes from a neuron in a lower layer to a neuron in a higher layer, table  <dig>  these loops do not fit into this three-layer model, undermining the hypothesis.
ii.
the likelihood of connectivity between nearby neurons may partially account for over-representation of the feedforward loop
since connectivity and adjacency are correlated in c. elegans and other nervous systems one could argue the following  <cit> .
if two neurons have a common synaptic partner, then they are likely to be adjacent to that common partner, and hence to each other.
if the two neurons are adjacent they are likely to be connected to each other.
again, adjacency cannot refer to the cell body position: the fraction of over-represented triplets that consist of neurons belonging to the same ganglia is typically less than 30%.
yet this argument could be valid if the adjacency refers to the contacts between neuronal processes  and needs to be verified using original em reconstructions  <cit> .
the problem with this argument is that it would also predict an over-representation of all strongly connected patterns , as opposed to the weakly connected patterns .
yet, strongly connected triplet classes # <dig> and # <dig>  are not over-represented  so further explanation is required.
it is possible that the over-representation of the feedforward loop is a consequence of other factors or their combinations .
but even if these factors are found, the characterization of the network in terms of over-represented motifs remains valid.
the over-representation of the feedforward loop still requires a functional explanation just as the bi-directionally connected doublet does.
in gene transcription regulation networks, the feedforward loop was proposed to carry out information processing functions such as filtering out fluctuations and responding only to persistent stimuli  <cit> .
feedforward loop can also carry out other functions  <cit> , depending on the polarity of synapses involved and the dynamic response of neurons.
once these factors are established experimentally, motif function can be analyzed theoretically.
in addition to the feedforward loop, we find that two other  patterns are consistently over-represented: pattern # <dig> and pattern # <dig> .
for the full list of these patterns see supplementary information .
previous work  <cit>  did not identify these patterns as motifs because of their low absolute count at the only threshold considered .
again, we ask whether this could be a consequence of the bilateral symmetry of the c. elegans nervous system.
indeed, the bilateral symmetry implies that pairs of bilaterally symmetric neurons are also connected symmetrically, meaning that triplets containing such a pair are likely to be symmetric.
however, we find that the fraction of triplets # <dig> and # <dig> containing a bilaterally symmetric pair of neurons and an unpaired neuron is rather small .
this suggests that the bilateral symmetry of the nervous system is not sufficient to explain the over-representation of pattern # <dig> and # <dig>
just like in any other screening algorithm, our criteria for outliers are somewhat subjective and the goal is to draw attention to interesting candidates.
we limit our discussion to over-represented patterns # <dig>  # <dig> and # <dig> because in our judgment they are most robust outliers based on the several criteria used.
the reader may judge that some other patterns are over-represented as well.
for example, patterns # <dig> and # <dig> are significantly over-represented for small thresholds .
because the absolute counts of these patterns in the c. elegans network are small, we cannot verify that they are consistently over-represented.
further work on larger datasets will show whether these patterns may be viewed as motifs.
several quadruplet classes  are over-represented
we classify all connected quadruplets into  <dig> classes and count the number of quadruplets in each class.
then we compare the actual counts of quadruplets in each class to the mean counts of quadruplets in a random matrix ensemble.
in this case, random matrices preserve the numbers of uni-directional and bi-directional connections for each neuron and, in addition, the numbers of triplets .
because of the large number of quadruplet classes, we show results  only for patterns selected according to the following criteria: the multiple hypothesis testing corrected significance values pm must be less than  <dig>  for at least one threshold per pattern, while the number of quadruplets in the actual network must be at least  <dig>  the last condition excludes patterns that may appear as over-represented due to very small quadruplet counts.
we find that quadruplet pattern # <dig> is consistently over-represented  <cit> .
can we explain this observation by some other known factor?
we consider the following two hypotheses:
i. bilateral symmetry of the nervous system is not sufficient to explain the over-representation of the quadruplet pattern #45
one could propose that symmetric patterns should be over-represented because of the bilateral symmetry of the nervous system.
we think that this argument by itself cannot explain the observed over-representation for two reasons.
first, the fraction of feedforward quadruplets containing two bilaterally symmetric neuron pairs in motif  <dig> is rather small .
second, many symmetric patterns are not over-represented, such as, for example, patterns  <dig>   <dig>   <dig>   <dig>   <dig>   <dig> and  <dig> .
ii.
feedforward structure of the nervous system may partially explain the over-representation of the feedforward quadruplet
one could propose that the feedforward three-layer structure of the nervous system could account for this observation .
we find that 14% to 37% of the feedforward quadruplets do not fit into this proposition because either they contain a feedback connection or all neurons belong to the same layer .
after comparing these percentages to the relative excess values we conclude that the feedforward structure may explain over-representation for some threshold values but not for others.
it is possible that some other factors  account for the reported quadruplet over-representation.
just as argued in case of triplets, discovering these factors would be complementary to the characterization of the over-represented motif.
it would be particularly interesting to determine the functional role of these motifs.
again, we arbitrarily limit our discussion of over-represented quadruplets to pattern # <dig>  the reader may judge that some other patterns are over-represented and deserve attention .
this is why in figure  <dig> we show all the outliers satisfying relatively weak criteria.
we find no over-represented quintuplet classes
we classify all connected quintuplets into  <dig> classes  and count the actual number of quintuplets in each class.
we compare these counts with the mean of the random matrix ensemble.
in this case, the random matrices preserve the numbers of uni- and bi-directional connections for each neuron and, in addition, keep the numbers of all triplets and quadruplets in a 10% range of the actual network.
we do not find any significantly over-represented quintuplets.
this could happen because there are no significantly over-represented quintuplets with a given number of quadruplets.
alternatively, this could happen because specifying the numbers of triplets and quadruplets constrains the number of quintuplets in any random matrix the size of the c. elegans network.
therefore, absence of significantly over-represented quintuplets in c. elegans does not rule out the existence of five-neuron modules that can be detected as motifs by applying our algorithm to larger networks.
discussion
by comparing counts of multi-neuron patterns in the c. elegans wiring diagram to the mean counts of the appropriate random matrix ensemble, we find several over-represented motifs.
first, we find that bi-directionally connected doublets  are over-represented, given the number of connections on each neuron is fixed.
second, several triplet classes  are over-represented, given the actual number of bi-directional  connections for each neuron.
third, we find that several quadruplet classes  are over-represented, given the numbers of triplets are preserved in addition to previously listed constraints.
we find no over-represented quintuplet classes.
some of these results, such as the over-representation of the feedforward loop and the feedforward quadruplet, have been reported previously  <cit> .
the current paper extends and complements previous reports by performing a systematic motif search for various connection multiplicity thresholds and rigorous statistical significance assessment.
also, we consider whether the discovered motifs can be accounted for by previously known facts about the organization of the nervous system.
there is no functional explanation for the existence of the motifs.
therefore, the identified motifs are candidates for modules that may perform stereotypical functions in the c. elegans nervous system, and they need to be investigated further.
although the main motivation for this work, search for modules, led to our focus on over-represented patterns, we also checked for under-representation.
for example, previous work indicated that the number of triplets with pattern # <dig>  was small  <cit> .
to determine significance, we applied the single-step min p procedure to the absolute value of the deviation of counts from the mean.
we found that the feedforward loop is not significantly under-represented, yet many other patterns, such as weakly connected triplets were significantly under-represented .
our motif search algorithm is different from previous attempts to find modules  <cit> .
for example, traditional clustering approaches look for the subsets of nodes, which are connected with their own subset more strongly than with other subsets.
in our algorithm, we consider all the connections within a pattern  but ignore the connections with neurons outside the pattern.
one could question the expediency of ignoring multiple possible inputs to the neurons in a module since those inputs could influence the operation of that module.
to counter this, we point out that if there were a particularly recurring way to attach an external connection to a given n-neuron motif then it would appear as an n + 1-neuron motif.
if, on the other hand, the motif is connected in many different ways in different instances, their significance will be washed out.
thus our approach may hierarchically detect modules with recurring input/output sites, growing them out of smaller patterns.
a second justification for looking at n-neuron patterns is that the nervous system is capable of performing many different functions under different circumstances and neurons active in one case may be silent in another.
therefore, in any particular case, many of the anatomical inputs to the module may remain silent and can safely be ignored.
this speculation may be verified experimentally by simultaneous monitoring of neuronal activity in different neurons.
the strategy and algorithms we described in this paper can be applied to incompletely mapped networks because a highly significant pattern is also likely to be over-represented in a sub-network.
however, the statistical power of our algorithm increases with the knowledge of the wiring diagram.
therefore it was natural to choose the c. elegans nervous system, whose wiring diagram is largely known.
unfortunately, c. elegans has some disadvantages when it comes to the interpretation of the results: the polarity of a synapse  in c. elegans is often unknown; electrophysiological investigations are still difficult in c. elegans  <cit> ; and the whole network contains only  <dig> neurons, limiting the statistical power of the approach.
yet we hope that recent technological developments  <cit>  will eliminate the first two disadvantages and allow functional analysis of the discovered modules.
moreover, we expect that our results have implications for understanding nervous system structure and function beyond c. elegans.
the modules we identify in c. elegans may be a general property of the nervous system, and, once identified, can be searched for in other species.
finally, the algorithm itself can be applied to other networks  <cit>  once they become available.
as in any other theoretical analysis, we made several simplifications.
for example, we assumed that the strength of synaptic connection between a pair of neurons is characterized by its multiplicity .
this assumption may be questioned if synapses implementing high-multiplicity connections are weaker than those implementing low-multiplicity connections, as known to happen in nematodes  <cit> .
yet, this assumption represents a reasonable first step in the systematic quantitative analysis, which may be extended in the future by estimating synaptic strength from the original em reconstructions.
in addition, we ignored the polarity of the synapses and the existence of gap junctions.
yet our results are robust to the inclusion of these factors in the future because if an over-represented class is found, it will remain over-represented even if divided into smaller sub-classes.
it would be interesting to see whether the inclusion of the above factors will reveal specific over-represented sub-classes.
CONCLUSIONS
we have shown that certain neuronal connectivity patterns are significantly over-represented in the c. elegans nervous system.
these patterns, called motifs, are candidates for computational modules that may perform stereotypical functions.
it would be interesting to determine what these functions are and whether these motifs appear in other nervous systems.

 there is little doubt that neurons are elementary building blocks of the nervous system. it is less clear, however, whether multi-neuron modules can be meaningfully defined, either anatomically or physiologically. the existence of such multi-neuron modules would greatly simplify the description of nervous system structure and function. an example of such simplification can be found in electrical engineering. an electronic circuit is often represented in terms of modules such as operational amplifiers, logical gates and memory registers rather than as a wiring diagram showing each transistor, resistor and diode. however, unlike electrical engineers who designed these modules themselves, neurobiologists did not design the brain, and evolution rarely leaves records of its experimentation. therefore, if multi-neuron modules have indeed evolved they need to be discovered. in this paper, we search for anatomically defined multi-neuron modules in the caenorhabditis elegans nervous system. we choose c. elegans as a model organism because its wiring diagram is largely known, including the identities of all neurons and most synapses between them. our approach follows the reasoning developed previously in the context of gene regulation and other networks. if a certain multi-neuron module performs some stereotypical function it may appear in the nervous system repeatedly. therefore, search for multi-neuron connectivity patterns that appear more often than by "chance" may yield these multi-neuron modules. of course, there may be functionally important modules that appear infrequently and would be missed by our analysis. in the electronic circuit analogy, our approach would discover logical gates in a processor wiring diagram but not a rectifier in a power supply, which is essential but appears only once. to search for n-neuron modules, we sort all n-neuron combinations into classes defined by their inter-connectivity pattern and count the number of combinations in each class. by comparing these counts with the mean counts from random networks, constructed based on our expectations, we detect significantly over-represented patterns, or motifs. in order to avoid assigning significance to a n-neuron pattern just because it contains n-1-neuron motifs we incorporate the n-1-neuron statistics into the expectations used to search for n-neuron motifs. to do this, we perform our search sequentially, by starting with doublets and then increasing the number n of neurons included in the pattern sequentially up to quintuplets. we look for motifs in the wiring diagram of the c. elegans nerve ring assembled in two datasets. datasets and were obtained from serial-sections electron microscopic reconstructions of two different animals; for details see methods. the datasets contain the numbers of synapses formed in a subset of c. elegans neurons. two given neurons may be connected by more than one synapse, which we call the multiplicity of connection. however, the small size of the dataset compels us to use the binary representation of these connections. in order to obtain binary connectivity matrices, we threshold the multiplicity of connections at various values Θ: pairs having less than Θ synapses are considered unconnected while those having at least Θ synapses are considered connected. such procedure is justified because more than a single synaptic contact may be necessary for an observable physiological effect of one neuron on another. since we do not know the physiologically relevant count of synapses, we repeat our calculation for ≤ Θ ≤ unfortunately, datasets and contain a caveat of synaptic ambiguities, which arises from the limitations of em in c. elegans. when one pre-synaptic neuron makes contact with two adjacent processes of different neurons, it is not known which of these processes acts as a post-synaptic terminal; both might be involved. we address this ambiguity by performing our analysis in two ways. in the main text we present the results obtained on the datasets that include both send and send_joint synaptic connections. we repeated the analysis on the datasets where send_joint synapses were split equally between the two potential post-synaptic partners. specifically, we calculated multiplicity of connections by adding send_joint synapses at 50% synaptic strength. in the limit of high multiplicity, this is equivalent to assigning the post-synaptic neuron by chance. we find essentially the same results for this connectivity dataset.  bi-directionally connected doublets are over-represented we classify all possible doublets of the c. elegans neurons into three classes: unconnected, uni-directionally connected and bi-directionally connected, and compare the number of doublets in each class to that expected in a random network. the random network ensemble consists of connectivity matrices that preserve the numbers of incoming and outgoing synapses for each neuron but not the identities of the partners. the motivation behind this choice of the random matrix ensemble and the details of the algorithm are explained in methods. we find that the number of doublets in each class deviates from the mean of the random matrix counts, as shown in figure for a representative threshold Θ = for the purposes of module search, the most interesting finding is the over-representation of the reciprocally connected doublets, for two reasons. first, if a set of neurons were to function as a module it should not consist of two disconnected subsets. this consideration rules out pattern # second, since our search for modules is aimed at identifying over-represented inter-connectivity patterns we are less interested in under-represented ones. this consideration rules out pattern # we note that pattern counts are not independent, but are subject to sum rules. for example, the number of neurons in the network fixes the total doublet count. also, the total number of connections is equal to the count of pattern # plus twice the count of pattern # these sum rules place stringent constraints on possible combinations of doublet counts. yet, for patterns with greater number of neurons, these constraints become less stringent because the number of patterns increases. we repeat the above calculations for other datasets and threshold values and consistently find the significant over-representation of bi-directionally connected doublets. in c. elegans, such over-representation was reported previously on a qualitative level. interestingly, an over-representation of bi-directionally connected doublets was also found for pyramidal neurons in mammalian neocortex. this suggests that motifs may represent evolutionary conservation or convergence driven by similar computational constraints. next, we discuss whether c. elegans can provide a clue to the functional significance of the over-representation of reciprocally connected doublets. can bilateral symmetry of the c. elegans neuronal network account for the over-representation of the reciprocally connected doublets? indeed, about two thirds of c. elegans neurons have a bilaterally symmetric partner. if connections between these pairs obeyed bilateral symmetry then they could not be uni-directional, creating a bias in favor of bi-directional connections. to see whether this is the case, we calculate the percentage of bi-directional connected doublets, which consist of a bilateral neuron pair. we find that these percentages are small: % and % in datasets and respectively. therefore, bilateral symmetry is not sufficient to explain the observed result. the over-representation of reciprocally connected doublets in c. elegans has been explained as a consequence of correlation between adjacency and connectivity of neurons. the argument is that, if there is a synapse from neuron a to neuron b, they must be adjacent. if neurons a and b are adjacent then a synapse from b to a is more likely than chance, increasing the probability of a reciprocal connection. analysis of original em reconstructions supports this argument. adjacency in this case does not refer to the nearby placement of cell bodies but to the number of em sections in which the processes of the two neurons are in contact. although correlation between adjacency and connectivity may account for the over-representation of reciprocally connected doublets, why such correlation would exist in c. elegans remains unclear. it could be that the number of neuronal pairs, which can be adjacent, is limited by physical constraints. this would restrict the adjacent pairs only to the ones that need to connect for functional reasons. indeed, volume exclusion explains neuron dimensions in the cortical column. in the c. elegans network, however, the small number of neurons should in principle allow a contact between any pair of neurons. this argument is supported by the observation that many neuronal processes are longer than the distance between the corresponding cell bodies, suggesting that the connection can be made. however, processes tend to run in bundles and make synapses only in their neighborhoods. this suggests that other constraints may restrict the number of adjacent neurons. alternatively, it could be that network functionality requires over-representation of reciprocal connections. these issues must be explored in the future. several triplet classes are over-represented we classify all connected triplets in the c. elegans wiring diagram into classes and count the number of triplets in each class. we compare the actual number of triplets in each class to the null-hypothesis random matrix ensemble defined as follows. in order to include the observed over-representation of reciprocally connected doublets, we construct random networks that preserve the numbers of bi-directional and uni-directional connections for each neuron. figure shows triplet counts for each class relative to the mean of the random matrix ensemble. for threshold Θ = we find that several triplet counts are noticeably different from the mean of the random matrix ensemble, e.g. patterns # # # and, possibly, # and/or # in figure similar results were found for other values of the threshold. are these differences between triplet counts in actual and random networks significant? one might answer this question by calculating, for each class, a significance p-value, i.e. the probability of finding a random matrix with deviation from the mean exceeding or equal to that for the actual network. although such an approach would be correct if over-representation of a single class were examined, it would over-estimate the true significance when many different classes are evaluated simultaneously. this situation is known as multiple hypothesis testing and requires an adjustment of the raw p-values. we chose to perform multiple hypothesis testing adjustment by controlling the family-wise error rate, i.e. the probability of mistakenly reporting at least one non-over-represented pattern, by using the single-step min p procedure. the adjusted p-values for every class and threshold represent the probability of finding a random matrix r, in which at least one class i has smaller raw p-value than that found for a given class and threshold in the actual network. this measure can be calculated by counting the number of random matrices, which have a smaller raw p-value than that in the actual network for a given class and threshold. by dividing this number of matrices by the total size of the random matrix ensemble, we estimate the multiple hypotheses testing corrected significance measure pm for each class and threshold, figure. according to the significance measure, pm, one of the most consistently over-represented motifs is the feedforward loop, previously noticed in c. elegans and other networks. for the full list of feedforward loops see supplementary information. could some known feature of neuronal organization account for the observed over-representation of the feedforward loop? we consider two hypotheses: i. the three-layered feedforward neuronal network is not sufficient to account for over-representation of the feedforward loop if one views the c. elegans nervous system as a three-layer feedforward network, where sensory neurons synapse mostly on interneurons, and interneurons synapse on other interneurons or motorneurons, this could explain the over-representation of the feedforward loop. we argue that this is not the case for two reasons. first, the feedforward loop is also over-represented among interneurons. second, the three-layer model of the c. elegans nervous system is overly simplified. for example, there are feedback connections from interneurons to sensory neurons and from motorneurons to interneurons. to evaluate whether detected feedforward loops fit the three-layer feedforward network, we analyze the function of the neurons in these loops. about 40% of the detected feedforward loops either contain all neurons from the same functional group or at least one connection goes from a neuron in a lower layer to a neuron in a higher layer, table these loops do not fit into this three-layer model, undermining the hypothesis. ii. the likelihood of connectivity between nearby neurons may partially account for over-representation of the feedforward loop since connectivity and adjacency are correlated in c. elegans and other nervous systems one could argue the following. if two neurons have a common synaptic partner, then they are likely to be adjacent to that common partner, and hence to each other. if the two neurons are adjacent they are likely to be connected to each other. again, adjacency cannot refer to the cell body position: the fraction of over-represented triplets that consist of neurons belonging to the same ganglia is typically less than 30%. yet this argument could be valid if the adjacency refers to the contacts between neuronal processes and needs to be verified using original em reconstructions. the problem with this argument is that it would also predict an over-representation of all strongly connected patterns, as opposed to the weakly connected patterns. yet, strongly connected triplet classes # and # are not over-represented so further explanation is required. it is possible that the over-representation of the feedforward loop is a consequence of other factors or their combinations. but even if these factors are found, the characterization of the network in terms of over-represented motifs remains valid. the over-representation of the feedforward loop still requires a functional explanation just as the bi-directionally connected doublet does. in gene transcription regulation networks, the feedforward loop was proposed to carry out information processing functions such as filtering out fluctuations and responding only to persistent stimuli. feedforward loop can also carry out other functions, depending on the polarity of synapses involved and the dynamic response of neurons. once these factors are established experimentally, motif function can be analyzed theoretically. in addition to the feedforward loop, we find that two other patterns are consistently over-represented: pattern # and pattern #. for the full list of these patterns see supplementary information. previous work did not identify these patterns as motifs because of their low absolute count at the only threshold considered. again, we ask whether this could be a consequence of the bilateral symmetry of the c. elegans nervous system. indeed, the bilateral symmetry implies that pairs of bilaterally symmetric neurons are also connected symmetrically, meaning that triplets containing such a pair are likely to be symmetric. however, we find that the fraction of triplets # and # containing a bilaterally symmetric pair of neurons and an unpaired neuron is rather small. this suggests that the bilateral symmetry of the nervous system is not sufficient to explain the over-representation of pattern # and # just like in any other screening algorithm, our criteria for outliers are somewhat subjective and the goal is to draw attention to interesting candidates. we limit our discussion to over-represented patterns # # and # because in our judgment they are most robust outliers based on the several criteria used. the reader may judge that some other patterns are over-represented as well. for example, patterns # and # are significantly over-represented for small thresholds. because the absolute counts of these patterns in the c. elegans network are small, we cannot verify that they are consistently over-represented. further work on larger datasets will show whether these patterns may be viewed as motifs. several quadruplet classes are over-represented we classify all connected quadruplets into classes and count the number of quadruplets in each class. then we compare the actual counts of quadruplets in each class to the mean counts of quadruplets in a random matrix ensemble. in this case, random matrices preserve the numbers of uni-directional and bi-directional connections for each neuron and, in addition, the numbers of triplets. because of the large number of quadruplet classes, we show results only for patterns selected according to the following criteria: the multiple hypothesis testing corrected significance values pm must be less than for at least one threshold per pattern, while the number of quadruplets in the actual network must be at least the last condition excludes patterns that may appear as over-represented due to very small quadruplet counts. we find that quadruplet pattern # is consistently over-represented. can we explain this observation by some other known factor? we consider the following two hypotheses: i. bilateral symmetry of the nervous system is not sufficient to explain the over-representation of the quadruplet pattern #45 one could propose that symmetric patterns should be over-represented because of the bilateral symmetry of the nervous system. we think that this argument by itself cannot explain the observed over-representation for two reasons. first, the fraction of feedforward quadruplets containing two bilaterally symmetric neuron pairs in motif is rather small. second, many symmetric patterns are not over-represented, such as, for example, patterns and. ii. feedforward structure of the nervous system may partially explain the over-representation of the feedforward quadruplet one could propose that the feedforward three-layer structure of the nervous system could account for this observation. we find that 14% to 37% of the feedforward quadruplets do not fit into this proposition because either they contain a feedback connection or all neurons belong to the same layer. after comparing these percentages to the relative excess values we conclude that the feedforward structure may explain over-representation for some threshold values but not for others. it is possible that some other factors account for the reported quadruplet over-representation. just as argued in case of triplets, discovering these factors would be complementary to the characterization of the over-represented motif. it would be particularly interesting to determine the functional role of these motifs. again, we arbitrarily limit our discussion of over-represented quadruplets to pattern # the reader may judge that some other patterns are over-represented and deserve attention. this is why in figure we show all the outliers satisfying relatively weak criteria. we find no over-represented quintuplet classes we classify all connected quintuplets into classes and count the actual number of quintuplets in each class. we compare these counts with the mean of the random matrix ensemble. in this case, the random matrices preserve the numbers of uni- and bi-directional connections for each neuron and, in addition, keep the numbers of all triplets and quadruplets in a 10% range of the actual network. we do not find any significantly over-represented quintuplets. this could happen because there are no significantly over-represented quintuplets with a given number of quadruplets. alternatively, this could happen because specifying the numbers of triplets and quadruplets constrains the number of quintuplets in any random matrix the size of the c. elegans network. therefore, absence of significantly over-represented quintuplets in c. elegans does not rule out the existence of five-neuron modules that can be detected as motifs by applying our algorithm to larger networks. discussion by comparing counts of multi-neuron patterns in the c. elegans wiring diagram to the mean counts of the appropriate random matrix ensemble, we find several over-represented motifs. first, we find that bi-directionally connected doublets are over-represented, given the number of connections on each neuron is fixed. second, several triplet classes are over-represented, given the actual number of bi-directional connections for each neuron. third, we find that several quadruplet classes are over-represented, given the numbers of triplets are preserved in addition to previously listed constraints. we find no over-represented quintuplet classes. some of these results, such as the over-representation of the feedforward loop and the feedforward quadruplet, have been reported previously. the current paper extends and complements previous reports by performing a systematic motif search for various connection multiplicity thresholds and rigorous statistical significance assessment. also, we consider whether the discovered motifs can be accounted for by previously known facts about the organization of the nervous system. there is no functional explanation for the existence of the motifs. therefore, the identified motifs are candidates for modules that may perform stereotypical functions in the c. elegans nervous system, and they need to be investigated further. although the main motivation for this work, search for modules, led to our focus on over-represented patterns, we also checked for under-representation. for example, previous work indicated that the number of triplets with pattern # was small. to determine significance, we applied the single-step min p procedure to the absolute value of the deviation of counts from the mean. we found that the feedforward loop is not significantly under-represented, yet many other patterns, such as weakly connected triplets were significantly under-represented. our motif search algorithm is different from previous attempts to find modules. for example, traditional clustering approaches look for the subsets of nodes, which are connected with their own subset more strongly than with other subsets. in our algorithm, we consider all the connections within a pattern but ignore the connections with neurons outside the pattern. one could question the expediency of ignoring multiple possible inputs to the neurons in a module since those inputs could influence the operation of that module. to counter this, we point out that if there were a particularly recurring way to attach an external connection to a given n-neuron motif then it would appear as an n + 1-neuron motif. if, on the other hand, the motif is connected in many different ways in different instances, their significance will be washed out. thus our approach may hierarchically detect modules with recurring input/output sites, growing them out of smaller patterns. a second justification for looking at n-neuron patterns is that the nervous system is capable of performing many different functions under different circumstances and neurons active in one case may be silent in another. therefore, in any particular case, many of the anatomical inputs to the module may remain silent and can safely be ignored. this speculation may be verified experimentally by simultaneous monitoring of neuronal activity in different neurons. the strategy and algorithms we described in this paper can be applied to incompletely mapped networks because a highly significant pattern is also likely to be over-represented in a sub-network. however, the statistical power of our algorithm increases with the knowledge of the wiring diagram. therefore it was natural to choose the c. elegans nervous system, whose wiring diagram is largely known. unfortunately, c. elegans has some disadvantages when it comes to the interpretation of the results: the polarity of a synapse in c. elegans is often unknown; electrophysiological investigations are still difficult in c. elegans; and the whole network contains only neurons, limiting the statistical power of the approach. yet we hope that recent technological developments will eliminate the first two disadvantages and allow functional analysis of the discovered modules. moreover, we expect that our results have implications for understanding nervous system structure and function beyond c. elegans. the modules we identify in c. elegans may be a general property of the nervous system, and, once identified, can be searched for in other species. finally, the algorithm itself can be applied to other networks once they become available. as in any other theoretical analysis, we made several simplifications. for example, we assumed that the strength of synaptic connection between a pair of neurons is characterized by its multiplicity. this assumption may be questioned if synapses implementing high-multiplicity connections are weaker than those implementing low-multiplicity connections, as known to happen in nematodes. yet, this assumption represents a reasonable first step in the systematic quantitative analysis, which may be extended in the future by estimating synaptic strength from the original em reconstructions. in addition, we ignored the polarity of the synapses and the existence of gap junctions. yet our results are robust to the inclusion of these factors in the future because if an over-represented class is found, it will remain over-represented even if divided into smaller sub-classes. it would be interesting to see whether the inclusion of the above factors will reveal specific over-represented sub-classes.  we have shown that certain neuronal connectivity patterns are significantly over-represented in the c. elegans nervous system. these patterns, called motifs, are candidates for computational modules that may perform stereotypical functions. it would be interesting to determine what these functions are and whether these motifs appear in other nervous systems. 
does the c. elegans nervous system contain multi-neuron computational modules that perform stereotypical functions? over-represented patterns are candidates for computational modules that may perform stereotypical functions in the c. elegans nervous system. we attempt to answer this question by searching for recurring multi-neuron inter-connectivity patterns in the c. elegans nervous system's wiring diagram. our statistical analysis reveals that some inter-connectivity patterns containing two, three and four neurons are significantly over-represented relative to the expectations based on the statistics of smaller inter-connectivity patterns.
 does the c. elegans nervous system contain multi-neuron computational modules that perform stereotypical functions? we attempt to answer this question by searching for recurring multi-neuron inter-connectivity patterns in the c. elegans nervous system's wiring diagram.  our statistical analysis reveals that some inter-connectivity patterns containing two, three and four neurons are significantly over-represented relative to the expectations based on the statistics of smaller inter-connectivity patterns.  over-represented patterns are candidates for computational modules that may perform stereotypical functions in the c. elegans nervous system. these modules may appear in other species and need to be investigated further. 