Package fork.lib.base.file.io.txt

Examples of fork.lib.base.file.io.txt.ReadTable


    }
}

   
public static void initRows(File f) throws IOException{
    ReadTable rt= new ReadTable(f);
    String[] rns= rt.getColumn(3);
    for(int j=0; j<rns.length ; j++){
        String rn= rns[j];
        if(!tab.containsRow(rn)){
            tab.appendEmptyRow(rn);
        }
    }
    String[][] arr= rt.getTableAsArray();
    tab.appendEmptyColumn("pos");
    for(int i=0; i<arr.length ; i++){
        String[] r= arr[i];
        String pos= r[0]+":"+r[1]+"-"+r[2];
        tab.setValueAt(pos, r[3], "pos");
View Full Code Here


   
   
public static void addBedFile(File f) throws IOException{
    String cn= FileName.getBaseName(f);
    tab.appendEmptyColumn(cn);
    ReadTable rt= new ReadTable(f);
    String[] rns= rt.getColumn(3);
    String[] vs= rt.getColumn(4);
    for(int j=0; j<rns.length ; j++){
        String rn= rns[j];
        String v= vs[j];
        if(tab.containsRow(rn)){
            tab.setValueAt(v, rn, cn);
View Full Code Here


public static void addHtz1(File f)throws Exception{
    String cn= FileName.getBaseName(f);
    tab.appendEmptyColumn(cn);
    ReadTable rt= new ReadTable(f);
    String[] rns= rt.getColumn(3);
    String[] vs= rt.getColumn(4);
    for( int i=0; i<rns.length; i++ ){
        String rn= rns[i];
        double v= Double.parseDouble(vs[i]);
        String tv;
        if(v>0.6){
View Full Code Here

}

public static void addFile(File f)throws Exception{
    String cn= FileName.getBaseName(f);
    tab.appendEmptyColumn(cn);
    ReadTable rt= new ReadTable(f);
    String[] rns= rt.getColumn(3);
    String[] vs= rt.getColumn(4);
    for( int i=0; i<rns.length; i++ ){
        String rn= rns[i];
        double v= Double.parseDouble(vs[i]);
        String tv;
        if(v>thr){
View Full Code Here

   
   
protected void init()throws Exception{
    hm=new HashMap<>();
    for( int i=0; i<fs.length ; i++ ){
        String[][] arr= new ReadTable(fs[i]).getTableAsArray();
        for( int j=0; j<arr.length ; j++ ){
            String[] r= arr[j];
            String dr= r[3]+"\t"+ r[0]+":"+Integer.parseInt(r[1])+"-"+ Integer.parseInt(r[2])+"\t"+ r[5].charAt(0);
            if(!hm.containsKey(dr)){
                hm.put(dr, new ArrayList<Double>());
View Full Code Here

        init();
    }
   
   
protected void init() throws Exception{
    tfb = new ReadTable(f).getHashMap(0, 1);
}
View Full Code Here

   
    for(int i=0; i<fs.length ; i++){
        File f= fs[i];
        String cn= FileName.getBaseName(f);
        tab.appendEmptyColumn(cn);
        ReadTable rt= new ReadTable(f);
        String[] rns= rt.getColumn(3);
        String[] vs= rt.getColumn(4);
        for(int j=0; j<rns.length ; j++){
            String rn= rns[j];
            String v= vs[j];
            if(!tab.containsRow(rn)){
                tab.appendEmptyRow(rn);
View Full Code Here

   
    File d= new File("E:\\muxingu\\mystudy\\phd\\progs\\PhdProject\\plot");
   
    //cc.printOutput(new ReadTable(new File(d+"/xxx_cz5.txt")).getTable().getColumn(0));
    //cc.printOutput(new ReadTable(new File(d+"/xxx_cnz5.txt")).getTable().getColumn(0));
    cc.printOutput(new ReadTable(bed).getTable().getColumn(3));
   
   
    cc= new SeqComposition(new File(dir+"/anno/bed/sacCer1-xu/sacCer1-xu_gene_cds_300.300.bed"));
    cc.printOutput(new ReadTable(bed).getTable().getColumn(3));
}
View Full Code Here

    for( int i=0; i<fs.length; i++ ){
        File f= fs[i];
        if(f.isFile()){
            IDMapperAffy map = new IDMapperAffy(anno);

            ReadTable rt= new ReadTable(f);
            rt.param().setSkipRows(0);
            HashMap<String, String> hm= rt.getHashMap(0, 1);
            HashMap<String, Double> idv= new HashMap();
            Iterator<String> it= hm.keySet().iterator();
            while(it.hasNext()){
                String id= it.next();
                idv.put(id, Double.parseDouble(hm.get(id)));
View Full Code Here

   
public static void main(String[] args) throws Exception { //debug
    File d= new File("G:\\mystudy\\phd\\files\\anno\\bed\\sacCer1-xu\\200\\out");
   
   
    String[][] arr= new ReadTable(new File(d+"/score_sacCer1-xu_gene_cds_200.200.bed")).getTableAsArray();
    String[] v5s= new ReadTable(new File(d+"/score_sacCer1-xu_gene_five_200.200.bed")).getColumn(4);
    String[] v3s= new ReadTable(new File(d+"/score_sacCer1-xu_gene_three_200.200.bed")).getColumn(4);
    String[] vcds= new ReadTable(new File(d+"/score_sacCer1-xu_gene_cds_200.200.bed")).getColumn(4);
    String[] vis= new ReadTable(new File(d+"/score_sacCer1-xu_intergenic_200.bed")).getColumn(4);
   
   
   
    File out= new File(d+"/clas.bed");
    BufferedWriter bw= new BufferedWriter(new FileWriter(out));
View Full Code Here

TOP

Related Classes of fork.lib.base.file.io.txt.ReadTable

Copyright © 2018 www.massapicom. 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.