public void onInteractorTypeUpdate(T protein, CvTerm old) { interactorChangeLogger.log(Level.INFO, "The interactor type" + old.toString() + " has been replaced with " + protein.getInteractorType().toString()+ " in the interactor " + protein.toString()); }
public static boolean isDNA( OntologyManager ontologyManager, Interactor interactor ) { return isOfType( ontologyManager, interactor.getInteractorType(), RuleUtils.DNA_MI_REF, true ); }
/** * To know if an interactor have a specific interactor type. * @param interactor * @param typeId * @param typeName * @return true if the interactor has the type with given name/identifier */ public static boolean doesInteractorHaveType(Interactor interactor, String typeId, String typeName){ if (interactor == null){ return false; } return CvTermUtils.isCvTerm(interactor.getInteractorType(), typeId, typeName); }
public static boolean isRNA( OntologyManager ontologyManager, Interactor interactor ) { return isOfType( ontologyManager, interactor.getInteractorType(), RuleUtils.RNA_MI_REF, true ); }
public static boolean isBiopolymer( OntologyManager ontologyManager, Interactor interactor ) { return isOfType( ontologyManager, interactor.getInteractorType(), RuleUtils.BIOPOLYMER_MI_REF, true ); }
public static boolean isSmallMolecule( OntologyManager ontologyManager, Interactor interactor ) { return isOfType( ontologyManager, interactor.getInteractorType(), BioactiveEntity.BIOACTIVE_ENTITY_MI, true ); }
public static boolean isPeptide( OntologyManager ontologyManager, Interactor interactor ) { return isOfType( ontologyManager, interactor.getInteractorType(), Protein.PEPTIDE_MI, false ); }
public static boolean isPolysaccharide( OntologyManager ontologyManager, Interactor interactor ) { return isOfType( ontologyManager, interactor.getInteractorType(), RuleUtils.POLYSACCHARIDE_MI_REF, true ); }
public static boolean isNucleicAcid( OntologyManager ontologyManager, Interactor interactor ) { return isOfType( ontologyManager, interactor.getInteractorType(), RuleUtils.NUCLEIC_ACID_MI_REF, true ); }
public static boolean isProtein( OntologyManager ontologyManager, Interactor interactor ) { return isOfType( ontologyManager, interactor.getInteractorType(), Protein.PROTEIN_MI, false ); }
public void writeInteractorType(P participant) throws IOException { if (participant != null){ writeCvTerm(participant.getInteractor().getInteractorType()); } else { getWriter().write(MitabUtils.EMPTY_COLUMN); } }
CvTerm type1 = interactor1.getInteractorType(); CvTerm type2 = interactor2.getInteractorType();
CvTerm type1 = interactor1.getInteractorType(); CvTerm type2 = interactor2.getInteractorType();
/** * check that each interactor has at least name or a short label. * * @param interactor to check on. * @return a collection of validator messages. * @exception psidev.psi.tools.validator.ValidatorException if we fail to retrieve the MI Ontology. */ public Collection<ValidatorMessage> check( Interactor interactor ) throws ValidatorException { // list of messages to return List<ValidatorMessage> messages = Collections.EMPTY_LIST; if (interactor.getInteractorType() == null){ MiContext context = RuleUtils.buildContext( interactor, "interactor" ); messages=Collections.singletonList( new ValidatorMessage( "The interactor does not have an interactor type and it is required by IMEx.", MessageLevel.ERROR, context, this ) ); } else { if( RuleUtils.isNucleicAcid(ontologyManager, interactor) || RuleUtils.isSmallMolecule(ontologyManager, interactor)) { MiContext context = RuleUtils.buildContext( interactor, "interactor" ); messages=Collections.singletonList( new ValidatorMessage( "'nucleic acids' and 'small molecules' are currently outside of the remit of IMEx and " + "should be removed from the record.", MessageLevel.WARN, context, this ) ); } } return messages; }
@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; }
/** * * @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.getInteractorType() != null && (RuleUtils.isSmallMolecule( ontologyManager, interactor ) || RuleUtils.isPolysaccharide( ontologyManager, interactor ) )) { else if( interactor.getInteractorType() != null && RuleUtils.isBiopolymer(ontologyManager, interactor)) {
checkCv(messages, interactor.getInteractorType(), interactor, "interactor");
getCvWriter().write(object.getInteractorType());