/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package data.cerevisiae.test.regseq;
import data.cerevisiae.inhouse.jointable.JoinTable;
import fork.lib.base.file.io.txt.ReadTable;
import fork.lib.base.file.management.Dirs;
import fork.lib.base.format.collection.FormatOp1D;
import fork.lib.math.algebra.Algebra1D;
import fork.lib.math.algebra.advanced.linearalgebra.Vector;
import java.io.File;
/**
*
* @author man-mqbpjmg4
*/
public class JoinTableS extends JoinTable{
public static void main(String[] args) throws Exception { //debug
File dir= Dirs.getFile("dir");
int size= 1;
File d= new File(dir+"/test_anal/z3seq/quant_z3as/3prime_up/"+ size);
File fa= new File(d+"/motif_3prime_up_z3_as.txt");
File fb= new File(d+"/motif_3prime_up_z3_nas.txt");
JoinTableS jj= new JoinTableS();
jj.initEmptyRow(new ReadTable(fa).getColumn(0));
jj.addTextFile(fa);
jj.addTextFile(fb);
Vector va= new Vector(FormatOp1D.stringToDouble(jj.tab.getColumn(0)));
Vector vb= new Vector(FormatOp1D.stringToDouble(jj.tab.getColumn(1)));
Vector vc= va.divideByVector(vb);
jj.addElementsAnyway(FormatOp1D.doubleToArrayDouble(vc.getDoubles()), "ratio");
int[] inds= Algebra1D.getReversedIndexForOrigin(vc.getDoubles());
jj.tab.reorderRows(inds);
jj.writeToFile(new File(d+"/combine_"+size+".txt"));
}
}