/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package data.human.inhouse.cuff;
import fork.lib.base.file.management.Dirs;
import fork.lib.bio.anno.genomic.BedExporter;
import fork.lib.bio.anno.genomic.BedReader;
import fork.lib.bio.anno.genomic.region.GenomicRegion;
import fork.lib.bio.anno.genomic.region.GenomicRegionsBuilder;
import fork.lib.bio.anno.genomic.region.GenomicRegionsComparator;
import fork.lib.bio.anno.genomic.region.GenomicRegionsModifier;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
/**
*
* @author muxin gu
*/
public class RefineNovel {
public static void main(String[] args) throws Exception { //debug
File dir= Dirs.getFile("dir");
int side= 5000;
File d= new File(dir+"/data/human_magnus/rna/cuff/time-5");
File f= new File(d+"/novel_genes.fpkm_tracking.bed");
File of= new File(d+"/refine-"+ side+"_"+ f.getName() );
GenomicRegionsBuilder gb= new BedReader(f).getGenomicRegionsBuilder();
GenomicRegionsBuilder gbref= new BedReader(new File(dir+"/anno/hg19_ensGene_exon.bed")).getGenomicRegionsBuilder();
GenomicRegionsBuilder gbrefs= new GenomicRegionsModifier(gbref).getExtendedRegions(side, side);
GenomicRegionsComparator gc= new GenomicRegionsComparator(gb, gbrefs);
new BedExporter( gc.getNonIntersection() ).writeToFile(of);
}
}