public Collection<GeneralMessage> check( Feature feature ) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); if ( feature.getCvFeatureType() == null ) { messages.add( new GeneralMessage( MessageDefinition.FEATURE_WITHOUT_TYPE, feature ) ); } return messages; } }
protected void indexfeatures(SolrInputDocument doc) { for (Feature f : component.getFeatures()){ if (f.getCvFeatureType() != null){ enricher.enrichFeatureType(f.getCvFeatureType(), doc); } } } } // End TreeNode Class
public Collection<GeneralMessage> check( Feature feature ) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); if ( feature.getCvFeatureType() == null ) { return messages; } String cvFeatureTypeIdentityMi = feature.getCvFeatureType().getMiIdentifier(); if ( CvFeatureType.MUTATION_DECREASING_MI_REF.equals( cvFeatureTypeIdentityMi ) || CvFeatureType.MUTATION_INCREASING_MI_REF.equals( cvFeatureTypeIdentityMi ) || CvFeatureType.MUTATION_MI_REF.equals( cvFeatureTypeIdentityMi ) || CvFeatureType.MUTATION_DISRUPTING_MI_REF.equals( cvFeatureTypeIdentityMi ) ) { Collection<Range> ranges = feature.getRanges(); for ( Range range : ranges ) { // tointervalstart - r.fromintervalend int width = range.getToIntervalStart() - range.getFromIntervalEnd(); if ( width > 2 ) { messages.add( new GeneralMessage(MessageDefinition.FEATURE_DELETION_FEATURE_TOO_LONG, feature ) ); } } } return messages; } }
String text = null; if (feature.getCvFeatureType() != null && feature.getCvFeatureType().getFullName() != null){ name = feature.getCvFeatureType().getFullName(); else if (feature.getCvFeatureType() != null && feature.getCvFeatureType().getShortLabel() != null){ name = feature.getCvFeatureType().getShortLabel();
if( isTaggedFeature( feature.getCvFeatureType() ) ) { feature.getCvFeatureType() );
if( isTaggedFeature( feature.getCvFeatureType() ) ) { feature.getCvFeatureType() );
if( isTaggedFeature( feature.getCvFeatureType() ) ) { feature.getCvFeatureType() );
boolean isTagged = isTaggedFeature( feature.getCvFeatureType() ); Element isTaggedElement = session.createElement( "isTagged" ); Text isTaggedText = session.createTextNode( ( isTagged ? "true" : "false" ) ); CvObject2xmlFactory.getInstance( session ).create( session, proteinExperimentalFormElement, feature.getCvFeatureType() );
boolean isTagged = isTaggedFeature( feature.getCvFeatureType() ); Element isTaggedElement = session.createElement( "isTagged" ); Text isTaggedText = session.createTextNode( ( isTagged ? "true" : "false" ) ); CvObject2xmlFactory.getInstance( session ).create( session, proteinExperimentalFormElement, feature.getCvFeatureType() );
protected void traverseFeature(Feature feature, IntactVisitor ... visitors) { if (feature == null) return; for (IntactVisitor visitor : visitors) { visitor.visitFeature(feature); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(feature)) { return; } traverse(feature.getCvFeatureType(), visitors); traverse(feature.getCvFeatureIdentification(), visitors); for (Range range : feature.getRanges()) { traverse(range, visitors); } }
protected void traverseFeature(Feature feature, IntactVisitor ... visitors) { if (feature == null) return; for (IntactVisitor visitor : visitors) { visitor.visitFeature(feature); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(feature)) { return; } traverse(feature.getCvFeatureType(), visitors); traverse(feature.getCvFeatureIdentification(), visitors); for (Range range : feature.getRanges()) { traverse(range, visitors); } }
protected UniquenessStringBuilder createUniquenessString(Feature feature) { if (keyExists(feature)) { UniquenessStringBuilder builder = getKey(feature); if (builder != null){ return builder; } else{ identityToCrc.remove(System.identityHashCode(feature)); } } UniquenessStringBuilder sb = new UniquenessStringBuilder(); putKey(feature, sb); if (feature == null) return sb; // short label // We need to add the short label for the feature because in mutations in the same amino acid is the only way to // distinguish between two features when the AC is not assigned yet. sb.append(feature.getShortLabel()); // feature type sb.append(createUniquenessString(feature.getCvFeatureType())); // feature identification sb.append(createUniquenessString(feature.getCvFeatureIdentification())); // ranges List<Range> ranges = new ArrayList<Range>(feature.getRanges()); Collections.sort(ranges, new RangeComparator()); for (Range range : ranges) { sb.append(createUniquenessString(range)); } return sb; }
protected UniquenessStringBuilder createUniquenessString(Feature feature) { if (keyExists(feature)) { UniquenessStringBuilder builder = getKey(feature); if (builder != null){ return builder; } else{ identityToCrc.remove(System.identityHashCode(feature)); } } UniquenessStringBuilder sb = new UniquenessStringBuilder(); putKey(feature, sb); if (feature == null) return sb; // short label // We need to add the short label for the feature because in mutations in the same amino acid is the only way to // distinguish between two features when the AC is not assigned yet. sb.append(feature.getShortLabel()); // feature type sb.append(createUniquenessString(feature.getCvFeatureType())); // feature identification sb.append(createUniquenessString(feature.getCvFeatureIdentification())); // ranges List<Range> ranges = new ArrayList<Range>(feature.getRanges()); Collections.sort(ranges, new RangeComparator()); for (Range range : ranges) { sb.append(createUniquenessString(range)); } return sb; }
if (intactObject.getCvFeatureType() != null){ FeatureType featureType = featureTypeConverter.intactToPsi(intactObject.getCvFeatureType()); psiFeature.setFeatureType(featureType);
@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()); } } }
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 ); } }
if (intactObject.getCvFeatureType() != null) { CvFeatureType syncedFeatureType = (CvFeatureType) cvObjectPersister.syncIfTransient(intactObject.getCvFeatureType()); intactObject.setCvFeatureType(syncedFeatureType);
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; }