Package fork.lib.bio.anno.genomic.region

Examples of fork.lib.bio.anno.genomic.region.DirectionalGenomicRegion


    GenomicRegionsBuilder gb= new GenomicRegionsBuilder();
    ReadTable rt= new ReadTable(f);
    Table<String> tab= rt.getTable();
    for( int i=0; i<tab.getRowNumber(); i++ ){
        ArrayList<String> r= tab.getRow(i);
        DirectionalGenomicRegion gr= new DirectionalGenomicRegion(
                r.get(0),
                '+',
                Integer.parseInt(r.get(1)),
                Integer.parseInt(r.get(2))
        );
        gr.setValue(Double.parseDouble(r.get(3)));
        gb.add(gr);
    }
    gb.sortAll();
   
    SplicedRegionsLocator sl= new SplicedRegionsLocator(gb, new SplicedBedReader(anno));
View Full Code Here


        String chr= ssf[0];
        int low= Integer.parseInt(ssf[1]);
        int high= Integer.parseInt(ssf[2]);
        String id= ssf[3];
        if(!(vf==0 && vr==0)){
            DirectionalGenomicRegion dr;
            if(vf>vr){
                dr= new DirectionalGenomicRegion(chr, '+', low, high);
                dr.setValue(vf);
            }else{
                dr= new DirectionalGenomicRegion(chr, '-', low, high);
                dr.setValue(vr);
            }
            dr.setID(id);
            gbout.add(dr);
        }
    }
    brf.close();
    brr.close();
View Full Code Here

    GenomicRegionsModifier gm= new GenomicRegionsModifier(gb);
    gb= gm.getGenicRegions(side, side);
   
    Iterator<GenomicRegion> it= gb.iterator();
    while(it.hasNext()){
        DirectionalGenomicRegion gr= (DirectionalGenomicRegion)it.next();
        int i=0;
        double low= gr.low;
        while( (low+len)<gr.high ){
            DirectionalGenomicRegion grout= new DirectionalGenomicRegion(gr.chr, gr.strand, (int)low, (int)low+len);
            grout.setID(gr.getID()+"_"+i );
            gbout.add(grout);
            low+=len;
            i++;
        }
    }
View Full Code Here

        String[] r= arr[i];
        r[6]= r[6].replaceAll(" ", "");
        String id= r[6].split(",")[0];
        String type= r[5];
        if(!allids.contains(id)){
            DirectionalGenomicRegion reg= new DirectionalGenomicRegion(
                    "chr"+r[1], r[2].charAt(0), Integer.parseInt(r[3]), Integer.parseInt(r[4])
                    );
            reg.attr= id;
            if(!hm.containsKey(type)){
                hm.put(type, new GenomicRegionsBuilder());
View Full Code Here

        }
    };
    ArrayList<LandscapeScoringResultEntry> ress= ls.getResultEntries();
    for( int i=0; i<ress.size() ; i++ ){
        LandscapeScoringResultEntry res= ress.get(i);
        DirectionalGenomicRegion gr= (DirectionalGenomicRegion)res.gr;
        double[] vs= res.scores;
        int slow= gr.isOnForwardStrand() ? side5: side3,
                shigh= gr.isOnForwardStrand() ? side3 : side5;
        if(vs.length >  (slow+shigh)){
            int left= slow;
            while( true ){
                if(left>= (vs.length-shigh)){
                    break;
                }
                int right= (left+intv)<vs.length ? left+intv : vs.length-1;
                double area= 0;
                for( int k=left; k<=right ; k++ ){
                    area+= vs[k];
                }
                double na= area/ (right-left+1);
                if(na> thr){
                    DirectionalGenomicRegion grr= new DirectionalGenomicRegion(
                            gr.chr, gr.strand, (int)gr.low+left, (int)gr.low+right);
                    grr.attr= gr.attr;
                   
                    gbout.add(grr);
                    totarea+= area;
View Full Code Here

TOP

Related Classes of fork.lib.bio.anno.genomic.region.DirectionalGenomicRegion

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.