Hi Jincheng,
First of all thank you for reporting this.
Now, the algorithm to create the jackknifed plots is:
# Create the reference PCoA
1. Compute distance matrix of the raw OTU table (without subsampling)
2. Compute PCoA on the previous distance matrix - this becomes the
"reference PCoA"
# Create the iterative PCoAs
3. Sub-sample the OTU table to depth D, N times
4. Compute individual distance matrix of N OTU tables
5. Compute PCoA of N distance matrices
6. (optional - this is the difference, more below) Transform the N
PCoA agains the reference
# Plot
7. Calculate the variance between reference and the N PCoAs
8. Plot the variance ellipsoids around the reference centroids
As stated in the previous list the difference between what you are
seeing in make_2d_plots.py and make_emperor.py is step 6. This step is
intended to "fix" the PCoA artifacts that _could_ result in different
orientation of the same samples. Remember that in PCoA the direction
of the axis is not formally defined (as it is a simple reflection) and
it could change based on floating point values, which could be the
result of hardware/OS specific configurations. This means, the same
distance matrix could produce the same PCoA but rotated if ran in
different hardware/OS.
The currently "accepted" methods to solve the artifacts are: (1) do
nothing (make_emperor.py) and assume that the samples are different
enough and you are doing enough iterations to mitigate the _possible_
PCoA artifacts, (2) check the signs of the reference (directions) and
fix them in the iterations (make sure they are in the same
orientation), and (3) use procrustes (make_2d_plots.py) to fix not
only orientation but also the shape of the iterative PCoA. As you can
imagine, all of them have pros and cons and you should decide which
one is the best.
Finally, in the current implementations we only have one of the
previous list of transformations so the plan is to add all of them
into make_emperor.py (see issue
https://github.com/biocore/emperor/issues/402) and as Jai said we are
also planning in adding 2D plotting into make_emperor.py.
Hope this clarifies your question.
Antonio