Package fork.lib.bio.anno.genomic

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


}


public static void removeShortAndNorm(File outSub, File outNorm)throws Exception {
    LandscapeBuilder lb= new BedGraphReader(outSub).getLandscapeBuilder();
    LandscapeTransformer lt= new LandscapeTransformer(lb);
    lt.selectLength(300, Integer.MAX_VALUE);
    double sum= lb.totalArea();
    double fac= sum/Math.pow(10, 8);
    lt.divideBy( fac );
    new BedGraphExporter(lb).writeToFile(outNorm);
}
View Full Code Here


   
   
public void writeToDir(File od)throws Exception {
    double sum = lbf.totalArea()+ lbr.totalArea();
    double fac= sum/ Math.pow(10, 10);
    LandscapeTransformer ltf= new LandscapeTransformer(lbf);
    ltf.divideBy(fac);
    new BedGraphExporter(lbf).writeToFile(new File(od+"/norm_"+tag+"_for.wig"));
    LandscapeTransformer ltr= new LandscapeTransformer(lbr);
    ltr.divideBy(fac);
    new BedGraphExporter(lbr).writeToFile(new File(od+"/norm_"+tag+"_rev.wig"));
}
View Full Code Here

public static void main(String[] args) throws Exception { //debug
    File f= new File("r2.wig");
   
    LandscapeBuilder lb= new BedGraphReader(f).getLandscapeBuilder();
   
    LandscapeTransformer lt= new LandscapeTransformer(lb);
    lt.subtract(10);
   
   
    PeakIdentifier pi= new PeakIdentifier(lb, null);
    pi.getPeaks().writeToFileBed(new File("peak_"+FileName.getBaseName(f)+".bed"));
   
View Full Code Here

    //File f= new File(d+"/h3k4me3_guillemette2012.wig");
    File f= new File(d+"/h3k4ac_guillemette2011.wig");
   
    LandscapeBuilder lb= new BedGraphReader(f).getLandscapeBuilder();
   
    LandscapeTransformer lt= new LandscapeTransformer(lb);
    lt.unlog(2);
   
    File of= new File(d+"/unlog2_"+ f.getName());
    new BedGraphExporter(lb).writeToFile(of);
}
View Full Code Here

    for( int i=0; i<fs.length; i++ ){
        File f= fs[i];
        if(FileName.getExt(f).equals("wig") && !f.getName().contains("unlog")){
            LandscapeBuilder lb= new BedGraphReader(f).getLandscapeBuilder();

            LandscapeTransformer lt= new LandscapeTransformer(lb);
            lt.unlog();
           
            File of= new File(d+"/unlog_"+FileName.getBaseName(f)+".wig");
            new BedGraphExporter(lb).writeToFile(of);;
        }
    }
View Full Code Here


public static void normalise(LandscapeBuilder lb, File f, String tit) throws Exception{
    Distribution d= lb.getDistribution();
    double fac= (double)Math.ceil( d.median() * 1.75);
    new LandscapeTransformer(lb).subtract(fac);
    System.out.println("subfac: "+fac);
   
    Distribution dnz= lb.getDistributionNonZero();
    double nf= dnz.sum()/ 100000000;
    new LandscapeTransformer(lb).divideBy(nf);
    BedGraphExporter be= new BedGraphExporter(lb);
    be.param().tit= tit;
    be.writeToFile(f);
}
View Full Code Here



public void removeShort()throws Exception {
    LandscapeBuilder lb= new BedGraphReader(outSub2).getLandscapeBuilder();
    LandscapeTransformer lt= new LandscapeTransformer(lb);
    lt.selectLength(150, Integer.MAX_VALUE);
    double sum= lb.totalArea();
    double fac= sum/Math.pow(10, 8);
    lt.divideBy( fac );
    new BedGraphExporter(lb).writeToFile(out);
}
View Full Code Here

    String[] chrs= lb.getUnsortedChromosomeList();
    for( int i=0; i<chrs.length ; i++ ){
        String chr= chrs[i];
        LandscapeBuilder lbt= new LandscapeBuilder();
        lbt.addAll(chr, lb.getLandscape2DForChromosome(chr));
        new LandscapeTransformer(lbt).unlog(Math.E);
        BedGraphExporter be= new BedGraphExporter(lbt);
        be.appendToFile(bw);
    }
    bw.close();
}
View Full Code Here

    lc.writeToFile(f, tit);
}


public static void normalise(LandscapeBuilder lb, File of, String tit, double seqDepth) throws Exception{
    new LandscapeTransformer(lb).selectLength(100, Double.POSITIVE_INFINITY);
    new LandscapeTransformer(lb).divideBy( (seqDepth)/1000000 );
   
    BedGraphExporter be= new BedGraphExporter(lb){
        public void appendToFile(BufferedWriter bw) throws IOException{
            String[] chrs= lb.getChromosomeList();
            for( int j=0; j<chrs.length ; j++ ){
View Full Code Here

    File f= new File(d+"/analyzed_data_complete_bw20.bar");
   
    BarReader br= new BarReader(f);
    LandscapeBuilder lb= br.getLandscapeBuilder();
   
    new LandscapeTransformer(lb).unlog();
   
    new BarExporter(lb, br.header()).writeToFile(new File(d+"/unlog_"+f.getName()));
   
   
   
View Full Code Here

TOP

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

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.