void setReleases(Set<Release> releases) { for (Release release : releases) { addRelease(release); } }
private void setSignatures(Set<Signature> signatures) { for (Signature signature : signatures) { addSignature(signature); } }
@Override public int hashCode() { return new HashCodeBuilder(87, 23) .append(accession) .append(name) .append(type) .append(created) .append(updated) .append(getDescription()) .append(getAbstract()) // TODO: Figure out why adding signatures to hashCode() causes Entry.equals() to fail .append(getSignatures()) // .append(getReleases()) // .append(getPathwayXRefs()) // .append(getGoXRefs()) .toHashCode(); }
public Entry build() { Entry entry = new Entry(accession); entry.setName(name); entry.setDescription(description); entry.setType(type); entry.setAbstract(abstractText); entry.setCreated(created); entry.setUpdated(updated); if (!releases.isEmpty()) { entry.setReleases(releases); } if (!signatures.isEmpty()) { entry.setSignatures(signatures); } if (!goCrossReferences.isEmpty()) { entry.setGoXRefs(goCrossReferences); } if (!pathwayXRefs.isEmpty()) { entry.setPathwayXRefs(pathwayXRefs); } return entry; }
Entry interProEntry = signature.getEntry(); if (interProEntry != null) { mappingFields.add(interProEntry.getAccession()); mappingFields.add(interProEntry.getDescription()); if (mapToGO) { List<GoXref> goXRefs = new ArrayList<>(interProEntry.getGoXRefs()); Collections.sort(goXRefs, new GoXrefComparator()); if (goXRefs.size() > 0) { List<PathwayXref> pathwayXRefs = new ArrayList<>(interProEntry.getPathwayXRefs()); Collections.sort(pathwayXRefs, new PathwayXrefComparator()); if (pathwayXRefs.size() > 0) {
mappingFields.add(interProEntry.getAccession()); // The corresponding InterPro entry (if iprlookup requested by the user) mappingFields.add(interProEntry.getDescription()); // The corresponding entry description (if iprlookup requested by the user) List<GoXref> goXRefs = new ArrayList<>(interProEntry.getGoXRefs()); Collections.sort(goXRefs, new GoXrefComparator()); if (goXRefs.size() > 0) {
StringBuilder dbxrefAttributeValue = new StringBuilder("\"InterPro:"); dbxrefAttributeValue .append(interProEntry.getAccession()) .append('"'); List<PathwayXref> pathwayXRefs = new ArrayList<>(interProEntry.getPathwayXRefs()); Collections.sort(pathwayXRefs, new PathwayXrefComparator()); if (pathwayXRefs.size() > 0) { List<GoXref> goXRefs = new ArrayList<>(interProEntry.getGoXRefs()); Collections.sort(goXRefs, new GoXrefComparator()); if ((goXRefs.size() > 0)) {
for (Entry entry : entries) { Set<String> signatureAcs = (Set<String>) getEntry2SignaturesMap().get(entry.getAccession()); if (signatureAcs == null) { throw new IllegalStateException("Could not load any signature accession for entry accession - " + entry.getAccession() + " from external database!"); log.warn("Signatures could not be found in the database: " + signatureAcs.toString() + " No signatures for entry " + entry.getAccession() + " could be found in the database."); entry.addSignature(signature);
public void setPathwayXRefs(Collection<PathwayXref> xrefs) { for (PathwayXref xref : xrefs) { addPathwayXRef(xref); } }
public void setGoXRefs(Set<GoXref> xrefs) { for (GoXref xref : xrefs) { addGoXRef(xref); } }
Entry interProEntry = signature.getEntry(); if (interProEntry != null) { mappingFields.add(interProEntry.getAccession()); mappingFields.add(interProEntry.getDescription()); if (mapToGO) { List<GoXref> goXRefs = new ArrayList<>(interProEntry.getGoXRefs()); Collections.sort(goXRefs, new GoXrefComparator()); if (goXRefs.size() > 0) { List<PathwayXref> pathwayXRefs = new ArrayList<>(interProEntry.getPathwayXRefs()); Collections.sort(pathwayXRefs, new PathwayXrefComparator()); if (pathwayXRefs.size() > 0) {
mappingFields.add(interProEntry.getAccession()); // The corresponding InterPro entry (if iprlookup requested by the user) mappingFields.add(interProEntry.getDescription()); // The corresponding entry description (if iprlookup requested by the user) List<GoXref> goXRefs = new ArrayList<>(interProEntry.getGoXRefs()); Collections.sort(goXRefs, new GoXrefComparator()); if (goXRefs.size() > 0) {
StringBuilder dbxrefAttributeValue = new StringBuilder("\"InterPro:"); dbxrefAttributeValue .append(interProEntry.getAccession()) .append('"'); List<PathwayXref> pathwayXRefs = new ArrayList<>(interProEntry.getPathwayXRefs()); Collections.sort(pathwayXRefs, new PathwayXrefComparator()); if (pathwayXRefs.size() > 0) { List<GoXref> goXRefs = new ArrayList<>(interProEntry.getGoXRefs()); Collections.sort(goXRefs, new GoXrefComparator()); if ((goXRefs.size() > 0)) {
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Entry)) return false; final Entry e = (Entry) o; return new EqualsBuilder() .append(accession, e.accession) .append(name, e.name) .append(type, e.type) .append(created, e.created) .append(updated, e.updated) .append(getDescription(), e.getDescription()) .append(getAbstract(), e.getAbstract()) .append(signatures, e.getSignatures()) // .append(releases, e.getReleases()) // .append(pathwayXRefs, e.getPathwayXRefs()) // .append(goXRefs, e.getGoXRefs()) .isEquals(); }
@Override public String toString() { return new ToStringBuilder(this) .append("accession", accession) .append("name", name) .append("type", type) .append("created", created) .append("updated", updated) .append("description", getDescription()) .append("abstract", getAbstract()) .append("signatures", getSignatures()) // .append("releases", getReleases()) // .append("pathwayXRefs", getPathwayXRefs()) // .append("goXRefs", getGoXRefs()) .toString(); } }