/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package data.human.inhouse.chippeak.ap;
import data.human.inhouse.chippeak.ScoreMergeChipNorm;
import fork.lib.base.file.FileName;
import fork.lib.base.file.management.Dirs;
import fork.lib.bio.anno.genomic.BedGraphReader;
import fork.lib.bio.anno.genomic.BedReader;
import fork.lib.bio.anno.genomic.LandscapeBuilder;
import fork.lib.bio.anno.genomic.region.GenomicRegionsBuilder;
import java.io.File;
/**
*
* @author man-mqbpjmg4
*/
public class test {
public static void main(String[] args) throws Exception { //debug
File dir= Dirs.getFile("dir");
File cd= new File(dir+"\\data\\human_magnus\\h2az\\norm");
File d= new File(dir+"/data\\human_magnus\\h2az/macs/");
File od= new File(d+"/scoreNorm");
File rf= new File(d+"/mcf7_chip-h2az_time-0_peaks.bed");
GenomicRegionsBuilder gb= new BedReader(rf).getGenomicRegionsBuilder();
File[] fs= cd.listFiles();
for( int i=0; i<fs.length; i++ ){
File f= fs[i];
System.out.println(f);
if(FileName.getExt(f).equals("wig")){
LandscapeBuilder lb= new BedGraphReader(f).getLandscapeBuilder();
File out= new File(od+"/chip_"+FileName.getBaseName(f)+".bed");
ScoreMergeChipNorm ss= new ScoreMergeChipNorm(gb, lb);
ss.writeToFile(out);
}
}
}
}