public void onOrganismUpdate(T protein, Organism old) { if (old == null){ interactorChangeLogger.log(Level.INFO, "The organism has been initialised for the interactor " + protein.toString()); } else if (protein.getOrganism() == null){ interactorChangeLogger.log(Level.INFO, "The organism has been reset for the interactor " + protein.toString()); } else { interactorChangeLogger.log(Level.INFO, "The organism " + old.toString() + " has been replaced with " + protein.getOrganism() + " in the interactor " + protein.toString()); } }
public void writeInteractorOrganism(P participant) throws IOException { if (participant != null){ Interactor interactor = participant.getInteractor(); writeOrganism(interactor.getOrganism()); } else{ writer.write(MitabUtils.EMPTY_COLUMN); } }
@Override public Collection<ValidatorMessage> check(Interactor interactor) throws ValidatorException { Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; if (interactor.getInteractorType() != null && RuleUtils.isProtein(ontologyManager, interactor) && interactor.getOrganism() == null){ MiContext context = RuleUtils.buildContext(interactor, "interactor"); messages=Collections.singleton(new ValidatorMessage("The protein does not have an organism and it is required for MIMIx.", MessageLevel.ERROR, context, this)); } else if ( InteractorUtils.doesInteractorHaveType(interactor, Gene.GENE_MI, Gene.GENE) && interactor.getOrganism() == null){ MiContext context = RuleUtils.buildContext(interactor, "interactor"); messages=Collections.singleton( new ValidatorMessage( "The gene does not have an organism and it is required for MIMIx.", MessageLevel.ERROR, context, this ) ); } return messages; }
Organism organism1 = interactor1.getOrganism(); Organism organism2 = interactor2.getOrganism();
Organism organism1 = interactor1.getOrganism(); Organism organism2 = interactor2.getOrganism();
/** * * @param interactor * @return the hashcode consistent with the equals method for this comparator */ public static int hashCode(Interactor interactor){ if (unambiguousExactInteractorComparator == null){ unambiguousExactInteractorComparator = new UnambiguousExactInteractorBaseComparator(); } if (interactor == null){ return 0; } int hashcode = 31; hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(interactor.getInteractorType()); hashcode = 31*hashcode + OrganismTaxIdComparator.hashCode(interactor.getOrganism()); hashcode = 31*hashcode + UnambiguousInteractorBaseComparator.hashCode(interactor); return hashcode; } }
/*** * This method will copy properties of interactor source in interactor target and will override all the other properties of Target interactor. * @param source * @param target */ public static void copyAndOverrideBasicInteractorProperties(Interactor source, Interactor target){ if (source != null && target != null){ target.setShortName(source.getShortName()); target.setFullName(source.getFullName()); target.setInteractorType(source.getInteractorType()); target.setOrganism(source.getOrganism()); // copy collections target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getIdentifiers().clear(); target.getIdentifiers().addAll(source.getIdentifiers()); target.getAliases().clear(); target.getAliases().addAll(source.getAliases()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); target.getChecksums().clear(); target.getChecksums().addAll(source.getChecksums()); } }
if (interactor.getOrganism() != null){ checkOrganism(messages, interactor.getOrganism(), interactor, "interactor");
if (object.getOrganism() != null){ MIJsonUtils.writeSeparator(writer); MIJsonUtils.writePropertyKey("organism", writer); getOrganismWriter().write(object.getOrganism());
if (object.getOrganism() != null){ MIJsonUtils.writeSeparator(writer); MIJsonUtils.writePropertyKey("organism", writer); getOrganismWriter().write(object.getOrganism());