tropicalPCA.R

Author:  Xu Zhang
Date:    September 25th 2017
Program: This code produces the 2nd tropical PCA of a small randomly 
         generated dataset with 20 trees and 8 leaves each in the 
         theoretical algorithm.
Input:   If you want to apply a different size of dataset, then you'll
         need to change "DD" and adjust the values of "u" "v" for the
         upper bounds in the Propostiion 4.2 in our paper; if you want
         a different order of PC, you need to change "pcs". In this 
         code, pcs is equal to 3 which is the 2nd PC.
Output:  "random_sample_20_8.txt" where stores the randomly generated
          trees; "random_output_20_8.txt".


tropicalPCA_approx_sim.R

Author:  Xu Zhang
Date:    September 25th 2017
Program: This code produces the 2nd tropical PCA of simulation dataset in 
         the heuristic algorithm.
Input:   Simulation dataset (If you want to apply a different dataset, then
         you'll need to change the path to read the data and adjust 
         "sum_orig"; if you want a different order of PC, you need to change
         "pcs". In this code, pcs is equal to 3 which is the 2nd PC.)
Output:  "sim_output_approx_250_8.txt", "proj_sim_250_8_topology.pdf" and 
         the summary r statistic.


tropicalPCA_approx_apicom.R

Author:  Xu Zhang
Date:    September 25th 2017
Program: This code produces the 2nd tropical PCA of apicomplexa dataset in 
         the heuristic algorithm.
Input:   Apicomplexa dataset (If you want to apply a different dataset, then
         you'll need to change the path to read the data and adjust 
         "sum_orig"; if you want a different order of PC, you need to change
         "pcs". In this code, pcs is equal to 3 which is the 2nd PC.)
Output:  "apicom_output_approx.txt", "proj_api_topology.pdf" and the summary
         r statistic.
