}
// LOAD DATA
final LoadFiles loadFiles = new LoadFiles();
final GoTree goTree = loadFiles.loadGoDB();
IDataFilter filter = null;
boolean flag = false;
try
{
// LIST FILE IMPORT
if( listFile.value != null )
{
if( gceFile.value != null || seFile.value != null || htGceFile.value != null )
{
System.err.println("Error: --list option excludes the use of --gce, --se, and --htgce");
System.exit(-1);
}
if( filterFile.value != null )
{
System.err.println("Error: --filter cannot be used with --list");
System.exit(-1);
}
loadFiles.loadFromListFile(listFile.value);
flag = true;
}
// load filter
if( filterFile.value != null )
{
filter = (IDataFilter)SystemUtility.readXMLObject(new File(filterFile.value));
if( filter == null )
{
System.err.println("Error while loading gene filter from file "+filterFile.value);
System.exit(-1);
}
if( filter instanceof GODistanceFilter )
{
((GODistanceFilter)filter).setGoTree( goTree );
}
}
// write filter
if( outFilterFile.value != null )
{ // write gene filter to xml file
final IDataFilter outFilter;
if (filter != null) {
outFilter = filter;
} else {
outFilter = new GODistanceFilter(goTree);
}
if( ! SystemUtility.writeXMLObject(outFilter, new File(outFilterFile.value)) )
System.err.println("Warning: cannot write output filter file "+outFilterFile.value);
}
// HIGH-THROUGHPUT GOMINER FILE IMPORT
if( !flag && (htGceFile.value != null) )
{
if( gceFile.value != null || seFile.value != null )
{
System.err.println("Error: --htgce option excludes the use of --gce and --se");
System.exit(-1);
}
loadFiles.loadHTGOMiner(htGceFile.value);
flag = true;
}
// GOMINER FILE IMPORT
if (! flag && (gceFile.value != null && seFile.value == null)) {
System.err.println("Error: --gce can only be used in combination with --se");
System.exit(-1);
}
if (! flag && (gceFile.value == null && seFile.value != null)) {
System.err.println("Error: --se can only be used in combination with --gce");
System.exit(-1);
}
if( !flag && (gceFile.value != null) && (seFile.value != null) )
{
loadFiles.loadGOMiner(seFile.value,gceFile.value);
flag = true;
}
}
catch(IOException ex)
{
ex.printStackTrace();
System.err.println("I/O error while importing data set.");
System.exit(-1);
}
checkModelAndFilterCompatibility(loadFiles.getSourceDataModel(), filter);
// check if GUI should be started
if (profFile.value == null && svgFile.value == null
&& outConfigFile.value == null && simFile.value == null
&& optStateFile.value == null && outFilterFile.value == null) {
// start graphical interface
final IDataFilter finalFilter = filter;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Gui(
goTree,
params,