public void onTypeUpdate(T protein, CvTerm old) { if (old == null){ featureChangeLogger.log(Level.INFO, "The type has been initialised for the feature " + protein.toString()); } else if (protein.getType() == null){ featureChangeLogger.log(Level.INFO, "The type has been reset for the feature " + protein.toString()); } else { featureChangeLogger.log(Level.INFO, "The type " + old.toString() + " has been replaced with " + protein.getType() + " in the feature " + protein.toString()); } }
public static boolean isBindingSite( OntologyManager ontologyManager, Feature feature ) { return isOfType( ontologyManager, feature.getType(), RuleUtils.BINDING_SITE, true ); }
Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; if (feature.getType() != null){ if (feature.getType().getMODIdentifier() != null){ final OntologyAccess access = ontologyManager.getOntologyAccess("MOD"); final OntologyTermI dbTerms = access.getTermForAccession(feature.getType().getMODIdentifier()); if (feature.getType().getMIIdentifier() != null){ final OntologyAccess access = ontologyManager.getOntologyAccess("MI"); final OntologyTermI dbTerms = access.getTermForAccession(feature.getType().getMIIdentifier());
/** * For each participants of the interaction, collect all respective feature types and feature range status and * check if the dependencies are correct. * * @param feature to check on. * @return a collection of validator messages. * if we fail to retreive the MI Ontology. */ public Collection<ValidatorMessage> check( Feature feature) throws ValidatorException { Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; if (feature.getType() != null){ Collection<Range> featureRange = feature.getRanges(); CvTerm featureType = feature.getType(); messages = new ArrayList<ValidatorMessage>(); if (!feature.getRanges().isEmpty()){ for (Range r : featureRange){ // build a context in case of error MiContext context = RuleUtils.buildContext(feature, "feature"); context.addAssociatedContext(RuleUtils.buildContext(featureType, "feature type")); context.addAssociatedContext(RuleUtils.buildContext(r, "feature range")); CvTerm startStatus = r.getStart().getStatus(); CvTerm endStatus = r.getEnd().getStatus(); messages.addAll( mapping.check( featureType, startStatus, context, this ) ); messages.addAll( mapping.check( featureType, endStatus, context, this ) ); } } } return messages; }
/*** * This method will copy properties of Feature source in Feature target and will override all the other properties of Target feature. * Only the participant is not copied * @param source * @param target */ public static void copyAndOverrideBasicFeaturesProperties(Feature source, Feature target){ if (source != null && target != null){ target.setShortName(source.getShortName()); target.setFullName(source.getFullName()); target.setType(source.getType()); target.setRole(source.getRole()); // copy collections target.getAliases().clear(); target.getAliases().addAll(source.getAliases()); target.getLinkedFeatures().clear(); target.getLinkedFeatures().addAll(source.getLinkedFeatures()); target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getIdentifiers().clear(); target.getIdentifiers().addAll(source.getIdentifiers()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); target.getRanges().clear(); target.getRanges().addAll(source.getRanges()); } } }
hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(feature.getType()); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(feature.getRole()); if (feature.getInterpro() != null){
Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; if (feature.getType() != null){ if (RuleUtils.isBindingSite(ontologyManager, feature)){ Collection<Range> ranges = feature.getRanges();