return true;
}
PDBEntry o = (PDBEntry) obj;
- return /*
- * (file == o.file || (file != null && o.file != null && o.file
- * .equals(file))) &&
- */
+ return
(type == o.type || (type != null && o.type != null && o.type
.equals(type)))
&& (id == o.id || (id != null && o.id != null && o.id
&& (properties == o.properties || (properties != null
&& o.properties != null && properties
.equals(o.properties)));
+
}
/**
PDBEntry pdbe = new PDBEntry();
pdbe.setFile(getDataName());
pdbe.setId(getDataName());
- sq.addPDBId(pdbe);
pdbe.setProperty(new Hashtable());
// pdbe.getProperty().put("CHAIN", "" + _lastChainId);
pdbe.setChainCode(String.valueOf(_lastChainId));
+ sq.addPDBId(pdbe);
// JAL-1533
// Need to put the number of models for this polymer somewhere for Chimera/others to grab
// pdbe.getProperty().put("PDBMODELS", biopoly.)
&& !resultList.getSearchSummary().isEmpty())
{
discoveredStructuresSet.addAll(resultList.getSearchSummary());
- updateSequenceDbRef(seq, resultList.getSearchSummary());
+ updateSequencePDBEntries(seq, resultList.getSearchSummary());
}
}
{
for (PDBEntry pdbEntry : seq.getDatasetSequence().getPDBId())
{
+
String chain = pdbEntry.getChainCode() == null ? "_" : pdbEntry
.getChainCode();
String[] pdbEntryRowData = new String[]
chain,
pdbEntry.getType(),
pdbEntry.getFile() };
- tableModel.addRow(pdbEntryRowData);
+ if (pdbEntry.getFile() != null)
+ {
+ tableModel.addRow(pdbEntryRowData);
+ }
cachedEntryMap.put(pdbEntry.getId().toLowerCase(),
pdbEntry);
}
}
/**
- * Update the DBRef entry for a given sequence with values retrieved from
+ * Update the PDBEntry for a given sequence with values retrieved from
* PDBResponseSummary
*
* @param seq
* @param responseSummaries
* a collection of PDBResponseSummary
*/
- public void updateSequenceDbRef(SequenceI seq,
+ public void updateSequencePDBEntries(SequenceI seq,
Collection<PDBResponseSummary> responseSummaries)
{
for (PDBResponseSummary response : responseSummaries)
{
- PDBEntry newEntry = new PDBEntry();
- newEntry.setId(response.getPdbId());
- newEntry.setType(PDBEntry.Type.PDB);
- seq.getDatasetSequence().addPDBId(newEntry);
+ String pdbIdStr = response.getPdbId();
+ PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
+ if (pdbEntry == null)
+ {
+ pdbEntry = new PDBEntry();
+ pdbEntry.setId(pdbIdStr);
+ pdbEntry.setType(PDBEntry.Type.PDB);
+ }
+ seq.getDatasetSequence().addPDBId(pdbEntry);
}
}
"x/y/z/File");
PDBEntry case7 = new PDBEntry("1xyz", "A", null, "x/y/z/File");
PDBEntry case8 = new PDBEntry("1xyz", "A", PDBEntry.Type.PDB, null);
+ PDBEntry case9 = new PDBEntry("1xyz", "A", null, "x/y/z/File");
+
// System.out.println(">>>> Testing case 1");
assertTrue(pdbEntry.equals(case1));
// System.out.println(">>>> Testing case 2");
assertTrue(!pdbEntry.equals(case7));
// System.out.println(">>>> Testing case 8");
assertTrue(pdbEntry.equals(case8));
+ assertTrue(pdbEntry.equals(case8));
+ assertTrue(case7.equals(case9));
} catch (Exception e)
{
e.printStackTrace();