From: Mark G. <mg...@us...> - 2004-04-01 17:26:51
|
Update of /cvsroot/gmod/apollo/src/java/apollo/dataadapter/gamexml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27262/src/java/apollo/dataadapter/gamexml Modified Files: GAMEAdapter.java Log Message: So i tried to fix the bug where ya cant switch result to opposite strand if no feats of that type exist on that strand. This turned out to be much more complicated than i thought it would be, so its not fixed, but i did make a lot of progress and thats what im commiting. Where it fell short is that the AnnotationEditor has to send out a new kind of ResultChangeEvent that would prompt the view/tier manager to create a new tier. I dont think this functionality is there. At some point this needs to be revisited and that functionality needs to be added to ResultView.handleResultChangeEvent with a new event type like ADD_TIER or something like that. Sorry to leave this undone, but theres just higher priority stuff at the moment. If a user hits this bug they get a popup telling them to email us (i think a popup is warranted here) - in theory this will be a rare event, but we should hear otherwise if its not. Index: GAMEAdapter.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/dataadapter/gamexml/GAMEAdapter.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** GAMEAdapter.java 31 Mar 2004 15:15:21 -0000 1.57 --- GAMEAdapter.java 1 Apr 2004 17:14:12 -0000 1.58 *************** *** 1140,1143 **** --- 1140,1157 ---- } + + /** Parses Transactions from XML */ + private void loadTransactions() { + // System.out.println("loadChangedGenesList: NOT loading any old-fashioned transactions from XML."); + Vector elements = game_element.getChildren(); + + for (int i = 0; i < elements.size(); i++) { + XMLElement element = (XMLElement) elements.elementAt(i); + if (element.getType().equals ("transaction")) { + recordTransaction(element); + } + } + } + /** Loop through children of game_element. For those kids of type "computation_analysis" create FeatureSets for each strand and add them to *************** *** 1162,1219 **** } - - // Parses Transactions from XML - private void loadTransactions() { - // System.out.println("loadChangedGenesList: NOT loading any old-fashioned transactions from XML."); - Vector elements = game_element.getChildren(); - - for (int i = 0; i < elements.size(); i++) { - XMLElement element = (XMLElement) elements.elementAt(i); - if (element.getType().equals ("transaction")) { - recordTransaction(element); - } - } - } - - /** Creates a new FeatureSet for the analysis on strand. If an analysis with prog,db, - and strand has already been created, the existing one is returned. If new a - FeatureSet is created, added to all_analyses hash, added to analyses, and returned. */ - private FeatureSetI initAnalysis (StrandedFeatureSetI analyses, - int strand, - String prog, - String db, - String analysis_id, - String type, - String date, - String version, - Hashtable all_analyses) { - String analysis_type = prog + ":" + db; - String analysis_name = (analysis_type + - (strand == 1 ? "-plus" : - (strand == -1 ? "-minus" : ""))); - - FeatureSetI analysis = (FeatureSetI) all_analyses.get(analysis_name); - if (analysis == null) { - analysis = new FeatureSet(); - analysis.setId (analysis_id); - analysis.setProgramName(prog); - analysis.setDatabase(db); - analysis.setType (analysis_type); - analysis.setName (analysis_name); - analysis.setStrand (strand); - // analysis.setHolder (true); - if (type != null) - analysis.setBioType (type); - if (date != null) - analysis.addProperty ("date", date); - if (version != null) - analysis.addProperty ("version", version); - // Change - analysis added later on, but only if it has features - //all_analyses.put (analysis_name, analysis); - //analyses.addFeature(analysis); - } - return analysis; - } - /** Create forward and reverse strand feature sets for analysis of analysis element, which are added to analyses. Add all sub features to the appropriate stranded --- 1176,1179 ---- *************** *** 1309,1314 **** // opposite strand if (fwd && rev) { ! forward_analysis.setAnalogousOppositeStrandFeatureSet(reverse_analysis); ! reverse_analysis.setAnalogousOppositeStrandFeatureSet(forward_analysis); } } --- 1269,1274 ---- // opposite strand if (fwd && rev) { ! forward_analysis.setAnalogousOppositeStrandFeature(reverse_analysis); ! reverse_analysis.setAnalogousOppositeStrandFeature(forward_analysis); } } *************** *** 1331,1334 **** --- 1291,1335 ---- } + /** Creates a new FeatureSet for the analysis on strand. If an analysis with prog,db, + and strand has already been created, the existing one is returned. If new a + FeatureSet is created, added to all_analyses hash, added to analyses, and returned. */ + private FeatureSetI initAnalysis (StrandedFeatureSetI analyses, + int strand, + String prog, + String db, + String analysis_id, + String type, + String date, + String version, + Hashtable all_analyses) { + String analysis_type = prog + ":" + db; + String analysis_name = (analysis_type + + (strand == 1 ? "-plus" : + (strand == -1 ? "-minus" : ""))); + + FeatureSetI analysis = (FeatureSetI) all_analyses.get(analysis_name); + if (analysis == null) { + analysis = new FeatureSet(); + analysis.setId (analysis_id); + analysis.setProgramName(prog); + analysis.setDatabase(db); + analysis.setType (analysis_type); + analysis.setName (analysis_name); + analysis.setStrand (strand); + // analysis.setHolder (true); + if (type != null) + analysis.setBioType (type); + if (date != null) + analysis.addProperty ("date", date); + if (version != null) + analysis.addProperty ("version", version); + // Change - analysis added later on, but only if it has features + //all_analyses.put (analysis_name, analysis); + //analyses.addFeature(analysis); + } + return analysis; + } + + private FeatureSetI getResult(XMLElement result_element, String analysis_type, |