Skip to content

Commit

Permalink
Temporary fix for 3.0 release, skip invalid assemblies, see #102
Browse files Browse the repository at this point in the history
  • Loading branch information
josemduarte committed Dec 5, 2016
1 parent 7705fa6 commit f941b0d
Showing 1 changed file with 50 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ private ColumnConfig<AssemblyItemModel, String> getIdentifierColumn() {
return identifierColumn;
}

@SuppressWarnings("unused")
private ColumnConfig<AssemblyItemModel, String> getCompositionColumn() {
ColumnConfig<AssemblyItemModel, String> compositionColumn =
new ColumnConfig<AssemblyItemModel, String>(props.composition());
Expand Down Expand Up @@ -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("<a href='/ewui/#interfaces/1'>" + assembly.getInterfaces().size() + " Interface</a>");
model.setNumInterfaces("<a href='" + GWT.getHostPageBaseURL() + "#interfaces/"+ApplicationContext.getSelectedJobId()+"/"+assembly.getId() +"'>"+ assembly.getInterfaces().size() + " Interface</a>");
else
model.setNumInterfaces("<a href='" + GWT.getHostPageBaseURL() + "#interfaces/"+ApplicationContext.getSelectedJobId()+"/"+assembly.getId() +"'>"+ assembly.getInterfaces().size() + " Interfaces</a>");
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("<a href='/ewui/#interfaces/1'>" + assembly.getInterfaces().size() + " Interface</a>");
model.setNumInterfaces("<a href='" + GWT.getHostPageBaseURL() + "#interfaces/"+ApplicationContext.getSelectedJobId()+"/"+assembly.getId() +"'>"+ assembly.getInterfaces().size() + " Interface</a>");
else
model.setNumInterfaces("<a href='" + GWT.getHostPageBaseURL() + "#interfaces/"+ApplicationContext.getSelectedJobId()+"/"+assembly.getId() +"'>"+ assembly.getInterfaces().size() + " Interfaces</a>");

data.add(model);
}
}
resultsStore.addAll(data);
Expand Down Expand Up @@ -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("<a target='_blank' href='http://www.pdb.org/pdb/explore/explore.do?structureId="+pdbCode+"'>"+pdbCode+"</a>");
ResultsPanel.informationPanel.assemblyInfoPanel.setHeadingHtml("General Information");
PDBIdentifierPanel.pdbNameLabel.setHTML("Assembly " + assemblyID + " in ");// + pdbCode);
PDBIdentifierPanel.pdbNameLabel.setHTML("<a target='_blank' href='http://www.pdb.org/pdb/explore/explore.do?structureId="+pdbCode+"'>"+pdbCode+"</a>");
InformationPanel.assemblyInfoPanel.setHeadingHtml("General Information");
}
});

Expand Down

0 comments on commit f941b0d

Please sign in to comment.