/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package common.inspect;
import fork.lib.base.file.io.txt.ReadTable;
import java.io.File;
import java.util.HashMap;
/**
*
* @author forksapien
*/
public class ClassifierBuilderBedValue {
protected File bed;
protected String tag;
protected int n;
protected ClassifierGeneValue cl;
public ClassifierBuilderBedValue(File bed, String tag, int n) throws Exception{
this.bed=bed;
this.tag=tag;
this.n=n;
init();
}
protected void init() throws Exception{
HashMap<String,Double> idv= new HashMap<>();
String[][] arr= new ReadTable(bed).getTableAsArray();
for( int i=0; i<arr.length ; i++ ){
String[] r= arr[i];
idv.put(r[3], Double.parseDouble(r[4]));
}
cl= new ClassifierGeneValue(idv, tag, n);
}
public ClassifierGeneValue getClassifier(){
return cl;
}
}