BACKGROUND
unifrac is a tool for comparing microbial communities while taking phylogenetic distance between organisms into account.
it is available as a web service hosted by the university of colorado at boulder at
http://bmf <dig> colorado.edu/unifrac/index.psp, and is described by lozupone, hamady and knight
<cit> .
according to recent work by the authors, unifrac is a popular tool that has been cited in over  <dig> publications
<cit> .
unifrac has two main uses that are relevant to this paper.
the first use is to calculate the unifrac distance between communities, which is done by considering the branches of an input phylogenetic tree that are unique to one community or the other.
the second use is to determine whether two communities are different from each other with statistical significance, taking into account the phylogenetic information implied by the unifrac distance metric.
briefly, unifrac uses a phylogenetic tree as input, along with sample labels at each leaf node of the tree.
to perform tests of significance, unifrac creates new trees by randomly re-assigning the sample labels.
for each random re-assignment, it calculates whether the resulting unifrac distance between samples is equal to or greater than the distance between samples in the original labeling.
the p-value reported is the number of random labelings that have an equal or greater distance between samples divided by the total number of randomized labelings.in figure
<dig> we show a very simple example of unifrac input.
it consists of a tree having only two leaf nodes, with an arbitrary distance value of  <dig>  on the branch leading to each leaf.
in this example, the organism represented by node a was found in sample <dig> and the organism represented by node b was found in sample <dig>  uploading this data to the unifrac web tool and performing the "unifrac significance test" gives a p-value of  <dig> .
this means that in 100% of the randomly labelled trees, the unifrac distance between samples  <dig> and  <dig> was equal to or greater than the unifrac distance between the two samples in the original tree, and thus the two environments are not different with statistical significance.
we can see why this is the case through the following reasoning.
a random assignment of the labels will assign the sample <dig> label to either node a or b and sample <dig> to the other.
since the tree is symmetric, the unifrac distance between sample  <dig> and  <dig> will be the same in either scenario.figure  <dig>
simple input tree for unifrac.
simple example of unifrac input that does not use abundance counts.
unifrac also allows for abundance counts to be included in the input data.
for instance, in addition to indicating that node a was found in sample <dig>  we can also indicate the number of times it was found.
figure
<dig> shows a tree where node a was found  <dig> times in sample <dig> and node b was found  <dig> times in sample <dig>  it is also possible for more than one sample label to be associated with each leaf node, and for each such label to have its own abundance count.
the unifrac web tool has an option to use these abundance counts when calculating the unifrac distance between samples by using the weighted unifrac algorithm
<cit> .figure  <dig>
input tree for unifrac with abundance counts.
a tree input into unifrac where abundance counts are included at each leaf node in compact form.
it is exclusively the weighted version of the algorithm that is the subject of the remainder of this paper.
RESULTS
overview
in this section, we establish the nature of the discrepancy that leads to the unifrac significance test producing different results on equivalent inputs.
in order for two objects to be equivalent, we must show two things: first, that the two objects are isomorphic, and second, that both objects maintain the same semantic interpretation.
intuitively, two objects are isomorphic to each other if a procedure exists to transform one to the other and back again.
a more mathematical definition of isomorphism follows in the next section.
in the preceding section, we described how trees input to the unifrac program may or may not contain abundance counts.
below, we define a transformation for converting trees back and forth between these two formats.
we briefly discuss how both tree formats have the same semantics.
we then demonstrate that the unifrac tool produces different outputs for the equivalent forms of the same input tree using a minimal example.
such a discrepancy is dangerous to researchers; it can lead them to false conclusions since their results may depend on the choice of input representation, making reproduction of results difficult.
finally, we illustrate the misleading results that can arise from this discrepancy using metagenomic data from a lake sediment study.
isomorphism of trees with and without abundance counts
we will show that the tree format that includes abundance counts is isomorphical to a tree with no abundance counts .
here, we consider two objects x and y to be isomorphic to each other if and only if there exists a function f and its inverse f- <dig> such that f) = y and f-1) = x. therefore, we will outline a simple, invertible transform f between the two tree formats.
at each leaf node with either an abundance count n> <dig> for some sample a or with multiple sample labels, we create n new leaf nodes, which we then connect to the original leaf node  with a branch of weight  <dig>  the sample label samplex  is then associated with each of the new individual leaf nodes.
if the original leaf node had more than one sample label, this is repeated for each label.
applying this transformation to the tree in figure
<dig> results in the tree in figure
<dig>  the reverse transformation  is equally simple.
first, we define a pre-terminal node as a node with only leaf nodes as children.
for each pre-terminal node t for which all of t’s children are connected by a branch of length  <dig>  we attach a count to t for each unique sample label samplen associated with any child of t, where the count is the number of children of t that had label samplen.
we then eliminate all children of t, making t into a new leaf node.
clearly, by way of their construction, f is the inverse of f- <dig> and vice versa.figure  <dig>
expanded input tree for unifrac.
an expanded tree that is equivalent to that shown in figure
<dig>  but which does not use abundance counts.
since we now have a fully reversible transformation, we have satisfied the conditions to prove that the trees in figure
<dig> and figure
<dig> are isomorphic.
henceforth, we will refer to trees with abundance counts like the tree in figure
<dig> as the compact form and larger trees like the one in figure
<dig> as the expanded form.
semantics of compact and expanded trees
both the compact and expanded form trees have the same semantics, and thus are valid input for the unifrac significance test.
in both cases, each leaf node represents an otu and the count associated with it is an abundance count of that otu .
a distance value is attached to each branch; by means of their construction, these values are the same between both trees, except for the new branches in the expanded tree, which have an attached value of zero.
typically, these distances are expected to be edit distances between biological sequences, but the unifrac formulation allows these values to be any distance metric.
however, in mathematics it is standard that any function described as a distance function must satisfy a small number of very basic properties, one of which is the coincidence axiom, which states two objects have a distance of zero between them if and only if they are identical.
therefore, the semantics of a branch of zero length must necessarily be the same across both trees.
we have now shown that the compact and expanded form trees are both isomorphically and semantically equivalent and merely use a different visual representation.
we would therefore expect any numeric calculations based on these trees to yield the same result.
unifrac p-values on compact and expanded trees
we can now ask the question: what should be the result of a unifrac significance test on the tree in figure
3?
although we have only very briefly discussed how unifrac distances are calculated, in the case of figure
<dig> it is clear that all labelings other than the original  have an equal or smaller distance between the two samples than the original labeling itself.
this is because the two longer, top level branches are at least partially shared by both samples in any scenario other than the original labeling, which will result in a smaller unifrac distance.
the p-value of the unifrac significance test for this example is equal to the probability of randomly generating the original labeling.
there are
possible ways to assign the labels to this tree, and since symmetric labelings are equivalent for our purposes , the probability of generating the original labeling at random is 2/ <dig> or approximately  <dig> .
we now upload the data for this tree  to the unifrac web tool and perform a unifrac significance test.
we note that as the web tool by default generates  <dig> random labelings, we expect some variance in the p-values if the analysis is run multiple times, but we expect the range of the variance to be small.
as expected, several trials performed by the authors yielded p-values in the range of  <dig> to  <dig> .
finally, we will compare this to the results for the tree in figure
<dig>  as we have previously shown, this tree is equivalent to the one in figure
<dig>  but because this tree is in compact form, the input files given to unifrac are visually different from those for the tree in figure
<dig> .
for this tree, the resulting unifrac significance value given by the web tool is  <dig>  .
this means that all randomly generated labelings had an equal or greater unifrac distance between the two samples than in the original labeling.
we can explain this discrepancy in output if we assume that, during the generation of random trees, the abundance counts are permanently associated with each sample label.
in other words, in the case of figure
<dig>  whichever leaf node is associated with sample <dig> automatically also has an abundance count of  <dig>  personal correspondence with the unifrac authors has confirmed that is indeed the way the abundance counts are handled, and thus the discrepancy is not due to a code error nor to simple variance due to a relatively small number of random labelings.
because the compact-form tree has only two symmetric leaf nodes, it is irrelevant if the sample labels are swapped, and thus all randomly generated trees have the same unifrac distance between samples as the original tree, resulting in a p-value of  <dig>  of course, this is completely different from the p-values in the range of  <dig> to  <dig>  obtained for the tree in figure
<dig>  and so there is a discrepancy in output generated from semantically equivalent input.
we note that in this section, we have endeavoured to use the simplest possible example to illustrate the discrepancy between expanded and compact form trees.
the problem is demonstrable with more complex trees as well.
other tools for comparing phylogenetic trees
we briefly investigated two other recent tools used for metagenomic analysis: parallel-meta
<cit>  and meta-storms
<cit> .
as parallel-meta does not directly compare comunities using phylogenetic trees, the disrepancy we describe above was not applicable.
meta-storms does compare communities using phylogenetic trees in a manner similar to unifrac, so we used meta-storms to analyze a simple artificial data-set.
the data consisted of two environments, a and b, each containing  <dig> sequences.
all sequences in environment a were identical to each other and all sequences in environment b were identical to each other, but completely different from the sequences in environment a. meta-storms reported that these two environments were not different from one another, mirroring the unifrac result from the preceding section.
thus we conclude it is likely that meta-storms suffers from the same methodological problem that we identify in unifrac above.
discussion on the discrepancy
the primary goal of this paper is to clearly demonstrate the discrepancy in output stemming from equivalent input for the unifrac significance test.
our goal is not to make a definitive statement as to which output is better.
however, here we will present some brief arguments and examples as to why the output produced when using expanded form trees as input may be more intuitive, scientifically useful, and robust.first, consider again the example in figure
<dig>  except now suppose that the abundance count for each leaf node is not  <dig> but  <dig> , and that furthermore, the weight on each branch is not  <dig>  but some much higher value, say  <dig> .
the p-value of a weighted unifrac significance test on such an input tree is  <dig>  for the same reasons we outlined in the preceding section, so the two communities would not be deemed significantly different.
this seems an odd conclusion to draw, as this input tree represents two large, disjoint communities of individuals with a large phylogenetic distance between them.
a significance test resulting from the expanded form of such a tree, on the other hand, yields a p-value of nearly  <dig>  indicating that the two environments are indeed different with near-certainty.
second, again using figure
<dig> as a starting point, consider the case where the  <dig> individuals in sample <dig> are not in fact identical, but are grouped together due to a clustering process , and similarly for sample <dig>  let us then say that we wish to investigate the effect of this clustering by building a new tree where the sequences are not clustered at all.
such a tree would look very similar to the tree in figure
<dig>  except that the  <dig> weights on all the short branches would instead be some small, non-zero value .
note that because these branch weights are non-zero, this new tree is not a mere isomorphic transform of the original tree.
however, a unifrac significance test on this new tree would yield a p-value similar to the value obtained for the tree in figure
<dig> , and thus very different from the p-value of  <dig>  for the tree in figure
<dig>  thus, were we to use the result from the compact-form tree in figure
<dig> as our starting point, we would conclude that the clustering process had a very large effect on determining community similarity, when in fact the clustering makes almost no difference if we start from the  expanded form instead.
this effect suggests that analysis of expanded form trees leads to more robust and consistent results in general.
effect of the discrepancy on sample data
we have observed this discrepancy to cause problematic results not just in the simple example described above, but also in a collection of our own dna sequence data consisting of a metagenomic survey of lake sediment bacteria .
while a full description of these data is beyond the scope of this paper, we discuss the basics here.
we used sediment samples from three different lakes; lake a is downstream from an industrial facility and lakes b and c are upstream reference lakes.
two different dna extraction techniques were used to produce data from each sample, for a total of six samples.
we would expect a priori that samples from the same lake would be similar to each other with the choice of dna extraction having relatively little effect, and that lakes b and c would be more similar to each other than to lake a. indeed, an examination of the weighted unifrac pairwise distances between samples  agreed with this a priori expectation, as did other analyses we performed that are beyond the scope of this paper, but include statistical hierarchical clustering of otus, statistical comparison using amova in the tool mothur
<cit> , visual inspection of otu heatmaps and beta diversity metrics such as euclidean distances and unweighted unifrac distances.
however, p-values from the unifrac significance test on this data, shown in table
<dig>  were contrary to all other analyses.
it was in fact this observation that launched the investigation that resulted in this paper.table  <dig>
normalized pairwise unifrac distances on sample lake sediment data
normalized, pairwise unifrac distances between six samples of metagenomic lake sediment data.
samples a <dig> and a <dig> represent data from two different techniques used to extract dna from a lake downstream of an industrial facility; samples b <dig> and b <dig> and c <dig> and c <dig> represent data from two upstream lakes.
weighted unifrac p-values on compact form of lake sediment data
weighted unifrac uncorrected p-values between six samples of metagenomic lake sediment data.
as samples a <dig> and a <dig> are from the same lake, we would expect them to be similar, but the low p-value here indicates that there is a much higher probability that they are significantly different than, say, a <dig> and c <dig>
in this case, we appear to get more sensible results by performing the isomorphic transform we have described above prior to submitting data to unifrac, and thus using the expanded form of our input.
we provide a simple perl script for transforming data with abundance counts into its fully expanded equivalent .
in table
<dig> we show unifrac significance test p-values for our lake sediment data after running the transformation script.
many of the values in this table are zero, which is expected given the larger size of the expanded tree.
however, the non-zero values are a much closer match to our a priori expectations than the p-values in table
<dig> table  <dig>
weighted unifrac p-values on expanded form of lake sediment data
weighted unifrac uncorrected p-values between six samples of metagenomic lake sediment data using the expanded form as input.
p-values are now much more consistent with the most important aspects of our expectations and other forms of analyses compared to the values in table
<dig>  for instance, the two downstream samples  may be similar and are definitely different from all the upstream samples.
although there is a larger chance that b <dig> is similar to c <dig> than we might expect, the p-value for c <dig> and c <dig> is much higher still, which was not the case in table
<dig>
CONCLUSIONS
in this paper, we identify a discrepancy in the unifrac methodology for testing of significant difference in community structure, showing how two equivalent inputs could generate vastly different outputs.
unifrac users need to be aware of this issue so as to avoid misleading and inconsistent results.
we provide an example of the effect this discrepancy can have on real data.
finally, we provide software to perform the isomorphic transform so that data can be submitted to the existing unifrac service in a consistent form.

 unifrac is a tool for comparing microbial communities while taking phylogenetic distance between organisms into account. it is available as a web service hosted by the university of colorado at boulder at http://bmf colorado.edu/unifrac/index.psp, and is described by lozupone, hamady and knight. according to recent work by the authors, unifrac is a popular tool that has been cited in over publications. unifrac has two main uses that are relevant to this paper. the first use is to calculate the unifrac distance between communities, which is done by considering the branches of an input phylogenetic tree that are unique to one community or the other. the second use is to determine whether two communities are different from each other with statistical significance, taking into account the phylogenetic information implied by the unifrac distance metric. briefly, unifrac uses a phylogenetic tree as input, along with sample labels at each leaf node of the tree. to perform tests of significance, unifrac creates new trees by randomly re-assigning the sample labels. for each random re-assignment, it calculates whether the resulting unifrac distance between samples is equal to or greater than the distance between samples in the original labeling. the p-value reported is the number of random labelings that have an equal or greater distance between samples divided by the total number of randomized labelings.in figure we show a very simple example of unifrac input. it consists of a tree having only two leaf nodes, with an arbitrary distance value of on the branch leading to each leaf. in this example, the organism represented by node a was found in sample and the organism represented by node b was found in sample uploading this data to the unifrac web tool and performing the "unifrac significance test" gives a p-value of. this means that in 100% of the randomly labelled trees, the unifrac distance between samples and was equal to or greater than the unifrac distance between the two samples in the original tree, and thus the two environments are not different with statistical significance. we can see why this is the case through the following reasoning. a random assignment of the labels will assign the sample label to either node a or b and sample to the other. since the tree is symmetric, the unifrac distance between sample and will be the same in either scenario.figure simple input tree for unifrac. simple example of unifrac input that does not use abundance counts. unifrac also allows for abundance counts to be included in the input data. for instance, in addition to indicating that node a was found in sample we can also indicate the number of times it was found. figure shows a tree where node a was found times in sample and node b was found times in sample it is also possible for more than one sample label to be associated with each leaf node, and for each such label to have its own abundance count. the unifrac web tool has an option to use these abundance counts when calculating the unifrac distance between samples by using the weighted unifrac algorithm.figure input tree for unifrac with abundance counts. a tree input into unifrac where abundance counts are included at each leaf node in compact form. it is exclusively the weighted version of the algorithm that is the subject of the remainder of this paper.  overview in this section, we establish the nature of the discrepancy that leads to the unifrac significance test producing different results on equivalent inputs. in order for two objects to be equivalent, we must show two things: first, that the two objects are isomorphic, and second, that both objects maintain the same semantic interpretation. intuitively, two objects are isomorphic to each other if a procedure exists to transform one to the other and back again. a more mathematical definition of isomorphism follows in the next section. in the preceding section, we described how trees input to the unifrac program may or may not contain abundance counts. below, we define a transformation for converting trees back and forth between these two formats. we briefly discuss how both tree formats have the same semantics. we then demonstrate that the unifrac tool produces different outputs for the equivalent forms of the same input tree using a minimal example. such a discrepancy is dangerous to researchers; it can lead them to false conclusions since their results may depend on the choice of input representation, making reproduction of results difficult. finally, we illustrate the misleading results that can arise from this discrepancy using metagenomic data from a lake sediment study. isomorphism of trees with and without abundance counts we will show that the tree format that includes abundance counts is isomorphical to a tree with no abundance counts. here, we consider two objects x and y to be isomorphic to each other if and only if there exists a function f and its inverse f- such that f) = y and f-1) = x. therefore, we will outline a simple, invertible transform f between the two tree formats. at each leaf node with either an abundance count n> for some sample a or with multiple sample labels, we create n new leaf nodes, which we then connect to the original leaf node with a branch of weight the sample label samplex is then associated with each of the new individual leaf nodes. if the original leaf node had more than one sample label, this is repeated for each label. applying this transformation to the tree in figure results in the tree in figure the reverse transformation is equally simple. first, we define a pre-terminal node as a node with only leaf nodes as children. for each pre-terminal node t for which all of t’s children are connected by a branch of length we attach a count to t for each unique sample label samplen associated with any child of t, where the count is the number of children of t that had label samplen. we then eliminate all children of t, making t into a new leaf node. clearly, by way of their construction, f is the inverse of f- and vice versa.figure expanded input tree for unifrac. an expanded tree that is equivalent to that shown in figure but which does not use abundance counts. since we now have a fully reversible transformation, we have satisfied the conditions to prove that the trees in figure and figure are isomorphic. henceforth, we will refer to trees with abundance counts like the tree in figure as the compact form and larger trees like the one in figure as the expanded form. semantics of compact and expanded trees both the compact and expanded form trees have the same semantics, and thus are valid input for the unifrac significance test. in both cases, each leaf node represents an otu and the count associated with it is an abundance count of that otu. a distance value is attached to each branch; by means of their construction, these values are the same between both trees, except for the new branches in the expanded tree, which have an attached value of zero. typically, these distances are expected to be edit distances between biological sequences, but the unifrac formulation allows these values to be any distance metric. however, in mathematics it is standard that any function described as a distance function must satisfy a small number of very basic properties, one of which is the coincidence axiom, which states two objects have a distance of zero between them if and only if they are identical. therefore, the semantics of a branch of zero length must necessarily be the same across both trees. we have now shown that the compact and expanded form trees are both isomorphically and semantically equivalent and merely use a different visual representation. we would therefore expect any numeric calculations based on these trees to yield the same result. unifrac p-values on compact and expanded trees we can now ask the question: what should be the result of a unifrac significance test on the tree in figure 3? although we have only very briefly discussed how unifrac distances are calculated, in the case of figure it is clear that all labelings other than the original have an equal or smaller distance between the two samples than the original labeling itself. this is because the two longer, top level branches are at least partially shared by both samples in any scenario other than the original labeling, which will result in a smaller unifrac distance. the p-value of the unifrac significance test for this example is equal to the probability of randomly generating the original labeling. there are possible ways to assign the labels to this tree, and since symmetric labelings are equivalent for our purposes, the probability of generating the original labeling at random is 2/ or approximately. we now upload the data for this tree to the unifrac web tool and perform a unifrac significance test. we note that as the web tool by default generates random labelings, we expect some variance in the p-values if the analysis is run multiple times, but we expect the range of the variance to be small. as expected, several trials performed by the authors yielded p-values in the range of to. finally, we will compare this to the results for the tree in figure as we have previously shown, this tree is equivalent to the one in figure but because this tree is in compact form, the input files given to unifrac are visually different from those for the tree in figure. for this tree, the resulting unifrac significance value given by the web tool is. this means that all randomly generated labelings had an equal or greater unifrac distance between the two samples than in the original labeling. we can explain this discrepancy in output if we assume that, during the generation of random trees, the abundance counts are permanently associated with each sample label. in other words, in the case of figure whichever leaf node is associated with sample automatically also has an abundance count of personal correspondence with the unifrac authors has confirmed that is indeed the way the abundance counts are handled, and thus the discrepancy is not due to a code error nor to simple variance due to a relatively small number of random labelings. because the compact-form tree has only two symmetric leaf nodes, it is irrelevant if the sample labels are swapped, and thus all randomly generated trees have the same unifrac distance between samples as the original tree, resulting in a p-value of of course, this is completely different from the p-values in the range of to obtained for the tree in figure and so there is a discrepancy in output generated from semantically equivalent input. we note that in this section, we have endeavoured to use the simplest possible example to illustrate the discrepancy between expanded and compact form trees. the problem is demonstrable with more complex trees as well. other tools for comparing phylogenetic trees we briefly investigated two other recent tools used for metagenomic analysis: parallel-meta and meta-storms. as parallel-meta does not directly compare comunities using phylogenetic trees, the disrepancy we describe above was not applicable. meta-storms does compare communities using phylogenetic trees in a manner similar to unifrac, so we used meta-storms to analyze a simple artificial data-set. the data consisted of two environments, a and b, each containing sequences. all sequences in environment a were identical to each other and all sequences in environment b were identical to each other, but completely different from the sequences in environment a. meta-storms reported that these two environments were not different from one another, mirroring the unifrac result from the preceding section. thus we conclude it is likely that meta-storms suffers from the same methodological problem that we identify in unifrac above. discussion on the discrepancy the primary goal of this paper is to clearly demonstrate the discrepancy in output stemming from equivalent input for the unifrac significance test. our goal is not to make a definitive statement as to which output is better. however, here we will present some brief arguments and examples as to why the output produced when using expanded form trees as input may be more intuitive, scientifically useful, and robust.first, consider again the example in figure except now suppose that the abundance count for each leaf node is not but, and that furthermore, the weight on each branch is not but some much higher value, say. the p-value of a weighted unifrac significance test on such an input tree is for the same reasons we outlined in the preceding section, so the two communities would not be deemed significantly different. this seems an odd conclusion to draw, as this input tree represents two large, disjoint communities of individuals with a large phylogenetic distance between them. a significance test resulting from the expanded form of such a tree, on the other hand, yields a p-value of nearly indicating that the two environments are indeed different with near-certainty. second, again using figure as a starting point, consider the case where the individuals in sample are not in fact identical, but are grouped together due to a clustering process, and similarly for sample let us then say that we wish to investigate the effect of this clustering by building a new tree where the sequences are not clustered at all. such a tree would look very similar to the tree in figure except that the weights on all the short branches would instead be some small, non-zero value. note that because these branch weights are non-zero, this new tree is not a mere isomorphic transform of the original tree. however, a unifrac significance test on this new tree would yield a p-value similar to the value obtained for the tree in figure, and thus very different from the p-value of for the tree in figure thus, were we to use the result from the compact-form tree in figure as our starting point, we would conclude that the clustering process had a very large effect on determining community similarity, when in fact the clustering makes almost no difference if we start from the expanded form instead. this effect suggests that analysis of expanded form trees leads to more robust and consistent results in general. effect of the discrepancy on sample data we have observed this discrepancy to cause problematic results not just in the simple example described above, but also in a collection of our own dna sequence data consisting of a metagenomic survey of lake sediment bacteria. while a full description of these data is beyond the scope of this paper, we discuss the basics here. we used sediment samples from three different lakes; lake a is downstream from an industrial facility and lakes b and c are upstream reference lakes. two different dna extraction techniques were used to produce data from each sample, for a total of six samples. we would expect a priori that samples from the same lake would be similar to each other with the choice of dna extraction having relatively little effect, and that lakes b and c would be more similar to each other than to lake a. indeed, an examination of the weighted unifrac pairwise distances between samples agreed with this a priori expectation, as did other analyses we performed that are beyond the scope of this paper, but include statistical hierarchical clustering of otus, statistical comparison using amova in the tool mothur, visual inspection of otu heatmaps and beta diversity metrics such as euclidean distances and unweighted unifrac distances. however, p-values from the unifrac significance test on this data, shown in table were contrary to all other analyses. it was in fact this observation that launched the investigation that resulted in this paper.table normalized pairwise unifrac distances on sample lake sediment data normalized, pairwise unifrac distances between six samples of metagenomic lake sediment data. samples a and a represent data from two different techniques used to extract dna from a lake downstream of an industrial facility; samples b and b and c and c represent data from two upstream lakes. weighted unifrac p-values on compact form of lake sediment data weighted unifrac uncorrected p-values between six samples of metagenomic lake sediment data. as samples a and a are from the same lake, we would expect them to be similar, but the low p-value here indicates that there is a much higher probability that they are significantly different than, say, a and c in this case, we appear to get more sensible results by performing the isomorphic transform we have described above prior to submitting data to unifrac, and thus using the expanded form of our input. we provide a simple perl script for transforming data with abundance counts into its fully expanded equivalent. in table we show unifrac significance test p-values for our lake sediment data after running the transformation script. many of the values in this table are zero, which is expected given the larger size of the expanded tree. however, the non-zero values are a much closer match to our a priori expectations than the p-values in table table weighted unifrac p-values on expanded form of lake sediment data weighted unifrac uncorrected p-values between six samples of metagenomic lake sediment data using the expanded form as input. p-values are now much more consistent with the most important aspects of our expectations and other forms of analyses compared to the values in table for instance, the two downstream samples may be similar and are definitely different from all the upstream samples. although there is a larger chance that b is similar to c than we might expect, the p-value for c and c is much higher still, which was not the case in table  in this paper, we identify a discrepancy in the unifrac methodology for testing of significant difference in community structure, showing how two equivalent inputs could generate vastly different outputs. unifrac users need to be aware of this issue so as to avoid misleading and inconsistent results. we provide an example of the effect this discrepancy can have on real data. finally, we provide software to perform the isomorphic transform so that data can be submitted to the existing unifrac service in a consistent form. 
results from the unifrac tool can vary greatly for the same input depending on the arbitrary choice of input format. unifrac produces different outputs for these equivalent forms of the same input tree. this is illustrated using metagenomics data from a lake sediment study. in this paper we identify a discrepancy in the unifrac methodology that causes semantically equivalent inputs to produce different outputs in tests of statistical significance. an isomorphic transform can be defined that will convert trees between these two formats without altering the semantic meaning of the trees. the phylogenetic trees that are input into unifrac may or may not contain abundance counts. unifrac is a well-known tool for comparing microbial communities and assessing statistically significant differences between communities.
 unifrac is a well-known tool for comparing microbial communities and assessing statistically significant differences between communities. in this paper we identify a discrepancy in the unifrac methodology that causes semantically equivalent inputs to produce different outputs in tests of statistical significance.  the phylogenetic trees that are input into unifrac may or may not contain abundance counts. an isomorphic transform can be defined that will convert trees between these two formats without altering the semantic meaning of the trees. unifrac produces different outputs for these equivalent forms of the same input tree. this is illustrated using metagenomics data from a lake sediment study.  results from the unifrac tool can vary greatly for the same input depending on the arbitrary choice of input format. practitioners should be aware of this issue and use the tool with caution to ensure consistency and validity in their analyses. we provide a script to transform inputs between equivalent formats to help researchers achieve this consistency. electronic supplementary material the online version of this article contains supplementary material, which is available to authorized users. keywords unifraccomputer methodologiesmetagenomicsissue-copyright-statement© the author 2014 