Package fork.lib.bio.anno.genomic

Examples of fork.lib.bio.anno.genomic.LandscapeComparatorBuffer


public static void toDiff(File f, File ref, File out) throws Exception{
    LandscapeBuffer lb= new BedGraphBuffer(f);
    LandscapeBuffer lbref= new BedGraphBuffer(ref);

    LandscapeComparatorBuffer lc = new LandscapeComparatorBuffer(lb, lbref) {
            @Override
            public double newValue(double v, double refv) {
                return new Double( (double)Math.round( (v- refv) * 1000)/1000  );
            }
        };
    String tag= FileName.getBaseName(f);
    lc.writeToFile(out, "diff"+tag);
}
View Full Code Here


   
   
public void writeToFile(File out)throws Exception{
    out.getParentFile().mkdirs();
    LandscapeBuffer lb= new BedGraphBuffer(f);
    LandscapeComparatorBuffer lc = new LandscapeComparatorBuffer(lb, lbref) {
            @Override
            public double newValue(double v, double refv) {
                if(refv<0.01){
                    refv=0.01;
                }
                return new Double( (double)Math.round(v/refv * 1000)/1000  );
            }
        };
    String tag= FileName.getBaseName(f)+"_lee2007";
    System.out.println("write ratio to: "+out);
    lc.writeToFile(out, "ratio_"+tag);
}
View Full Code Here

}


public static void subtract( LandscapeBuffer lbf, LandscapeBuffer lbfref,
        File f, String tit, final double depthFactor) throws Exception{
    LandscapeComparatorBuffer lc= new LandscapeComparatorBuffer(lbf, lbfref) {
            @Override
            public double newValue(double v, double refv) {
                double ret= (double)Math.round( (v- refv*depthFactor) *100)/100;
                if(ret<0){
                    ret=0;
                }
                return ret;
            }
        };
    lc.writeToFile(f, tit);
}
View Full Code Here

public static void toRatio(File f, File ref, File out) throws Exception{
    LandscapeBuffer lb= new BedGraphBuffer(f);
    LandscapeBuffer lbref= new BedGraphBuffer(ref);

    LandscapeComparatorBuffer lc = new LandscapeComparatorBuffer(lb, lbref) {
            @Override
            public double newValue(double v, double refv) {
                return new Double( (double)Math.round(v/refv * 1000)/1000  );
            }
        };
    String tag= FileName.getBaseName(f);
    System.out.println("write ratio to: "+out);
    lc.writeToFile(out, "ratio"+tag);
}
View Full Code Here

TOP

Related Classes of fork.lib.bio.anno.genomic.LandscapeComparatorBuffer

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.