// we have gff file -> convert it to BED
String bedFile = workDir + "/file.bed";
PrintWriter outWriter = new PrintWriter( new FileWriter(bedFile) );
GffReader gffReader = new GffReader(cfg.pathToRegions);
Gff region;
int numLines = 0;
while((region = gffReader.read())!=null){
StringBuilder buf = new StringBuilder();
buf.append(region.getSequenceName()).append("\t");
buf.append(region.getStart()).append("\t");
buf.append(region.getEnd()).append("\t");
buf.append(region.getFeature()).append("\t");
buf.append(region.getScore()).append("\t");
buf.append(region.getStrand()).append("\n");
outWriter.print(buf.toString());
numLines++;
}
outWriter.close();