/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package data.cerevisiae.region.aclen;
import common.ExpressionMap;
import common.IDMap;
import fork.lib.base.file.io.txt.ReadTable;
import fork.lib.base.file.management.Dirs;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
/**
*
* @author forksapien
*/
public class MapCommonName {
public static void main(String[] args) throws Exception {
File dir= Dirs.getFile("dir");
File d= new File(dir+"/anno/bed/len/score/select_ac");
File f= new File(d+"/sort_locate-de_z20.0_ac2.0_in.txt");
//File f= new File(d+"/sort_locate-ac_z20.0_ac40.0_in.txt");
File out= new File(d+"/map_"+ f.getName());
out.getParentFile().mkdirs();
ReadTable rt= new ReadTable(f);
BufferedWriter bw= new BufferedWriter(new FileWriter(out));
String[][] arr= rt.getTableAsArray();
for( int i=0; i<arr.length ; i++ ){
String[] r= arr[i];
for( int j=0; j<=7 ; j++ ){
bw.write(r[j]+"\t");
}
String n= IDMap.map(r[7]);
String e= ExpressionMap.map(r[7]);
if(n==null){n=r[7];}
if(e==null){e="0";}
bw.write(n+"\t"+e);
for( int j=8; j<r.length ; j++ ){
bw.write("\t"+r[j]);
}
bw.write("\n");
}
bw.close();
}
}