System.err.println("You have to specify input data with --gce and --se, --htgce, or --list");
System.exit(-1);
}
VennArrangementsOptimizer vennArrsOptim = new VennArrangementsOptimizer();
vennArrsOptim.setParameters(params);
VennPanel venn = new VennPanel(vennArrsOptim);
venn.setParameters(params);
final IVennDataModel model = loadFiles.getSourceDataModel();
if (filter == null && (loadFiles.getSourceType() == LoadFiles.SourceType.GO
|| loadFiles.getSourceType() == LoadFiles.SourceType.HTGO)) {
filter = new GODistanceFilter( goTree );
// set filterBy to default
if (model != null) {
assert model instanceof GeneOntologyReaderModel || model instanceof HTGeneOntologyReaderModel;
final GODistanceFilter distanceFilter = (GODistanceFilter) filter;
if (model.getNumGroups() > 0) {
distanceFilter.getParameters().filterBy =
((AbstractGOCategoryProperties) model.getGroupProperties(0)).getFilterBy();
}
}
}
checkModelAndFilterCompatibility(model, filter);
venn.setDataModel(filter == null ? model : new VennFilteredDataModel(model, filter));
vennArrsOptim.clearObservers();
if( simFile.value != null )
{
try {
Writer writer = new FileWriter(simFile.value);
vennArrsOptim.addObserver( new OptimizerObserver(writer) );
}
catch (IOException e)
{
e.printStackTrace();
System.err.println("I/O error while opening file "+simFile.value);
System.exit(-1);
}
}
if( optStateFile.value != null )
{
try {
Writer writer = new FileWriter(optStateFile.value);
vennArrsOptim.addObserver( new StateObserver(writer) );
}
catch (IOException e)
{
e.printStackTrace();
System.err.println("I/O error while opening file "+optStateFile.value);
System.exit(-1);
}
}
// START SIMULATION
vennArrsOptim.optimize();
// wait until simulation stopped
vennArrsOptim.getWorker().waitForOff();
// stop reporter
vennArrsOptim.clearObservers();
// EXPORT PROFILE
if( profFile.value != null )
{
try {
FileWriter fs = new FileWriter(profFile.value);
venn.writeProfile(fs);
fs.close();
}
catch (IOException e)
{
e.printStackTrace();
System.err.println("I/O error while exporting profile.");
System.exit(-1);
}
}
// WRITE SVG
if( svgFile.value != null )
{
try {
FileOutputStream fs = new FileOutputStream(svgFile.value);
venn.writeSVGFile(fs,400,400);
fs.close();
}
catch (FileNotFoundException e)
{
e.printStackTrace();