}
}
private void GFFToBed(String ifile, String ofile) throws FileNotFoundException{
IGVBEDCodec outCodec = new IGVBEDCodec();
GFFParser parser = new GFFParser();
GFFCodec codec = null;
try {
codec = (GFFCodec) CodecFactory.getCodec(ifile, null);
} catch (Exception e) {
throw new IllegalArgumentException("Input file is not recognized as a GFF");
}
BufferedReader reader = null;
PrintStream outStream = System.out;
if(!ofile.equals(STDOUT_FILE_STR)){
outStream = new PrintStream(new FileOutputStream(ofile));
}
try {
reader = ParsingUtils.openBufferedReader(ifile);
List<Feature> features = parser.loadFeatures(reader, null, codec);
for (Feature feat : features) {
String encoded = outCodec.encode(feat);
outStream.print(encoded);
outStream.print('\n');
}