/** * Gets Interactor List. * * @return Castor InteractorList. */ private EntrySet.Entry.InteractorList getInteractorList() { HashMap proteinSet = getNonRedundantInteractors(); EntrySet.Entry.InteractorList interactorList = new EntrySet.Entry.InteractorList(); // Iterate through all Interactors Iterator iterator = proteinSet.values().iterator(); while (iterator.hasNext()) { // Create new Interactor Interactor interactor = (Interactor) iterator.next(); InteractorElementType jaxbInteractor = new InteractorElementType(); setNameId(interactor, jaxbInteractor); setOrganism(interactor, jaxbInteractor); setSequence(interactor, jaxbInteractor); XrefType xref = createExternalRefs(interactor); if (xref != null) { jaxbInteractor.setXref(xref); } // Add to Interactor List interactorList.getInteractor().add(jaxbInteractor); } return interactorList; }
/** * Sets Interactor Name and ID. * * @param interactor Data Services Interactor object. * @param jaxbInteractor JAXB Protein Interactor Object. */ private void setNameId(Interactor interactor, InteractorElementType jaxbInteractor) { NamesType names = new NamesType(); names.setShortLabel(interactor.getName()); String fullName = (String) interactor.getAttribute(InteractorVocab.FULL_NAME); if (fullName != null) { names.setFullName(fullName); } jaxbInteractor.setNames(names); jaxbInteractor.setId(interactorId); interactorMap.put(interactor.getName(), interactorId); interactorId++; }
/** * Sets Interactor Organism. * * @param interactor Data Services Interactor Object. * @param jaxbInteractor JAXB Protein Interactor Object. */ private void setOrganism(Interactor interactor, InteractorElementType jaxbInteractor) { InteractorElementType.Organism organism = new InteractorElementType.Organism(); String taxonomyID = (String) interactor.getAttribute(InteractorVocab.ORGANISM_NCBI_TAXONOMY_ID); if (taxonomyID != null) { int taxId = Integer.parseInt(taxonomyID); organism.setNcbiTaxId(taxId); } NamesType orgNames = new NamesType(); String commonName = (String) interactor.getAttribute(InteractorVocab.ORGANISM_COMMON_NAME); if (commonName != null) { orgNames.setShortLabel(commonName); } String speciesName = (String) interactor.getAttribute(InteractorVocab.ORGANISM_SPECIES_NAME); if (speciesName != null) { orgNames.setFullName(speciesName); } organism.setNames(orgNames); jaxbInteractor.setOrganism(organism); }
/** Sets Sequence Data. */ private void setSequence(Interactor interactor, InteractorElementType jaxbInteractor) { String seqData = (String) interactor.getAttribute(InteractorVocab.SEQUENCE_DATA); if (seqData != null) { jaxbInteractor.setSequence(seqData); } }