| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 
 | 
package pca;
 
import java.io.FileReader;
import java.io.IOException;
import java.util.*;
import java.lang.Object;
import javastat.multivariate.PCA;
import javastat.StatisticalAnalysis;
import au.com.bytecode.opencsv.CSVReader;
 
public class Apply2 {
	
	public static void main(String[] args) throws IOException 
    {
        CSVReader reader = new CSVReader(new 
                FileReader("stockori/genotype.csv"));
        String [] nextLine;
        double[][] myTable= new double[697][149];
        int j=0;
        while ((nextLine = reader.readNext()) != null) 
        {
            // nextLine[] is an array of values from the line
            for (int i=0; i<nextLine.length; i++)
            {
                myTable[j][i]=Double.parseDouble(nextLine[i]);
            }
            j++;
        }
        System.out.println(myTable.length);
                
        Hashtable argument2 = new Hashtable(); 
        PCA testclass4 = new PCA(argument2, null); 
        double[][]pPrincipalComponents= testclass4.principalComponents(argument2, myTable); 
        double[] vVariance = testclass4.variance(argument2, myTable);
    }
 
} |