Examples of LandscapeScoring


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

    }
   
   
   
public void writeToFile(File out)throws Exception {
    LandscapeScoring ls= new LandscapeScoring(lb, gb){
            protected double[] score(ArrayList<Region> bufs, GenomicRegion gr) throws RegionException{
                return new double[]{Landscape2DBuffer.getArea(bufs, gr) / (gr.getRange()+1/1000) };
            }
        };
    ls.writeToBedFile(out);
}
View Full Code Here

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

    }
   
   
   
public void writeToFile(File out)throws Exception {
    LandscapeScoring ls= new LandscapeScoring(lb, gb){
            protected double[] score(ArrayList<Region> bufs, GenomicRegion gr) throws RegionException{
                return new double[]{Landscape2DBuffer.getArea(bufs, gr) / (gr.getRange()+1)*1000 };
            }
        };
    ls.writeToBedFile(out);
}
View Full Code Here

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

    double zthr= 80;
    File dir= Dirs.getFile("dir");
   
   
    GenomicRegionsBuilder gbl= new BedReader(new File(dir+"/anno/bed/len/len_150_off_0.bed")).getGenomicRegionsBuilder();
    ArrayList<LandscapeScoringResultEntry> rsz= new LandscapeScoring(
            new BedGraphReader(new File(dir+"/data/chip-seq/norm/norm_wig_chip_742-wt_r1_sacCer1.wig")).getLandscapeBuilder(),
            gbl
            ).getResultEntries();
   
    LandscapeBuilder lbs= new BedGraphReader(new File(dir+"/other_datasets/venters_2009/Swr1_MAT01.bar.wig")).getLandscapeBuilder();
    ArrayList<LandscapeScoringResultEntry> rss= new LandscapeScoring(
            lbs, gbl
            ){
            protected double[] score(ArrayList<Region> bufs, GenomicRegion gr) throws RegionException{
                double max= 0;
                for(int i=0; i<bufs.size() ; i++){
View Full Code Here

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

    od.mkdirs();
    File[] fs= ScoreChipGene.files("sacCer1-xu");
    for(int i=0; i<fs.length ; i++){
        File f=fs[i];
        System.out.println(f);
        ls= new LandscapeScoring(lb, new BedReader(f).getGenomicRegionsBuilder()){
            protected double[] score(ArrayList<Region> bufs, GenomicRegion gr) throws RegionException{
                return new double[]{Landscape2DBuffer.getArea(bufs, gr)};
            }
        };
        File out= new File(od+"/"+FileName.getBaseName(f)+".bed");
View Full Code Here

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

    od.mkdirs();
    File[] fs= ScoreChipGene.files(org);
    for(int i=0; i<fs.length ; i++){
        File f=fs[i];
        System.out.println(f);
        ls= new LandscapeScoring(lb, new BedReader(f).getGenomicRegionsBuilder()){
            protected double[] score(ArrayList<Region> bufs, GenomicRegion gr) throws RegionException{
                double max= 0;
                for(int i=0; i<bufs.size() ; i++){
                    double v= (Double) bufs.get(i).attribute();
                    if(v>max){
View Full Code Here

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

    File winf= new File(dir+"/anno/bed/sacCer1/window/non-ol_10_sacCer1_chr.bed");
   
    GenomicRegionsBuilder gb= new BedReader(winf).getGenomicRegionsBuilder();
    LandscapeBuilder lb= new BedGraphReader(f).getLandscapeBuilder();
   
    new LandscapeScoring(lb, gb).writeToBedFile(new File(od+"/score_"+winf.getName()));
   
}
View Full Code Here

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

        init();
    }
   
   
protected void init() throws Exception{
    LandscapeScoring ls = getScoring();
   
    ArrayList<LandscapeScoringResultEntry> res= ls.getResultEntries();
    vec= new Vector(new double[res.get(0).scores.length]);
    for( int i=0; i<res.size(); i++ ){
        LandscapeScoringResultEntry en= res.get(i);
        /*
        bw.write( ((BedAttribute)en.gr.attribute()).getFieldA() );
View Full Code Here

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

    }
    vec= vec.multiplyScalar((double)1/res.size());
}

protected LandscapeScoring getScoring() throws Exception{
    return new LandscapeScoring(lb, gb){
        protected double[] score(ArrayList<Region> bufs, GenomicRegion gr) throws RegionException{
            double[] ret= new double[(int)gr.getRange()+1];
            int ind=0;
            for( int i=(int)gr.low; i<=(int)gr.high; i++ ){
                int ir= i-(int)gr.low;
View Full Code Here

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

        if(rat>2 && d>7){
            gb.add(gr);
        }
    }
   
    LandscapeScoring ls= new LandscapeScoring(lb, gb){
        protected double[] score(ArrayList<Region> bufs, GenomicRegion gr) throws RegionException{
            return new double[]{Landscape2DBuffer.getArea(bufs, gr)};
        }
    };
    double sum= LandscapeScoringResultEntry.toDistribution(ls.getResultEntries(), 0).sum();
   
    System.out.println(gb.size());
    System.out.println(sum);
}
View Full Code Here

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

        init();
    }


protected void init() throws Exception{
    ls= new LandscapeScoring(lbf, gb){
        protected double[] score(ArrayList<Region> bufs, GenomicRegion gr) throws RegionException{
            //return new double[]{Landscape2DBuffer.getArea(bufs, gr)/ rl/ (gr.getRange()-1) * 1000};
            return new double[]{Landscape2DBuffer.getArea(bufs, gr) / rl};
        }
    };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.