The geometry of partial fitness orders and an efficient method for detecting genetic interactions

We present an efficient computational approach for detecting genetic interactions from fitness comparison data together with a geometric interpretation using polyhedral cones associated to partial orderings. Genetic interactions are defined by linear forms with integer coefficients in the fitness variables assigned to genotypes. These forms generalize several popular approaches to study interactions, including Fourier–Walsh coefficients, interaction coordinates, and circuits. We assume that fitness measurements come with high uncertainty or are even unavailable, as is the case for many empirical studies, and derive interactions only from comparisons of genotypes with respect to their fitness, i.e. from partial fitness orders. We present a characterization of the class of partial fitness orders that imply interactions, using a graph-theoretic approach. Our characterization then yields an efficient algorithm for testing the condition when certain genetic interactions, such as sign epistasis, are implied. This provides an exponential improvement of the best previously known method. We also present a geometric interpretation of our characterization, which provides the basis for statistical analysis of partial fitness orders and genetic interactions.

characterization of the class of partial fitness orders that imply interactions, using a graph-theoretic approach. Our characterization then yields an efficient algorithm for testing the condition when certain genetic interactions, such as sign epistasis, are implied. This provides an exponential improvement of the best previously known method. We also present a geometric interpretation of our characterization, which provides the basis for statistical analysis of partial fitness orders and genetic interactions.

Introduction
Genetic interactions-or dependence of the fitness effect produced by a set of mutations on the genetic background-play an important role in determining evolutionary trajectories of populations. For instance, a set of individually beneficial mutations may exhibit diminishing returns: while the combined effect of all mutations is beneficial, it is not as beneficial as one would expect given the individual mutations, for example the sum of all single mutation effects. Diminishing returns have been shown to slow down the pace of adaptation (Chou et al. 2011). Similarly, the combined effect of a set of mutations can be stronger than the effect expected from the individual mutations. This so-called synergistic epistasis between deleterious mutations has been observed for instance in human populations, where it affects the distribution of deleterious alleles in the genome (Sohail et al. 2017). Genetic interactions can affect not just the magnitude of the effect of a mutation, but also the sign of the effect. That is, a particular mutation may have a beneficial effect in one genetic background and a deleterious effect in another. This type of interaction, often termed sign epistasis, can act to constrain evolutionary trajectories by requiring that some mutations occur before others (Gong et al. 2013;Kvitek and Sherlock 2011;Weinreich et al. 2005).
In this work, we are concerned with detecting the presence of genetic interactions from limited genotype-phenotype data. We understand an interaction as a deviation from a null linear model. For example, the two-way interaction is defined as a deviation from the null assumption that w 00 + w 11 − w 01 − w 10 = 0, and the total three-way interaction as a deviation from the null assumption that w 000 + w 011 + w 101 + w 110 − w 001 − w 010 − w 100 − w 111 = 0, where the binary indices correspond to biallelic genotypes (e.g. 00 is the wild type and 11 is the double mutant), and w denotes fitness (see Sect. 2 for detailed definitions). Empirical data sets produced in interaction studies typically provide replicate measurements of a trait, such as antibiotic or other forms of resistance, for various genotypes. The trait is often chosen to measure fitness, or approximations thereof, and used to infer genetic interactions in the fitness landscape. However, in many cases the association between the trait and fitness is unclear. For example, comparative fitness assays (or competition experiments) produce data uninformative with respect to the distribution of the absolute fitness values of genotypes. Furthermore, assuming only comparative genotype-phenotype data, one detects the sign but not the magnitude of the interactions. This makes standard statistical methods such as ANOVA or the multiple regression framework inapplicable.
Here, we make a conservative assumption that the only available information about fitness is the (partial) ranking of genotypes, that is, we assume that no precise fitness measurements of all genotypes are available, a frequent situation in practice, for example, due to measurement noise. Specifically, we assume either that some of the information in a total order of all fitness values must be discarded, or that the only signal available in the data is of the form "genotype g 1 has higher fitness than genotype g 2 ", for various pairs of genotypes. We assume that these pairwise fitness comparisons are consistent with each other, i.e., the relation they define is transitive. We call this type of data a partial fitness order, which is a partial order of genotypes with respect to their fitness. Data of this type arises for example by considering certain directed acyclic graphs where the vertices are given by genotypes and where the edges between genotypes are directed towards the genotype with higher fitness. Importantly, our assumptions make our methods widely applicable as the same techniques can be applied to other types of rankings and not just genotypes ranked with respect to their fitness. For example, a partial fitness order of genotypes can be obtained in studies that involve measuring various kinds of breeding values (see for example Habier et al. 2007) or other applications of generalised linear models.
Even though we assume that accurate fitness measurements cannot be accessed for all genotypes in a given genotype space, our methods still enable us to detect interactions implied by the partial fitness order. In particular, we are able to detect sign epistasis. Moreover, even when a complete fitness ranking of genotypes is available a method to detect interactions from a partial order alone might provide additional insight. Indeed, there are cases where the rank order method fails to reveal interactions even though interactions in the system can be detected from the actual fitness measurements . In this case, partial fitness order methods can be used to conclude diminishing returns or synergistic epistasis and refute sign epistasis. In addition, if one is only interested in certain fitness comparisons (for instance, comparisons between mutational neighbors), our methods yield a criterion to determine whether these comparisons are sufficient to imply interaction. These observations will have implications for the evolutionary trajectories of the system and provide insight as to the mechanism of the interaction (Weinreich et al. 2005). A detailed analysis of the class of linear orders that imply interactions, including relevant literature and data, can be found in .
In this paper, we build on the results obtained by  and settle the most general case of ranking data, when only a partial fitness order is available. Specifically, we present a graph-theoretic characterization of the class of partial fitness orders that imply genetic interactions (Sect. 3), thus establishing the conjecture presented by Gavryushkin at the Interactions between Algebra and the Sciences conference held in Max Planck Institute for Mathematics in the Sciences, Leipzig, on 27 May 2017. Second, we use our characterization to derive a cubic time algorithm for testing the condition when a given partial order implies such an interaction (Sect. 3).
This provides an exponential improvement of the best previously known method that involves iterating through the list of all possible linear extensions of the given partial order . Third, we count all partial orders for up to 8 labeled elements which imply an interaction (Sect. 4), and fourth, we provide a geometric interpretation of our characterization, useful for statistical analysis of partial fitness orders that imply genetic interactions (Sect. 5). Finally, we use public data sets to demonstrate our methods (Sect. 6) and conclude by describing possible future directions for this line of research (Sect. 7).

Technical introduction
In this section we introduce all necessary terminology and notations and describe a basic statistical approach to probabilistic inference of (higher-order) interactions from partial fitness orders, which further motivates our results on partial fitness orders.
Consider a system G consisting of k genotypes, where k is a positive integer. We denote the fitness of a genotype g ∈ G by w g , which is a real number. Typically, we take fitness to be a positive real number, though this does not affect our arguments. All fitness measurements (w g ) g∈G together then determine what is called the fitness landscape associated to G. We refer to the tuple of all the fitness measurements defining a fitness landscape by W = (w g ) g∈G .
We define genetic interactions using linear forms with integer coefficients in the following way. Let f be a linear form in variables W with integer coefficients which sum to 0, that is, where all c i , d j , t, and s are positive integer numbers such that t + s = k and G = {p 1 , . . . , p t , n 1 , . . . , n s }. We then say that the fitness landscape has positive finteraction if f (W ) > 0. When f (W ) < 0, we say that has negative f -interaction. Hence f -interactions are a special case of what is known in applied statistics as contrasts. From now on, we will focus on determining positive f -interactions unless we explicitly state otherwise. Everything in this paper extends straightforwardly to the negative case. This definition of f -interaction generalizes several well-known and widely used notions of gene interaction, including Fourier-Walsh coefficients, interaction coordinates, and circuit interactions (Weinreich et al. 2013;Beerenwinkel et al. 2007). The detailed exposition including illustrative examples comparing all these approaches can be found in (Crona et al. 2017, Materials and methods).
Estimating the probability of f -interaction in an empirical setting amounts to quantifying the uncertainty of f (W ) > 0 given some comparative fitness data. Although in this setting the fitness values w g are unavailable, the comparative fitness data typically allows to deduce a partial fitness order. For example, this type of data could arise from replicate measurements of any quantitative trait monotonic with respect to fitness. Another example of such data is fitness comparison data produced in competition or survival experiments, which are a popular method for fitness estimation.
Sometimes a partial fitness order is enough to deduce f -interactions and hence estimate the probability of interaction. We use the following definition to address such situations. We say that a partial fitness order P = (G, ≺) implies positive f -interaction if f (W ) > 0 whenever W satisfy the partial order P, that is, w g < w h for all g ≺ h.
Then the probability of f -interaction given comparative fitness data can be estimated by considering the probability support of all partial orders that imply finteraction. However, such an estimation would require the condition of whether or not a partial order P implies f -interaction to be checked routinely for different partial orders P. Hence the complexity of this condition might become a computational bottleneck in practice. In this paper we resolve this problem by designing an efficient polynomial-time algorithm for checking whether or not a partial order implies f -interaction.
We note that the fact that a partial order does not imply positive or negative finteraction does not necessarily mean that the system does not have f -interaction. This situation therefore should be interpreted as the partial order being non-informative with respect to the f -interaction; the issue is discussed in more detail in .
We now review the results from ) about how to detect whether a rank order implies f -interaction. In the terminology used in our paper, this situation corresponds to the case when the partial fitness order is a linear order (also called a total order or a rank order). We then study arbitrary partial orders, and present an efficient algorithm for determining when a partial order implies f -interaction.
For a linear form f as above, define a function φ f from the set of (strict) linear orders on the set of genotypes to words over the alphabet {P, N } as follows. The linear order on k genotypes g 1 g 2 · · · g k is mapped to a word ω consisting of c i copies of P if w g i has a positive coefficient c i in f ; and d i copies of N if w g i has a negative coefficient d i in f . The subwords of ω corresponding to different g i 's appear according to the linear order (from highest to lowest). See  for various examples of this construction.
The following result from ) depends upon the characterization of linear orders which imply interaction in terms of Dyck words.
Definition 1 Let be an alphabet consisting of two letters P and N . A Dyck word is a word ω consisting of an equal number of P's and N 's such that every prefix of ω contains at least as many P's as N 's.
For example, P P N N P N and P N P N P N are Dyck words, but P P N N N P is not, since the prefix P P N N N contains more N 's than P's. Clearly the definition of Dyck word does not depend on the choice of alphabet one considers. Dyck words arise in a number of contexts in discrete mathematics. For instance, they are in bijection with full binary trees with n + 1 leaves. If the symbols P and N are replaced with "(" and ")", a string is a Dyck word only if all parenthesis are correctly matched. For more on Dyck words, see (Stanley 2001).

Theorem 1 (Crona et al. 2017) A linear order P = (G, ≺) on the set of genotypes implies positive f -interaction if and only if φ f (P) is a Dyck word that starts with P.
The statement of this theorem can equivalently be formulated by saying that a linear order P implies positive f -interaction if and only if there exists a partition of the set of all genotypes G into pairs ( p i , n j ) such that p i n j for all i, j, where each p i appears in c i pairs and each n j in d j pairs (see . As we will see in the next section, this formulation can be generalized to arbitrary partial orders. Note that here and also below we slightly abuse notation because for certain choices of c i 's and d j 's, we do not have a partition in the strict sense, but this technical difficulty can be avoided by, for example, distinguishing between the copies of p i and n j .

Efficient method to infer interactions from partial orders
In this section we generalize Theorem 1 and characterize partial orders which imply f -interactions. We then apply our characterization to design an efficient algorithm for testing the condition of whether or not a partial order implies f -interaction. Before we proceed with the proof, let us illustrate Theorem 2 with the following example. Let W = (w 001 , w 010 , w 100 , w 111 , w 000 ) and consider the linear form: which measures the deviation of the triple mutant's fitness from its expectation based on single mutants only, and corresponds to one of the circuit interactions characterized in (Beerenwinkel et al. 2007). We see that there is positive f -interaction implied by the order of the fitness values if and only if for each fitness value with a positive coefficient in f , there is a strictly smaller fitness value with negative coefficient. This smaller fitness value must be unique, unless the absolute value of the coefficient is greater than one, as in this case for w 000 .
Proof The "if" implication is clear, as and if there is a partition for the partial order P as claimed and the indices i, j are arranged according to the partition, each difference in the last sum is strictly greater than 0, thus f (W ) > 0.
In order to prove the converse statement, we prove its contrapositive. That is, we prove that if there is no such partition of the set of all genotypes, f -interaction is not implied.
Construct the bipartite graph G = (P N, E), where P contains c i copies of p i for each i and N contains d j copies of n j for each j, such that (n j , p i ) ∈ E whenever n j ≺ p i in the partial order P. The number of elements in P and N coincide, since the coefficients of f sum to zero. Observe that a partition of the set of all genotypes G into pairs (n j , p i ) such that n j ≺ p i for all i, j as in the theorem is exactly a perfect matching in G. By Hall's theorem, there exists a perfect matching in G if and only if for each S ⊆ N, we have Suppose that there is no partition of the genotypes into pairs as above, and thus no perfect matching in G. Then there is some subset S ⊆ N such that Using this subset S, we construct a linear extension of the partial order P which does not map to a Dyck word under the map φ f , introduced above.
To do so, we first reindex N so that S = {n 1 1 , . . . , n 1 e 1 e 1 copies of n 1 , . . . , n j 1 , . . . , n j e j e j copies of n j } and the order n 1 n 2 · · · n j is compatible with P. Note that d 1 ≥ e 1 ≥ 1, . . . , d j ≥ e j ≥ 1.
Let X 1 = {x ∈ P N | n 1 ≺ x} be the set of elements in P N ordered above n 1 . Note that X 1 ⊆ N N G (S), since if n 1 ≺ x and x ∈ P, then by construction, x ∈ N G (S). Consider a linear extension L 1 of the partial order P on X 1 given by x 1 · · · x k . Extend L 1 with all duplicates n 1 1 , . . . , n 1 e 1 of n 1 . That is, consider the linear extension L 1 given by x 1 · · · x k n 1 1 · · · n 1 e 1 . Now, we repeat this process with n 2 and the rest of elements in S. Let X 2 be the set of elements in P N which are required by P to be strictly greater than n 2 but are not contained among the elements included in L 1 . Again, X 2 ⊆ N N G (S). Extend the previous linear order L 1 to L 2 as follows, maintaining the property that L 2 is compatible with P: x 1 · · · x k n 1 1 · · · n 1 e 1 x k+1 · · · x m n 2 1 · · · n 2 e 2 .
We repeat this process for the rest of elements in S in the same way. To complete the construction, we observe that every remaining element (not included in S ∪ X 1 ∪ . . . ∪ X j ) is compatible with being smaller than all elements of S ∪ X 1 ∪ . . . ∪ X j . Hence, we can sort all remaining elements and add them at the end of the last linear order L j as smaller elements, to obtain a linear order L which extends P.
The linear order L does not map to a Dyck word (starting in P) under φ f , since the image of the smallest prefix of L which contains all elements of S contains more N 's than P's since |S| > |N G (S)|. Therefore, by Theorem 3 from , this partial order does not imply positive f -interaction.
A variant of Theorem 2 was independently obtained in (Crona and Luo 2017). We now proceed by designing an efficient algorithm for detecting whether or not a partial fitness order Theorem 3 There exists an O(m 3 ) algorithm to determine whether a partial order P = (G, ≺) implies positive f -interaction. Proof We use the notation introduced in the proof of Theorem 2. That theorem implies that a partial order implies that f (W ) > 0 if and only if there exists a partition of the set P ∪ N into pairs ( p i , n j ) such that p i n j . As noted in the proof of Theorem 2, this condition is equivalent to the existence of a perfect matching in the bipartite graph G = (P, N, E) such that (n j , p i ) ∈ E whenever p i n j . Thus, we can detect whether the poset implies f (W ) > 0 by checking whether there exists a perfect matching in G.
Using the Hopcroft-Karp algorithm (Hopcroft and Karp 1971), we can find a perfect matching in a bipartite graph with m vertices in time O(m 5/2 ). Assume we are presented the partially ordered set P as a directed acyclic graph. Then we can construct the bipartite graph G in time O(m 3 ) using the following algorithm: for each p ∈ P, use breadth first search to find all elements of N which are reachable along a directed path from p, and add these to p's list of neighbors. The worst-case complexity of this step is O(m 2 ). Repeat this process for each of the m vertices to obtain a representation of G as an adjacency list-that is, as a list containing a list of neighboring vertices for each vertex. Thus, since we can construct the graph in O(m 3 ) time and determine whether a matching exists in the graph in O(m 5/2 ) time, and m 3 > m 5/2 , we can determine whether the partial order determines the sign of a linear form in O(m 3 ) time.
The complexity of our algorithm for computing whether a partial order on a set of genotypes implies f -interaction depends not just on the number of genotypes, but also on the coefficients of f . Specifically, the worst case complexity is a function not just of the number of genotypes, but also of the number of positive summands of f (with multiplicity) 1≤i≤t c i . In most practical cases (circuits, interaction coordinates, etc.), however, this last number is small relative to the number of genotypes.
The two upper level steps of our algorithm are • constructing the bipartite graph and • detecting whether a perfect matching exists.
We think that the upper complexity bound O(m 3 ) achieved in this paper can be improved. In particular, an appropriate choice of data structures can reduce the complexity of constructing the bipartite graph, which is the most demanding step in our algorithm. However, this improvement goes beyond the scope of this work, as we found the algorithm's performance sufficient on typical data sets used in higher-order interaction studies (see , for a survey of such data sets). See https:// github.com/gavruskin/fitlands/tree/posets/posets.ipynb, where our implementation of the algorithm designed in Theorem 3 can be accessed.
Linear programming provides an alternate method to check whether a partial order implies interaction: checking whether a system is consistent with positive interaction amounts to checking that the feasible region of the linear program with constraints coming from the partial order and the constraint f > 0 is nonempty. In this case, the complexity of the computation will just depend on the number of genotypes, not on the coefficients, thus with large coefficients, linear programming is a more practical approach then the one presented here. However, by providing a purely combinatorial description of when a partial order implies interaction, our method may be more useful for studying classes of partial orders.

Counting partial orders that imply interaction
In this section, we determine the proportion of partial orders on k = 2, 4, 6, and 8 genotypes that imply positive f -interaction for an arbitrary fixed linear form f with k coefficients 1 and − 1 which sum to 0. Our results are summarized in Table 1.
We carried out our computations in the open-source mathematics software system Sage (http://www.sagemath.org) using the source code available at https://github.com/ gavruskin/fitlands/tree/posets/. To make the computations possible, we employed the automorphism groups (Stein et al. 2008) of our partial orders in the following way.
Definition 2 An automorphism of a partial order P The set of automorphisms of a finite partial order forms a group, denoted by Aut(P), under the operation of composition.
In our enumeration, we observe that the number of different ways to label a poset with k elements is k! |Aut(P)| . To see this, take a labeling of the elements on the poset. A permutation of the labels is an automorphism if and only if it does not change the partial order. Thus, each relabeling of the poset elements falls into an equivalence class Table 1 For k ∈ {2, 4, 6, 8}, the number of partial orders implying positive f -interaction, the number of partial orders not implying f -interaction, and the proportion of partial orders implying either positive or negative f -interaction, truncated to the second digit. Note that the number of partial orders implying negative f -interaction is, by symmetry, equal to the number of partial orders implying positive f -interaction. Hence, the proportion is obtained by dividing twice the number of partial orders implying positive interaction by the total number of partial orders of |Aut(P)| relabelings that do not change the partial order. Thus, since there are k! ways to relabel the elements, there are k! |Aut(P)| non-equivalent ways to label the poset. As an example, consider the partial order The relabeling to the Hasse diagram on the right yields the same partial order. Thus, this permutation switching 10 and 01 is an automorphism of the graph. However, any other permutation of the labels changes the partial order. Thus, this poset has an automorphism group of cardinality 2. Then since there are 4! = 24 ways to relabel the elements of {00, 01, 10, 11}, there are 4!/2 = 12 different labelings of this poset. The implementation of our algorithm proceeds as follows: Using a built in function in Sage, we produced a list of partial orders on k elements up to isomorphism. Since whether a partial order implies f -interaction depends on the element labels, not just the structure of the partial order, we have to distinguish between different labeled partial orders within each partial order automorphism class. To achieve this, for each partial order (up to automorphism), we check for f -interaction with each partition of the labels used by Sage into two classes of equal size. We let one class correspond to elements with coefficient 1 and one class correspond to elements with coefficient − 1. Then each choice of partition corresponds to ((k/2)!) 2 possible reassignments of the labels, since we can permute the elements within the class with coefficient 1 and the class with coefficient − 1 without changing the partition. We compute the cardinality of the automorphism group for each partial order, and add We note that as we increase k, the proportion of partial orders implying f -interaction decreases. The sums of the values we obtained for the number of partial orders implying positive f -interaction, the number of partial orders implying negative f -interaction, and the number of partial orders not implying any f -interaction appears in OEIS (The On-Line Encyclopedia of Integer Sequences 2017) as the number of partial orders on k labeled elements, as expected. However, none of the columns of our table appear in OEIS. Further, each number is either prime or has a prime factorization including fairly large primes. Thus, the number of partial orders, the number of partial orders implying f -interaction, and the number of partial orders not implying f -interaction do not appear to be given by any simple formula.
The final computation, for k = 8, took approximately two hours to complete on the SageMath Cloud server. The main factor affecting the performance of these computations is that the number of partial orders on k elements is super-exponential in the number of elements (The On-Line Encyclopedia of Integer Sequences 2017). Therefore, we did not count the number of partial orders on k elements which imply f -interaction for k ≥ 10. Since we can still quickly check whether individual partial orders on k ≥ 10 elements imply f -interaction, sampling methods can be used to estimate how the proportion of partial orders which imply interaction changes as we increase k.
Our computational observation that the fraction of partial orders which imply finteraction approaches 0 as k increases is true in general:

Theorem 4 As k approaches infinity, the fraction of partial orders which imply finteraction approaches zero.
Proof Partition the set of partial orders on k elements into its isomorphism classes. We show that, within each isomorphism class, the proportion of partial orders implying positive f -interaction is bounded by 4 k whenever f is a linear form with coefficients ±1. Consider an arbitrary isomorphism class, and take an arbitrary labeled poset P in this class. There are k! |Aut(P)| distinct labeled posets in this isomorphism class. There are k!·2 k/2+1 ≤ 4(k − 1)! linear orders on k elements which imply positive f -interaction (Crona et al. 2017, Proposition 1). Now, take an arbitrary linear extension of P. Each permutation of labels which takes P to a labeled poset which implies positive finteraction must take this linear extension to one that implies interaction, thus there are at most 4(k − 1)! permutations of labels which take our labeled poset to one that implies f interaction. Further, all |Aut(P)| permutations of labels which give the same labeled poset must take our linear order to one that implies interaction. Thus, there are at most 4(k−1)! |Aut(P)| labeled posets in this isomorphism class that imply interaction. Thus, the proportion of posets in this isomorphism class that imply interaction is at most 4 k .

Geometric interpretation
In this section, we present a geometric interpretation of Theorem 2, and derive some geometric, combinatorial, and statistical results. We denote the space R |G| where |G| is the number of elements in G simply by R G and index the coordinate axes by the unknown fitness values w g 's, where g ∈ G. When we assume fitness values to be nonnegative, we work in the positive orthants of R G , which we denote by R G ≥0 . In this case, every point of R G ≥0 corresponds to a possible measurement of a fitness value for each genotype. When we do not assume fitness values to be nonnegative, every point in R G corresponds to a fitness value for each genotype. The geometric interpretation of our results about partial orders uses the language of polyhedral cones.
Definition 3 A convex polyhedral cone in R k is a subset of R k cut out by a finite number of linear inequalities.
Like all cones, convex polyhedral cones are closed under the operations of taking nonnegative linear combinations of their elements. For the remainder of this paper, we will refer to convex polyhedral cones simply as cones. Let P = (G, ≺) be a partial order (which may be a total order). Then the set of points x ∈ R G whose coordinate order satisfies P defines a cone. To see this, note that this set of points is cut out by a finite number of linear inequalities defined by the partial order. Hence this set is a convex polyhedral cone by definition. We call a cone associated to a partial order in this way an order cone and denote it by C P . Further, a linear form f in the variables w g 's defines a hyperplane through the origin, where f takes the value 0. The linear form is positive in the half space on one side of this hyperplane and negative on the other. Let H f,+ be the half space on which f is positive, H f be the hyperplane on which f is zero, and H f,− be the half space on which f is negative. Then Theorem 2 has the following geometric interpretation. Recall that f (W ) = 1≤i≤t c i w p i − 1≤ j≤s d j w n j is a linear form with integer coefficients that sum to zero, that is 1≤i≤t c i = 1≤ j≤s d j .
Theorem 5 The cone C P ⊂ H f,+ if and only if there exists a partition of the set of all genotypes G into pairs ( p i , n j ) such that p i n j for all i, j, where each p i appears in c i pairs and each n j in d j pairs. Proof Note that P implies positive f -interaction if and only if C P ⊂ H f,+ . Then the claim follows from Theorem 2.
As a corollary of Theorem 5, we obtain the following result, which will be applied in our analysis of a Malaria data set in Sect. 6.
Definition 4 Let P 1 and P 2 be partial orders. Their intersection is the partial order P 1 ∩ P 2 such that x ≺ P 1 ∩P 2 y if and only if x ≺ P 1 y and x ≺ P 2 y.
To illustrate the above definition consider the partial orders P 1 = 00 10 01 and P 2 = 10 01 00. Then P 1 ∩ P 2 is the partial order given by 10 01. Proof Immediately follows from Theorem 5. Now, we prove the following theorem which is important for statistical analysis of interactions from fitness comparison data, for example, in the analysis of a sample from the probability distribution over the space of partial fitness orders with the aim to quantify the uncertainty of interactions. Specifically, we show the following. If two uncertain fitness measurements give distinct linear orders A and B both of which imply positive f -interaction, then there exist fitness measurements corresponding to a sequence of linear orders which are intermediate between A and B in the sense that every linear order in this sequence is different from its predecessor by just one transposition of a pair of adjacent elements, and no linear order in the sequence implies negative f -interaction.

Corollary 1 Let A and B be linear orders such that C
Theorem 6 Let U ⊂ R k be a path connected, open set which has a nonempty intersection with the cones C A and C B , where A and B are linear orders on k elements. Then there exist linear orders L 1 = A, . . . , L n = B such that L i and L i+1 differ by one adjacent transposition and U ∩ C L i = ∅ for each 1 ≤ i < n.
Proof We denote cones C L i by simply C i , for all i, throughout the proof. Note that the cones C i and C j have a (k − 1)-dimensional face as their intersection if and only if L i and L j differ by a single adjacent transposition. Further, note that any path which passes from C i to C j without passing through the interior of any other cone must pass through the intersection of the boundaries of C i and C j . Either this boundary is an (k − 1)-dimensional face, and L i and L j differ by an adjacent transposition, or we pass through a lower dimensional face. In the latter case, this means a neighborhood of the point where we pass through the boundary contains all cones that intersect at this point. Thus, a neighborhood of this point contains a sequence of order cones of linear orders which differ by one adjacent transposition each. Now, consider a path from a point in U ∩ C A to a point in U ∩ C B . Since U is open and path connected, it contains some path of this form, as well as a neighborhood around the path. Consider the sequence of cones this path passes through-by the observation above, we know that if the path passes from C i to C j , either L i and L j differ by an adjacent transposition, or a neighborhood of the point where we pass from C i to C j intersects the cones of a sequence of linear orders which differ by one adjacent transposition each. Thus, in either case, a path from C A to C B has a neighborhood that intersects the order cones of a sequence of linear orders L 1 , . . . , L n such that L 1 = A, L n = B, and L i and L i+1 differ by one adjacent transposition for each 1 ≤ i < n. These linear orders satisfy the claim of the theorem.
We illustrate Theorem 6 in Fig. 1, where we depicted six regions corresponding to six slices of order cones in R 3 ≥0 . Each cone is associated to a linear order of three elements, x = w g i , y = w g j , z = w g k . Points inside the cones correspond to different fitness values satisfying the linear order defining the given cone. Thus, for example a point inside C x>y>z specifies three fitness values associated to three genotypes g i , g j , g k ∈ G and such that w g i > w g j > w g k .
As a corollary to Theorem 6, we obtain the following result. We show a slice of R 3 ≥0 , demonstrating that R 3 ≥0 is divided into six cones corresponding to the six possible orders of the elements x, y, z. The convex hull of a ball in the order cone C z>y>x and a ball in the order cone C y>x>z passes through the order cone C y>z>x . Note that the order y > z > x differs by one adjacent transposition from both z > y > x and y > x > z L i+1 for 1 ≤ i < n all differ by one adjacent transposition and no L i implies negative f -interaction.

Corollary 2 Suppose
Proof The half-space H f,+ is a connected open set which has a nonempty intersection with C A and C B . Thus, this result follows from Theorem 5.
Spaces with complicated geometries and combinatorics are known to cause significant difficulties for statistical analysis (Billera et al. 2001). For example, the space of trees, which is a particular instance of the space of partial orders, required deep mathematical advances to understand basic statistics, such as confidence regions and convex hulls, over the space (Billera et al. 2001;Gavryushkin and Drummond 2016). Advances in the geometry and combinatorics of such spaces are the stepping stone for efficient statistical methods such as Markov Chain Monte Carlo Dinh et al. 2017). In a similar vein, we expect that the approach of this section allows to efficiently study probability distributions over the space of partial fitness orders. Hence our results provide a theoretical foundation for statistical analysis of partial fitness orders.

Applications
In this section we illustrate how our results can be used in fitness-based genetic interactions studies.
Malaria As a first application, we consider the following three linear fitness orders inferred and analyzed by Ogbunugafor and Hartl (2016) (see also ).
These fitness orders have been obtained by measuring the growth rate of the parasite Plasmodium vivax exposed to various concentrations of the antimalarial drug pyrimethamine. As noted in , each of these linear orders implies negative total 3-way interaction, which in our terms is f -interaction where We now strengthen this conclusion using the approach developed in this paper. To do so, we consider only the shared rankings of the genotypes across different drug concentrations, that is, the partial fitness order P obtained by taking the intersection L 1 ∩ L 2 ∩ L 3 . This intersection has the following Hasse diagram: We then apply Theorem 2 and conclude that the obtained partial order P implies negative f -interaction. Indeed, the three bottom genotypes with even number of ones (depicted in bold) can be matched to the three genotypes with even number of ones above them, and matching 011 to 111 completes the construction of a perfect matching in this graph.
This means that even if the only comparisons we are confident about are those that agree across the three drug concentrations, we can still conclude that this system exhibits negative total 3-way interaction. In particular, this approach shows that we can ignore the inconsistency of the three rank orders associated to the three different drug concentrations under inspection. Hence any tuple of fitness values W which satisfies every fitness comparison found in each linear order will imply interaction. Further, in this case our results from Sect. 5 imply that any point in the convex hull of the points we have measured will imply negative 3-way interaction. This region allows to incorporate the uncertainties of the measurements and provides a region within which those measurements can vary without breaking the conclusion of interaction.
Moreover, in this situation we observe that L 2 can be obtained from L 1 by two permutations (see Corollary 2), with the intermediate liner order also implying negative total 3-way interaction: The exact same argument applies to L 2 and L 3 . In general, intermediate linear orders of this type are examples of sequences of linear orders between two given linear orders as described in Corollary 2. These intermediate linear orders, L i , can then be used to suggest further fitness comparisons to be tested to validated the conclusion of negative f -interaction in this data set.
To conclude this section we also observe that unlike the intersection L 1 ∩ L 2 ∩ L 3 of the three linear orders given above, the intersection of multiple linear orders, each implying f -interaction, does not necessarily imply f -interaction. To illustrate this situation, consider for example the following linear orders: Both linear orders L 4 and L 5 imply negative total 3-way interaction, as each linear order maps to the Dyck word N P N P N N P P. However, the partial order L 4 ∩ L 5 = 111 011 001, 010, 101 100 110 000 does not imply total 3-way interaction, since there is no perfect matching and L 4 ∩ L 5 extends to the following linear order: L 6 : 111 011 101 010 001 100 110 000, which maps to a non-Dyck word N P P N N N P P. This examples thus shows that the property "implies f -interaction" is not closed under the operation of order intersection and illustrates Corollary 1.
TEM β-lactamase As a second application, we consider the data produced in the antibiotic resistance study of the TEM-family of β-lactamase (Mira et al. 2015). In the table below we display the average growth rates of 16 genotypes grown in the antibiotic AMP in 12 replicates. The 16 genotypes include the wild type and all combinations of amino acid substitutions in TEM-50.
By using these growth rate as a measure of fitness, we deduce that this system has positive total 4-way interaction by directly computing: f (W ) = w 0000 + w 0011 + w 0101 + w 0110 + w 1001 + w 1010 + w 1100 + w 1111 − (w 0001 + w 0010 + w 0100 + w 1000 + w 0111 + w 1011 + w 1101 + w 1110 ) and noting that f (W ) > 0 for the values in Table 2.
In the following, we demonstrate how our approach can be used to analyze the uncertainty of the conclusion that the system has positive total 4-way interaction. We start by ranking the genotypes according to their growth rates. This yields the linear order described in the following table (see Table 5 in Mira et al. (2015)): In the following we assume that the average growth rates of these 16 genotypes vary but that they always preserve the ranking listed in Table 3. This assumption implies that the average growth rates map to the word ω = P P N P P P N P N N P N N N P N according to the mapping described in Sect. 2. Reading ω from left to right, we notice that ω is a Dyck word. Hence, Theorem 1 can be used to confirm that the system has positive interaction. However, comparing the ranking and the average growth rates yields the following observation. The difference between the average growth rates assigned to the genotypes 0101, 1100, and 1001 as well as to the pairs of genotypes 0110, 0100 and 1110, 1011 is smaller comparing to the differences between all other average growth rates assigned to the remaining genotypes. See Fig. 2 for a visual summary of this observation. These small differences in the growth rates highlight the difficulty of finding accurate and robust linear orders among the genotypes.
In contrast, the partial order approach, developed in this work, confirms again that the system has positive total 4-way interaction using fewer and more pronounced comparisons. To illustrate this point, we follow the notations from Theorem 2 and consider the following 8 genotypes p i 's and 8 genotypes n j 's as in Table 4. The linear form f (W ) is as above.
The rows in Table 4 indicate a perfect matching among the two sets of genotypes. Thus, for example the first row indicates that the average growth rates associated to 1101 and 1111 are such that w 1101 > w 1111 . Similarly, for the other rows. From these 8 comparisons of the type w p i > w n j alone, one deduces that the system has positive  total 4-way interaction. Moreover, comparing with the actual average growth rates from Table 2 one can observe that the 8 differences w p i − w n j (see third column in Table 4) are bigger than the differences between the averages growth rates of the critical genotypes mentioned above. Since these differences are more significant, they provide a more reliable conclusion in the empirical setting. Finally, notice that any other perfect matching between the 16 genotypes satisfying w p i > w n j would equally well yield to the same conclusion. In summary, an advantage of the partial order approach is that it relies on fewer pairwise inequalities, which makes the approach more practical.
on the case where only fitness comparisons between certain genotypes are available. This is a common assumption in practice, as there might be more uncertainty or cost involved in deducing some fitness measurements than others. Furthermore, this approach allows to exclude the measurements that have high uncertainty.
In this setting, we present a new algorithm to detect genetic interactions from partial fitness orders in an efficient way. Moreover, we derive a geometric characterization of the class of partial orders that imply interactions. This description, involving the geometry of convex polyhedral cones, provides a solid framework to develop statistical analysis of genetic interactions from partial fitness data.
Our work inspires a number of questions which remain open. First, while we are able to characterize the set of partial orders which imply interaction, our characterization is in terms of a matching in a separate graph which we can construct from our partial order. Thus, it is not immediately clear how to relate properties of a partial order to the probability that this partial order implies interaction. For instance, how does the number and type of incomparable pairs in linear orders affect whether an interaction is implied or not?
Second, it is important to point out that fitness measurements may produce relations which do not necessarily satisfy the transitivity assumption, see the work of (Kerr et al. 2002) were non-transitive pairwise comparisons were studied in certain microbial communities. This limitation and its implications in the theory of fitness landscapes is an important issue that will be explored in further research.