Package common.inspect

Source Code of common.inspect.ClassifierFour

/*
* 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 fork.lib.base.format.collection.FormatOp1D;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;

/**
*
* @author forksapien
*/
public class ClassifierFour extends Classifier{
   
   
   
   

protected String tag;
protected File fu, fd;
   
   
   
    public ClassifierFour(File fu, File fd, String tit) throws Exception{
        super(tit);
        this.tag= tit;
        this.fu=fu;
        this.fd=fd;
        init();
    }
   
   
   
   
   
   
   

protected void init() throws Exception{
    sets.add(new GeneSet(tag+"_h5l3"));
    sets.add(new GeneSet(tag+"_h5h3"));
    sets.add(new GeneSet(tag+"_l5l3"));
    sets.add(new GeneSet(tag+"_l5h3"));
    sets.add(new GeneSet(tag+"_n"));

    String[] ids= new ReadTable(fu).getColumn(3);
    double[] v5s= FormatOp1D.objToDouble( new ReadTable(fu).getColumn(4) );
    double[] v3s= FormatOp1D.objToDouble( new ReadTable(fd).getColumn(4) );
    for(int i=0; i<v5s.length ; i++){
        String id= ids[i];
        double v5= v5s[i];
        double v3= v3s[i];
        if(v5>50){
            if(v3<1){
                sets.get(0).add(id);
            }else if(v3>5){
                sets.get(1).add(id);
            }else{
                sets.get(4).add(id);
            }
        }else if(v5<5){
            if(v3<1){
                sets.get(2).add(id);
            }else if(v3>5){
                sets.get(3).add(id);
            }else{
                sets.get(4).add(id);
            }
        }else{
            sets.get(4).add(id);
        }
    }
}

   
   
   
   
   
   
   
   
   
}
TOP

Related Classes of common.inspect.ClassifierFour

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.