uk.ac.ebi.intact.model.Feature类的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中uk.ac.ebi.intact.model.Feature类的一些代码示例,展示了Feature类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feature类的具体详情如下:
包路径:uk.ac.ebi.intact.model.Feature
类名称:Feature

Feature介绍

[英]Represents a feature, a region with specific properties, on a sequence.
[中]表示序列上的特征(具有特定特性的区域)。

代码示例

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Retrieves the ranges from a feature, initializing them if necessary.
 *
 * @param feature the feature
 * @return The returned ranges are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<Range> ensureInitializedRanges(Feature feature) {
  Collection<Range> ranges;
  if (IntactCore.isInitialized(feature.getRanges())) {
    ranges = feature.getRanges();
  } else {
    ranges = IntactContext.getCurrentInstance().getDaoFactory().getRangeDao().getByFeatureAc(feature.getAc());
  }
  return ranges;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

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 );
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

@Override
public int hashCode() {
  int result = fromIntervalStart;
  result = 31 * result + fromIntervalEnd;
  result = 31 * result + toIntervalStart;
  result = 31 * result + toIntervalEnd;
  result = 31 * result + ( undetermined ? 1 : 0 );
  result = 31 * result + ( linked ? 1 : 0 );
  result = 31 * result + ( fromCvFuzzyType != null ? fromCvFuzzyType.hashCode() : 0 );
  result = 31 * result + ( toCvFuzzyType != null ? toCvFuzzyType.hashCode() : 0 );
  result = 31 * result + ( sequence != null ? sequence.hashCode() : 0 );
  result = 31 * result + ( fullSequence != null ? fullSequence.hashCode() : 0 );
  result = 31 * result + ( upStreamSequence != null ? upStreamSequence.hashCode() : 0 );
  result = 31 * result + ( downStreamSequence != null ? downStreamSequence.hashCode() : 0 );
  // Include the feature this range is linked to.
  result = 31 * result + ( feature != null ? feature.getAc() != null? feature.getAc().hashCode() : feature.hashCode( true, false ) : 0 );
  return result;
}

代码示例来源:origin: uk.ac.ebi.intact.app/data-conversion

if ( feature.getCvFeatureType() != null ) {
  CvObject2xmlFactory.getInstance( session ).create( session, element, feature.getCvFeatureType() );
} else {
  System.err.println( "There should be a CvFeatureType in that Feature( " + feature.getAc() + " )." );
if ( feature.getCvFeatureIdentification() != null ) {
  CvObject2xmlFactory.getInstance( session ).create( session, element, feature.getCvFeatureIdentification() );
Collection ranges = feature.getRanges();

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

PsiConverterUtils.populateAttributes(intactObject, psiFeature, annotationConverter);
if (intactObject.getCvFeatureIdentification()!= null) {
  FeatureDetectionMethod featureMethod = featureDetMethodConverter.intactToPsi(intactObject.getCvFeatureIdentification());
  psiFeature.setFeatureDetectionMethod(featureMethod);
if (intactObject.getCvFeatureType() != null){
  FeatureType featureType = featureTypeConverter.intactToPsi(intactObject.getCvFeatureType());
  psiFeature.setFeatureType(featureType);
  log.error("Feature without feature type " + intactObject.getShortLabel());
  ranges = intactObject.getRanges();
  log.error("Feature without any ranges : " + intactObject.getShortLabel());

代码示例来源:origin: uk.ac.ebi.intact.core/intact-persister

Component component = compPersister.syncIfTransient(intactObject.getComponent());
intactObject.setComponent(component);
if (intactObject.getCvFeatureIdentification() != null) {
  CvFeatureIdentification syncedFeatureDetMethod = (CvFeatureIdentification) cvObjectPersister.syncIfTransient(intactObject.getCvFeatureIdentification());
  intactObject.setCvFeatureIdentification(syncedFeatureDetMethod);
if (intactObject.getCvFeatureType() != null) {
  CvFeatureType syncedFeatureType = (CvFeatureType) cvObjectPersister.syncIfTransient(intactObject.getCvFeatureType());
  intactObject.setCvFeatureType(syncedFeatureType);
for (Range range : intactObject.getRanges()) {
  if ( range.getFromCvFuzzyType() != null ) {
    CvFuzzyType synchedFromFuzzyType = (CvFuzzyType) cvObjectPersister.syncIfTransient(range.getFromCvFuzzyType());

代码示例来源:origin: uk.ac.ebi.intact.core/intact-persister

@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());
    }
  }
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

Feature feature = new Feature( institution,
                featureTag.getShortlabel(),
                component,
                featureType );
feature.setFullName( featureTag.getFullname() );
  detectionId = featureTag.getFeatureDetection().getPsiDefinition().getId();
  CvFeatureIdentification featureDetection = FeatureChecker.getCvFeatureIdentification( detectionId );
  feature.setCvFeatureIdentification( featureDetection );
                xrefTag.getVersion(),
                qualifier );
  feature.addXref( xref );
  IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref );
  feature.addRange( range );

代码示例来源:origin: uk.ac.ebi.intact.sanity/intact-sanity-rules

public Collection<GeneralMessage> check(Feature feature) throws SanityRuleException {
    Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>();
    if(feature.getRanges().isEmpty()){
      messages.add(new GeneralMessage( MessageDefinition.FEATURE_WITHOUT_RANGE, feature));
    }
    return messages;
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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);
  }
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psimitab-converters

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();
List<String> rangesMitab = new ArrayList<String>(feature.getRanges().size());
for (Range range : feature.getRanges()){
  String rangeAsString = FeatureUtils.convertRangeIntoString(range);
  if (rangeAsString != null){
for (FeatureXref refs : feature.getXrefs()){

代码示例来源:origin: uk.ac.ebi.intact.util/data-conversion

Feature feature = (Feature) iterator1.next();
Feature boundDomain = feature.getBoundDomain();
if ( boundDomain == null ) {
  continue; // that feature doesn't interact with an other one, skip it.
Component boundComponent = boundDomain.getComponent();
Interactor interactor2 = boundComponent.getInteractor();

代码示例来源:origin: uk.ac.ebi.intact.sanity/intact-sanity-rules

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;
  }
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

feature.setOwner(getInstitution());
  feature.setCvFeatureType(featureType);
  log.error("Feature without feature type : " + feature.getShortLabel());
  feature.setCvFeatureIdentification(cvFeatureDetMethod);
  log.error("Feature without any ranges : " + feature.getShortLabel());
  feature.addRange(range);

代码示例来源:origin: uk.ac.ebi.intact.sanity/intact-sanity-rules

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;
  }
}

代码示例来源:origin: uk.ac.ebi.intact/intact-core

if ( !component.equals( feature.getComponent() ) ) {
    return false;
  if ( feature.getComponent() != null ) {
    return false;
return CollectionUtils.isEqualCollection( ranges, feature.getRanges() );

代码示例来源:origin: uk.ac.ebi.intact.util/data-conversion

public String toString() {
    return "InferredInteraction{" +
        "feature1=" + feature1.getAc() +
        ", feature2=" + feature2.getAc() +
        "}";
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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 ( binds != null ? !binds.equals( feature.binds, false, false ) : feature.binds != null )
    return false;

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

Feature feature = featureConverter.psiToIntact(psiFeature);
component.getBindingDomains().add(feature);
feature.setComponent(component);
    for (Range r : feature.getRanges()){

相关文章