protected Key keyForFeature(Feature feature) { if (feature.getComponent() == null) { throw new IllegalArgumentException("Cannot create a feature key for feature without component: " + feature); } Key componentKey = keyFor(feature.getComponent()); return new Key(new FeatureKeyCalculator().calculateFeatureKey(feature) + "___" + componentKey.getUniqueString()); // return new Key( keyForAnnotatedObject( feature ).getUniqueString() + "___" + componentKey.getUniqueString() ); }
protected Key keyForFeature(Feature feature) { if (feature.getComponent() == null) { throw new IllegalArgumentException("Cannot create a feature key for feature without component: " + feature); } Key componentKey = keyFor(feature.getComponent()); return new Key(new FeatureKeyCalculator().calculateFeatureKey(feature) + "___" + componentKey.getUniqueString()); // return new Key( keyForAnnotatedObject( feature ).getUniqueString() + "___" + componentKey.getUniqueString() ); }
if (component == null && feature.getComponent() == null) { } else if ((component == null && feature.getComponent() != null) || (component != null && feature.getComponent() == null)) { return false; } else if (component.getAc() != null && feature.getComponent().getAc() != null) { if (!component.getAc().equals(feature.getComponent().getAc())) { return false;
if (component == null && feature.getComponent() == null) { } else if ((component == null && feature.getComponent() != null) || (component != null && feature.getComponent() == null)) { return false; } else if (component.getAc() != null && feature.getComponent().getAc() != null) { if (!component.getAc().equals(feature.getComponent().getAc())) { return false;
if ( !component.equals( feature.getComponent() ) ) { return false; if ( feature.getComponent() != null ) { return false;
log.debug("\t\t\tComponent ("+f.getComponent().getAc()+") - Interactor: "+f.getComponent().getInteractor().getShortLabel()+" - Interaction: "+f.getComponent().getInteraction().getShortLabel());
Component boundComponent = boundDomain.getComponent(); Interactor interactor2 = boundComponent.getInteractor();
return ((InteractionParameter) child).getInteraction(); } else if (child instanceof Feature) { return ((Feature) child).getComponent(); } else if (child instanceof ComponentParameter) { return ((ComponentParameter) child).getComponent();
Component boundComponent = boundDomain.getComponent(); Interactor interactor2 = boundComponent.getInteractor();
Component boundComponent = boundDomain.getComponent(); Interactor interactor2 = boundComponent.getInteractor();
Component boundComponent = boundDomain.getComponent(); Interactor interactor2 = boundComponent.getInteractor();
return ((InteractionParameter) child).getInteraction(); } else if (child instanceof Feature) { return ((Feature) child).getComponent(); } else if (child instanceof ComponentParameter) { return ((ComponentParameter) child).getComponent();
private void synchronizeFeature( Feature feature, boolean synchronizeAnnotatedAttributes ) { feature.setBoundDomain( synchronize( feature.getBoundDomain() ) ); feature.setComponent( synchronize( feature.getComponent() ) ); feature.setCvFeatureIdentification( synchronize( feature.getCvFeatureIdentification() ) ); feature.setCvFeatureType( synchronize( feature.getCvFeatureType() ) ); // cannot call setRanges in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(feature.getRanges())){ Collection<Range> ranges = synchronizeRanges(feature.getRanges(), feature); feature.getRanges().clear(); feature.getRanges().addAll(ranges); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( feature ); } }
private void synchronizeFeature( Feature feature, boolean synchronizeAnnotatedAttributes ) { feature.setBoundDomain( synchronize( feature.getBoundDomain() ) ); feature.setComponent( synchronize( feature.getComponent() ) ); feature.setCvFeatureIdentification( synchronize( feature.getCvFeatureIdentification() ) ); feature.setCvFeatureType( synchronize( feature.getCvFeatureType() ) ); // cannot call setRanges in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(feature.getRanges())){ Collection<Range> ranges = synchronizeRanges(feature.getRanges(), feature); feature.getRanges().clear(); feature.getRanges().addAll(ranges); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( feature ); } }
public static String createKey(AnnotatedObject ao) { String key; final String normalizedClassName = normalizeClassName(ao.getClass()); if (ao instanceof Component) { // So far, components have as shorltabel N/A => we need to create one that allows to discriminate them Component comp = (Component)ao; String label = comp.getInteraction().getShortLabel()+"_"+comp.getInteractor().getShortLabel(); key = normalizedClassName +":"+label; } else if (ao instanceof BioSource) { key = normalizedClassName +":"+((BioSource)ao).getTaxId(); } else if (ao instanceof CvObject) { CvObject cv = (CvObject)ao; CvObjectXref identity = CvObjectUtils.getPsiMiIdentityXref(cv); if (identity != null) { key = normalizedClassName +":"+identity.getPrimaryId(); } else { key = normalizedClassName +":"+ao.getShortLabel(); } } else if (ao instanceof Feature) { String label = ao.getShortLabel()+"_"+createKey(((Feature)ao).getComponent()); key = normalizedClassName+":"+label; } else { key = normalizedClassName +":"+ao.getShortLabel(); } return key; }
public Collection<GeneralMessage> check( Feature feature ) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); final Component component = feature.getComponent(); final Interactor interactor = component.getInteractor(); final boolean isPolymer = ( interactor instanceof Polymer );
@Override protected void saveOrUpdateAttributes(Feature intactObject) throws PersisterException { super.saveOrUpdateAttributes(intactObject); ComponentPersister.getInstance().saveOrUpdate(intactObject.getComponent()); CvObjectPersister cvObjectPersister = CvObjectPersister.getInstance(); if (intactObject.getCvFeatureIdentification() != null) { cvObjectPersister.saveOrUpdate(intactObject.getCvFeatureIdentification()); } if (intactObject.getCvFeatureType() != null) { cvObjectPersister.saveOrUpdate(intactObject.getCvFeatureType()); } for (Range range : intactObject.getRanges()) { if ( range.getFromCvFuzzyType() != null ) { cvObjectPersister.saveOrUpdate(range.getFromCvFuzzyType()); } if ( range.getToCvFuzzyType() != null ) { cvObjectPersister.saveOrUpdate(range.getToCvFuzzyType()); } } }
public Feature cloneFeature(Feature feature) throws IntactClonerException { if (feature == null) return null; Feature clone = new Feature(); clonerManager.addClone(feature, clone); clone.setOwner(clone(feature.getOwner())); clone.setShortLabel(feature.getShortLabel()); clone.setCvFeatureType(clone(feature.getCvFeatureType())); clone.setCvFeatureIdentification(clone(feature.getCvFeatureIdentification())); if (isCollectionClonable(feature.getRanges())) { Collection<Range> ranges = IntactCore.ensureInitializedRanges(feature); for (Range range : ranges) { clone.addRange(clone(range)); } } clone.setComponent(clone(feature.getComponent())); return clone; }
public Feature cloneFeature(Feature feature) throws IntactClonerException { if (feature == null) return null; Feature clone = new Feature(); clonerManager.addClone(feature, clone); clone.setOwner(clone(feature.getOwner())); clone.setShortLabel(feature.getShortLabel()); clone.setCvFeatureType(clone(feature.getCvFeatureType())); clone.setCvFeatureIdentification(clone(feature.getCvFeatureIdentification())); if (isCollectionClonable(feature.getRanges())) { Collection<Range> ranges = IntactCore.ensureInitializedRanges(feature); for (Range range : ranges) { clone.addRange(clone(range)); } } clone.setComponent(clone(feature.getComponent())); return clone; }
Component component = compPersister.syncIfTransient(intactObject.getComponent()); intactObject.setComponent(component);