Tabnine Logo
AnnotatedObject.getXrefs
Code IndexAdd Tabnine to your IDE (free)

How to use
getXrefs
method
in
uk.ac.ebi.intact.model.AnnotatedObject

Best Java code snippets using uk.ac.ebi.intact.model.AnnotatedObject.getXrefs (Showing top 20 results out of 315)

origin: uk.ac.ebi.intact/intact-core

public static <X extends Xref> Collection<X> getIdentityXrefs(AnnotatedObject<X,?> annotatedObject) {
  Collection<X> xrefs = new ArrayList<X>();
  for (X xref : annotatedObject.getXrefs()) {
    CvXrefQualifier qualifier = xref.getCvXrefQualifier();
    if (qualifier != null &&
      CvObjectUtils.getPsiMiIdentityXref(qualifier).getPrimaryId().equals(CvXrefQualifier.IDENTITY_MI_REF)) {
      xrefs.add(xref);
    }
  }
  return xrefs;
}
origin: uk.ac.ebi.intact.app/data-conversion

private boolean hasPsiXref( AnnotatedObject annotatedObject, String psiId ) {
  boolean hasIt = false;
  if ( psiId == null ) {
    return false;
  }
  for ( Iterator iterator = annotatedObject.getXrefs().iterator(); iterator.hasNext() && false == hasIt; ) {
    Xref xref = (Xref) iterator.next();
    if ( xref.getCvDatabase().getShortLabel().equals( CvDatabase.PSI_MI ) ) {
      if ( psiId.equals( xref.getPrimaryId() ) ) {
        hasIt = true;
      }
    }
  }
  return hasIt;
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

private boolean hasPsiXref( AnnotatedObject annotatedObject, String psiId ) {
  boolean hasIt = false;
  if ( psiId == null ) {
    return false;
  }
  for ( Iterator iterator = annotatedObject.getXrefs().iterator(); iterator.hasNext() && false == hasIt; ) {
    Xref xref = (Xref) iterator.next();
    if ( xref.getCvDatabase().getShortLabel().equals( CvDatabase.PSI_MI ) ) {
      if ( psiId.equals( xref.getPrimaryId() ) ) {
        hasIt = true;
      }
    }
  }
  return hasIt;
}
origin: uk.ac.ebi.intact.util/data-conversion

private boolean hasPsiXref( AnnotatedObject annotatedObject, String psiId ) {
  boolean hasIt = false;
  if ( psiId == null ) {
    return false;
  }
  for ( Iterator iterator = annotatedObject.getXrefs().iterator(); iterator.hasNext() && false == hasIt; ) {
    Xref xref = (Xref) iterator.next();
    if ( xref.getCvDatabase().getShortLabel().equals( CvDatabase.PSI_MI ) ) {
      if ( psiId.equals( xref.getPrimaryId() ) ) {
        hasIt = true;
      }
    }
  }
  return hasIt;
}
origin: uk.ac.ebi.intact.core/intact-core

public static <X extends Xref> boolean hasIdentity(AnnotatedObject<X, ?> annotatedObject, String psiMi) {
  if (annotatedObject == null) {
    throw new NullPointerException("annotatedObject should not be null");
  }
  if (psiMi == null) {
    throw new NullPointerException("psiMi should not be null");
  }
  Collection<X> annotatedObjectXrefs = annotatedObject.getXrefs();
  for (X xref : annotatedObjectXrefs) {
    if (psiMi.equals(xref.getPrimaryId())) {
      if (CvXrefQualifier.IDENTITY_MI_REF.equals(psiMi)) {
        return true;
      }
      if (xref.getCvXrefQualifier() != null && hasIdentity(xref.getCvXrefQualifier(), CvXrefQualifier.IDENTITY_MI_REF)) {
        return true;
      }
    }
  }
  return false;
}
origin: uk.ac.ebi.intact.core/intact-core

public static <X extends Xref> X getIdentityXref(AnnotatedObject<X, ?> annotatedObject, String databaseMi) {
  for (X xref : annotatedObject.getXrefs()) {
    CvXrefQualifier qualifier = xref.getCvXrefQualifier();
    CvDatabase database = xref.getCvDatabase();
    String qualMi;
    String dbMi;
    if (qualifier != null && database != null &&
        (qualMi = qualifier.getIdentifier()) != null &&
        (dbMi = database.getIdentifier()) != null &&
        qualMi.equals(CvXrefQualifier.IDENTITY_MI_REF) &&
        dbMi.equals(databaseMi)) {
      return xref;
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

public static <X extends Xref> X getIdentityXref(AnnotatedObject<X, ?> annotatedObject, String databaseMi) {
  for (X xref : annotatedObject.getXrefs()) {
    CvXrefQualifier qualifier = xref.getCvXrefQualifier();
    CvDatabase database = xref.getCvDatabase();
    String qualMi;
    String dbMi;
    if (qualifier != null && database != null &&
        (qualMi = qualifier.getIdentifier()) != null &&
        (dbMi = database.getIdentifier()) != null &&
        qualMi.equals(CvXrefQualifier.IDENTITY_MI_REF) &&
        dbMi.equals(databaseMi)) {
      return xref;
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Retrieves the xrefs from an AnnotatedObject, initializing them if necessary.
 *
 * @param ao The annotated object instance with possibly non-initialized xrefs
 * @return The returned xrefs are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<? extends Xref> ensureInitializedXrefs(AnnotatedObject<?, ?> ao) {
  Collection<? extends Xref> xrefs;
  if (IntactCore.isInitialized(ao.getXrefs())) {
    xrefs = ao.getXrefs();
  } else {
    xrefs = IntactContext.getCurrentInstance().getDaoFactory().getXrefDao(AnnotatedObjectUtils.getXrefClassType(ao.getClass()))
        .getByParentAc(ao.getAc());
  }
  return xrefs;
}
origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

public <X extends Xref> void populateWithPsiMi(AnnotatedObject annotatedObject, String psiMi) {
  this.institution = annotatedObject.getOwner();
  Class<? extends Xref> xrefClass = AnnotatedObjectUtils.getXrefClassType(annotatedObject.getClass());
  X xref = (X) createPsiMiXref(xrefClass, psiMi);
  xref.setParent(annotatedObject);
  if (xref instanceof CvObjectXref) {
    if (((CvObject)annotatedObject).getIdentifier() == null) {
      ((CvObjectXref)xref).prepareParentMi();
    }
  }
  annotatedObject.getXrefs().add(xref);
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Retrieves the xrefs from an AnnotatedObject, initializing them if necessary.
 *
 * @param ao The annotated object instance with possibly non-initialized xrefs
 * @return The returned xrefs are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<? extends Xref> ensureInitializedXrefs(AnnotatedObject<?, ?> ao) {
  Collection<? extends Xref> xrefs;
  if (IntactCore.isInitialized(ao.getXrefs())) {
    xrefs = ao.getXrefs();
  } else {
    xrefs = IntactContext.getCurrentInstance().getDaoFactory().getXrefDao(AnnotatedObjectUtils.getXrefClassType(ao.getClass()))
        .getByParentAc(ao.getAc());
  }
  return xrefs;
}
origin: uk.ac.ebi.intact/intact-core

public static <X extends Xref> X getIdentityXref(AnnotatedObject<X,?> annotatedObject, CvDatabase cvDatabase) {
  String dbMi = CvObjectUtils.getPsiMiIdentityXref(cvDatabase).getPrimaryId();
  for (X xref : annotatedObject.getXrefs()) {
    CvXrefQualifier qualifier = xref.getCvXrefQualifier();
    if (qualifier != null &&
      CvObjectUtils.getPsiMiIdentityXref(qualifier).getPrimaryId().equals(CvXrefQualifier.IDENTITY_MI_REF) &&
      CvObjectUtils.getPsiMiIdentityXref(qualifier).getPrimaryId().equals(dbMi)) {
      return xref;
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.sanity/intact-sanity-rules

public Collection<GeneralMessage> check(AnnotatedObject<?,?> intactObject) throws SanityRuleException {
  Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>();
  for (Xref xref : intactObject.getXrefs()) {
    String primaryId = xref.getPrimaryId();
    String idValidationRegexp = getIdValidationRegexp(xref.getCvDatabase());
    if (idValidationRegexp != null && !primaryId.matches(idValidationRegexp)) {
      XrefMessage xrefMessage = new XrefMessage( MessageDefinition.XREF_INVALID_PRIMARYID, intactObject, xref);
      Field regexField = new Field();
      regexField.setName("Regexp");
      regexField.setValue(idValidationRegexp);
      xrefMessage.getInsaneObject().getFields().add(regexField);
      messages.add(xrefMessage);
    }
  }
  return messages;
}
origin: uk.ac.ebi.intact.core/intact-core

protected <X extends Xref, A extends Alias> void copyAnotatedObjectCommons( AnnotatedObject<X, A> source,
                                      AnnotatedObject<X, A> target ) {
  // if the source does not have an AC, we should not update the target shortLabel, fullName and owner
  // as it does not make much sense
  //if (source.getAc() != null) {
    copyProperty(source, "shortLabel", target);
    copyProperty(source, "fullName", target);
    copyProperty(source, "owner", target);
  //}
  copyXrefCollection( source.getXrefs(), target.getXrefs() );
  copyAliasCollection( source.getAliases(), target.getAliases(), source, target );
  copyAnnotationCollection( source.getAnnotations(), target.getAnnotations() );
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Initializes the AnnotatedObject collections (xrefs, aliases, annotations).
 *
 * @param ao The annotatedObject
 */
public static void initializeAnnotatedObject(AnnotatedObject ao) {
  initialize(ao.getXrefs());
  initialize(ao.getAliases());
  initialize(ao.getAnnotations());
}
origin: uk.ac.ebi.intact.core/intact-core

private <T extends AnnotatedObject> void initializeCommonsIfNecessary(T ao, T managedObject) {
  if (IntactCore.isInitialized(ao.getXrefs()))
    IntactCore.initialize(managedObject.getXrefs());
  if (IntactCore.isInitialized(ao.getAnnotations()))
    IntactCore.initialize(managedObject.getAnnotations());
  if (IntactCore.isInitialized(ao.getAliases())) {
    IntactCore.initialize(managedObject.getAliases());
  }
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

private <T extends AnnotatedObject> void initializeCommonsIfNecessary(T ao, T managedObject) {
  if (IntactCore.isInitialized(ao.getXrefs()))
    IntactCore.initialize(managedObject.getXrefs());
  if (IntactCore.isInitialized(ao.getAnnotations()))
    IntactCore.initialize(managedObject.getAnnotations());
  if (IntactCore.isInitialized(ao.getAliases())) {
    IntactCore.initialize(managedObject.getAliases());
  }
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Initializes the AnnotatedObject collections (xrefs, aliases, annotations).
 *
 * @param ao The annotatedObject
 */
public static void initializeAnnotatedObject(AnnotatedObject ao) {
  initialize(ao.getXrefs());
  initialize(ao.getAliases());
  initialize(ao.getAnnotations());
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

protected <X extends Xref, A extends Alias> void copyAnotatedObjectCommons( AnnotatedObject<X, A> source,
                                      AnnotatedObject<X, A> target ) {
  // if the source does not have an AC, we should not update the target shortLabel, fullName and owner
  // as it does not make much sense
  //if (source.getAc() != null) {
    copyProperty(source, "shortLabel", target);
    copyProperty(source, "fullName", target);
    copyProperty(source, "owner", target);
  //}
  copyXrefCollection( source.getXrefs(), target.getXrefs() );
  copyAliasCollection( source.getAliases(), target.getAliases(), source, target );
  copyAnnotationCollection( source.getAnnotations(), target.getAnnotations() );
}
origin: uk.ac.ebi.intact.core/intact-core

protected void traverseAnnotatedObjectCommon(AnnotatedObject ao, IntactVisitor ... visitors) {
  traverse(ao.getAnnotations(), visitors);
  traverse(ao.getAliases(), visitors);
  traverse(ao.getXrefs(), visitors);
  // check if this element has been traversed already, to avoid cyclic recursion
  if (recursionChecker.isAlreadyTraversed(ao)) {
    return;
  }
  traverse(ao.getOwner(), visitors);
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

protected void traverseAnnotatedObjectCommon(AnnotatedObject ao, IntactVisitor ... visitors) {
  traverse(ao.getAnnotations(), visitors);
  traverse(ao.getAliases(), visitors);
  traverse(ao.getXrefs(), visitors);
  // check if this element has been traversed already, to avoid cyclic recursion
  if (recursionChecker.isAlreadyTraversed(ao)) {
    return;
  }
  traverse(ao.getOwner(), visitors);
}
uk.ac.ebi.intact.modelAnnotatedObjectgetXrefs

Popular methods of AnnotatedObject

  • getAnnotations
  • getAc
  • getShortLabel
  • getAliases
  • getOwner
  • getFullName
  • getCreated
  • addAnnotation
  • setOwner
  • addAlias
  • addXref
  • setAc
  • addXref,
  • setAc,
  • setFullName,
  • setShortLabel,
  • getCreator,
  • removeAlias,
  • removeAnnotation,
  • removeXref,
  • setCreated

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now