From f941b0da1826d8c1d95c00a5ffad878c9215a25d Mon Sep 17 00:00:00 2001 From: Jose Manuel Duarte Date: Mon, 5 Dec 2016 15:16:30 -0800 Subject: [PATCH] Temporary fix for 3.0 release, skip invalid assemblies, see #102 --- .../gui/panels/AssemblyResultsGridPanel.java | 97 ++++++++++--------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/eppic-wui/src/main/java/ch/systemsx/sybit/crkwebui/client/results/gui/panels/AssemblyResultsGridPanel.java b/eppic-wui/src/main/java/ch/systemsx/sybit/crkwebui/client/results/gui/panels/AssemblyResultsGridPanel.java index 07abdebdf..85ee68b0f 100644 --- a/eppic-wui/src/main/java/ch/systemsx/sybit/crkwebui/client/results/gui/panels/AssemblyResultsGridPanel.java +++ b/eppic-wui/src/main/java/ch/systemsx/sybit/crkwebui/client/results/gui/panels/AssemblyResultsGridPanel.java @@ -228,6 +228,7 @@ private ColumnConfig getIdentifierColumn() { return identifierColumn; } + @SuppressWarnings("unused") private ColumnConfig getCompositionColumn() { ColumnConfig compositionColumn = new ColumnConfig(props.composition()); @@ -400,52 +401,54 @@ public void fillResultsGrid(PdbInfo resultsData) { for(Assembly assembly : assemblies) { - - AssemblyItemModel model = new AssemblyItemModel(); - model.setAssemblyId(assembly.getId()); //not actually visible - model.setIdentifier(assembly.getIdentifierString()); - model.setPdbCode(resultsData.getPdbCode()); - - String thumbnailUrl = - ApplicationContext.getSettings().getResultsLocationForJob(ApplicationContext.getPdbInfo().getJobId()) + - "/" + ApplicationContext.getPdbInfo().getTruncatedInputName() + - EppicParams.ASSEMBLIES_COORD_FILES_SUFFIX + - "." + assembly.getId() + ".75x75.png"; - if(ApplicationContext.getPdbInfo().getJobId().length() == 4) - thumbnailUrl = - ApplicationContext.getSettings().getResultsLocationForJob(ApplicationContext.getPdbInfo().getJobId().toLowerCase()) + - "/" + ApplicationContext.getPdbInfo().getTruncatedInputName() + - EppicParams.ASSEMBLIES_COORD_FILES_SUFFIX + - "." + assembly.getId() + ".75x75.png"; - model.setThumbnailUrl(thumbnailUrl); - - String diagramUrl = - ApplicationContext.getSettings().getResultsLocationForJob(ApplicationContext.getPdbInfo().getJobId().toLowerCase()) + - "/" + ApplicationContext.getPdbInfo().getTruncatedInputName() + - EppicParams.ASSEMBLIES_DIAGRAM_FILES_SUFFIX + - "." + assembly.getId() + ".75x75.png"; - model.setDiagramUrl(diagramUrl); - - model.setMmSize(assembly.getMmSizeString()); - //testing only - /*String stio = assembly.getStoichiometryString(); + // issue #102: as a temporary fix for 3.0, we'll simply skip the invalid assemblies (which can only come from PDB annotation, not from EPPIC) + if (!assembly.isTopologicallyValid()) continue; + + AssemblyItemModel model = new AssemblyItemModel(); + model.setAssemblyId(assembly.getId()); //not actually visible + model.setIdentifier(assembly.getIdentifierString()); + model.setPdbCode(resultsData.getPdbCode()); + + String thumbnailUrl = + ApplicationContext.getSettings().getResultsLocationForJob(ApplicationContext.getPdbInfo().getJobId()) + + "/" + ApplicationContext.getPdbInfo().getTruncatedInputName() + + EppicParams.ASSEMBLIES_COORD_FILES_SUFFIX + + "." + assembly.getId() + ".75x75.png"; + if(ApplicationContext.getPdbInfo().getJobId().length() == 4) + thumbnailUrl = + ApplicationContext.getSettings().getResultsLocationForJob(ApplicationContext.getPdbInfo().getJobId().toLowerCase()) + + "/" + ApplicationContext.getPdbInfo().getTruncatedInputName() + + EppicParams.ASSEMBLIES_COORD_FILES_SUFFIX + + "." + assembly.getId() + ".75x75.png"; + model.setThumbnailUrl(thumbnailUrl); + + String diagramUrl = + ApplicationContext.getSettings().getResultsLocationForJob(ApplicationContext.getPdbInfo().getJobId().toLowerCase()) + + "/" + ApplicationContext.getPdbInfo().getTruncatedInputName() + + EppicParams.ASSEMBLIES_DIAGRAM_FILES_SUFFIX + + "." + assembly.getId() + ".75x75.png"; + model.setDiagramUrl(diagramUrl); + + model.setMmSize(assembly.getMmSizeString()); + //testing only + /*String stio = assembly.getStoichiometryString(); if (stio.indexOf("2") != -1) stio = "A(2)"; model.setStoichiometry(stio);*/ - model.setStoichiometry(assembly.getStoichiometryString()); - model.setSymmetry(assembly.getSymmetryString()); - model.setComposition(assembly.getCompositionString()); - model.setPrediction(assembly.getPredictionString()); - //model.setNumInterfaces(assembly.getInterfaces().size()+""); - if(assembly.getInterfaces().size() == 0) - model.setNumInterfaces("0 Interfaces"); - else if(assembly.getInterfaces().size() == 1) - //model.setNumInterfaces("" + assembly.getInterfaces().size() + " Interface"); - model.setNumInterfaces(""+ assembly.getInterfaces().size() + " Interface"); - else - model.setNumInterfaces(""+ assembly.getInterfaces().size() + " Interfaces"); - - data.add(model); + model.setStoichiometry(assembly.getStoichiometryString()); + model.setSymmetry(assembly.getSymmetryString()); + model.setComposition(assembly.getCompositionString()); + model.setPrediction(assembly.getPredictionString()); + //model.setNumInterfaces(assembly.getInterfaces().size()+""); + if(assembly.getInterfaces().size() == 0) + model.setNumInterfaces("0 Interfaces"); + else if(assembly.getInterfaces().size() == 1) + //model.setNumInterfaces("" + assembly.getInterfaces().size() + " Interface"); + model.setNumInterfaces(""+ assembly.getInterfaces().size() + " Interface"); + else + model.setNumInterfaces(""+ assembly.getInterfaces().size() + " Interfaces"); + + data.add(model); } } resultsStore.addAll(data); @@ -635,11 +638,11 @@ public void onSelectAssemblyResultsRow(SelectAssemblyResultsRowEvent event) { newResultsData.setInterfaceClusters(interfaceClusters); EventBusManager.EVENT_BUS.fireEvent(new ShowInterfacesOfAssemblyDataEvent(newResultsData)); History.newItem("interfaces/" + pdbCode + "/" + assemblyID); - ResultsPanel.headerPanel.pdbIdentifierPanel.informationLabel.setHTML(EscapedStringGenerator.generateEscapedString( + PDBIdentifierPanel.informationLabel.setHTML(EscapedStringGenerator.generateEscapedString( AppPropertiesManager.CONSTANTS.info_panel_interface_pdb_identifier() + ": ")); - ResultsPanel.headerPanel.pdbIdentifierPanel.pdbNameLabel.setHTML("Assembly " + assemblyID + " in ");// + pdbCode); - ResultsPanel.headerPanel.pdbIdentifierPanel.pdbNameLabel.setHTML(""+pdbCode+""); - ResultsPanel.informationPanel.assemblyInfoPanel.setHeadingHtml("General Information"); + PDBIdentifierPanel.pdbNameLabel.setHTML("Assembly " + assemblyID + " in ");// + pdbCode); + PDBIdentifierPanel.pdbNameLabel.setHTML(""+pdbCode+""); + InformationPanel.assemblyInfoPanel.setHeadingHtml("General Information"); } });