### Data acquisition and processing

Protein-protein interaction data for yeast and fly were downloaded from DIP ([18] ; April 2005 download) and contained 15,166 interactions among 4,726 proteins in yeast, and 22,837 interactions among 7,028 proteins in fly (for fly, we complemented the DIP data by interactions from[36] ). Additional 2378 genetic interactions in fly were downloaded from FlyGRID[30]. To assign confidence scores to these interactions we used the logistic-regression-based scheme employed in[8]. Briefly, true positive and true negative interactions were used to train a logistic regression model, which assigns each interaction a reliability score based on the experimental evidence for this interaction, which includes the type of experiments in which the interaction was observed, and the number of observations in each experimental type. For yeast, we partitioned the experiments into four categories: co-immunoprecipitation screens[3, 4] , yeast two-hybrid assays[2, 37, 38] , large scale experiments (other studies denoted as*exp:g*class in DIP) and small scale experiments (denoted as*exp:s*class in DIP). For fly, due to the smaller number of interaction screens available, we used each of three available large-scale screens[36, 39, 40] as a separate category. In addition, we used small scale fly experiments as a fourth category.

### Pathway alignment

We represent a PPI network using an undirected weighted graph*G*with a set*V*of*n*vertices, representing proteins, a set*E*of m edges, representing interactions, and an edge weight function*w(·,·)*representing interaction reliabilities. Given a pathway query*Q = (q*
_{
1
}
*,...,q*
_{
k
}
*)*, let*h*(*q*
_{
i
}
*, j*) denote a sequence similarity score between query node*q*
_{
i
}and vertex*j*∈*V*. An alignment of*Q*in*G*is defined as a pair*(P, M)*, where*P = (p*
_{
1
}
*,...,p*
_{
k
}
*)*is a matched path in*G*, and*M*is a mapping of query nodes onto*P*∪*{0}*. The alignment allows up to*N*
_{
ins
}insertions and up to*N*
_{
del
}deletions, where deleted query nodes are mapped to*0*by*M*. The weight of an alignment is a summation of the*interaction score*,
and the*sequence score*,
. Edge weights were set to logarithm of the reliability estimation of the corresponding interactions. The sequence similarity score,*h*(*q*
_{
i
}
*, j*), between query node q_{
i
}and vertex*j∈ V*was set to logarithm of the BLAST E-value between the corresponding proteins, normalized by the maximum score over all pairs.

### Pathway search module

The goal of the algorithm is to identify a matched pathway with distinct vertices yielding an optimal alignment to the query. To this end, we adapt the color coding technique of Alon et al.[41] , which serves to find simple paths (i.e., paths with distinct vertices) of a fixed length*k*in a graph. In color coding, one assigns a randomly chosen color from*{1,...,k}*to every vertex in the graph, transforming the problem of finding a simple length-*k*path to that of finding a path of length*k*that spans distinct colors. Since any particular path may be assigned non-distinct colors and, hence, fail to be discovered, many random coloring trials are executed. Below, we describe one iteration of color coding tailored to the query case.

Our algorithm starts by assigning every vertex*v*∈*V*a color*c*(*v*) drawn uniformly at random from the set*C*=*{*1,...,*k*+*N*
_{
ins
}
*}*. For a given coloring, we use dynamic programming to find an optimal matching pathway. We let*W*(*i, j, S, θ*
_{
del
}) denote the maximum weight of an alignment for the first*i*nodes in the query that ends at vertex*j∈ V*, induces*θ*
_{
del
}deletions, and visits a vertex of each color in*S*.*W*(*i, j, S, θ*
_{
del
}) is computed recursively as follows:

The maximum weight of an alignment is
,*W*(*k, j, S*, θ), and the corresponding alignment is obtained through standard dynamic programming backtracking. In fact, the algorithm outputs not only the optimal match but a set of high scoring matches for each combination of number of insertions and deletions employed. The running time of each trial depends on the length of the query, the size of the network and the number of insertions and deletions allowed, and is 2^{O(k+Nins)}
*mN*
_{
del
}. The probability that any given path is assigned*k*distinct colors is at least*e*
^{-k-Nins
}. Thus, for any ε ∈ (0,1), the running time of the algorithm for obtaining the optimal match with probability at least 1-ε is*ln(n/ε)2*
^{O(k+Nins)}
*mN*
_{
del
}. We used ε = 0.01 for all runs of the algorithm, yielding a practical time of a few minutes per query (Supp.1 Table 3). The resulting pathways were filtered to remove pathways that overlap by at least 20% of their proteins.

To search a network for pathways with high interaction scores, regardless of a specific query, we ran the algorithm with a dummy path query, consisting of dummy proteins that were defined to have the same sequence similarity score with respect to all network vertices. To search a network for random pathways, regardless of their interaction score, we assigned an equal interaction score for all interactions.

### Pathway scoring module

We assigned protein pathways a functional significance score that represent their tendency to be functionally enriched given four parameters characterizing each pathway: a normalized sequence score, a normalized interaction score, number of insertions, and number of deletions. Given a set of matched pathways, logistic regression[42] was used to predict their functional enrichment based on these parameters alone. To avoid over-fitting, the set of pathways was partitioned into five equal parts. For each part, we trained the logistic regression on the remaining four parts, and used the inferred parameters to derive the scores of the pathways in the left-out part.

### Functional enrichment

Functional enrichments of protein pathways were computed based on GO process annotations[43] for their proteins. Yeast GO annotations were obtained from SGD[44] , and fly GO annotations were obtained from FlyBase[45]. For a given pathway*P*and a given term*t*, the functional enrichment score was computed as follows: suppose*P*has let*n(t)*proteins that are annotated with term*t*(or with a more specific term). Let*p(t)*be the hypergeometric probability for observing*n(t)*or more proteins annotated with term*t*in a protein subset of size*|P|*. Having found a term*t*
_{0}with minimal probability*p(t*
_{0}
*)*, the score was set to the*p*-value of the enrichment under term*t*
_{0}, computed by comparing*p(t*
_{0}
*)*with the analogous probabilities for 10,000 random sets of proteins of size*|P|*.

### Expression coherency

Expression coherency of a pathway was measured as the mean absolute value of the pairwise Pearson correlations between the expression patterns of the genes that code for the pathway's proteins. To assess the significance of the expression coherency of a set of pathways, we compared it to the expression coherency distribution of a random set of pathways with the same size distribution. Gene expression measurements were obtained from Stanford microarray database[46] and included 973 and 170 conditions for yeast and fly, respectively.