Tabnine Logo
IntactContext.getInstitution
Code IndexAdd Tabnine to your IDE (free)

How to use
getInstitution
method
in
uk.ac.ebi.intact.core.context.IntactContext

Best Java code snippets using uk.ac.ebi.intact.core.context.IntactContext.getInstitution (Showing top 20 results out of 315)

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

@Deprecated
public CvXrefQualifier createIdentityCvXrefQualifier(IntactContext intactContext) {
  return createIdentityCvXrefQualifier(intactContext.getInstitution());
}
origin: uk.ac.ebi.intact.core/intact-core

@Deprecated
public CvXrefQualifier createIdentityCvXrefQualifier(IntactContext intactContext) {
  return createIdentityCvXrefQualifier(intactContext.getInstitution());
}
origin: uk.ac.ebi.intact.core/intact-core

@Deprecated
public CvDatabase createPsiMiCvDatabase(IntactContext intactContext) {
  return createPsiMiCvDatabase(intactContext.getInstitution());
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

@Deprecated
public CvDatabase createPsiMiCvDatabase(IntactContext intactContext) {
  return createPsiMiCvDatabase(intactContext.getInstitution());
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

private static CvFuzzyType createCvFuzzyType(String position) {
  if (position == null) {
    throw new IllegalArgumentException("The range position cannot be null.");
  }
  for (String key : rangeStatusMap.keySet()) {
    if (position.toLowerCase().contains(key)) {
      return rangeStatusMap.get(key);
    }
  }
  return CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvFuzzyType.class, CvFuzzyType.CERTAIN_MI_REF, CvFuzzyType.CERTAIN);
}
origin: uk.ac.ebi.intact.core/intact-core

private static CvFuzzyType createCvFuzzyType(String position) {
  if (position == null) {
    throw new IllegalArgumentException("The range position cannot be null.");
  }
  for (String key : rangeStatusMap.keySet()) {
    if (position.toLowerCase().contains(key)) {
      return rangeStatusMap.get(key);
    }
  }
  return CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvFuzzyType.class, CvFuzzyType.CERTAIN_MI_REF, CvFuzzyType.CERTAIN);
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

@PostConstruct
private void init() {
  this.nonMiCvDatabase = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(),
                             CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT );
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

public CvObjectOntologyBuilder( OBOSession oboSession_ ) {
  oboSession = oboSession_;
  this.nonMiCvDatabase = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(),
                             CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT );
  this.psimod = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(),
                        CvDatabase.class, CvDatabase.PSI_MOD_MI_REF, CvDatabase.PSI_MOD );
  this.processed = Maps.newHashMap();
  this.map4misWithMoreParent = Maps.newHashMap();
  map4misWithMoreParent = initializeMisWithMoreParents();
  if ( log.isDebugEnabled() ) {
    log.debug( "map4misWithMoreParent size " + map4misWithMoreParent.size() );
  }
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

protected Alias toAlias( CvObject cvobj, String aliasName ) {
  Institution owner = IntactContext.getCurrentInstance().getInstitution();
  CvAliasType alias = getCvObjectByLabel( CvAliasType.class, CvAliasType.GO_SYNONYM );
  if ( alias == null ) {
    if ( log.isTraceEnabled() ) log.trace( "alias ==null creating new" );
    alias = CvObjectUtils.createCvObject( owner, CvAliasType.class, CvAliasType.GO_SYNONYM_MI_REF, CvAliasType.GO_SYNONYM );
  }
  return AliasUtils.createAlias( cvobj, aliasName, alias );
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

protected Annotation toAnnotation( String cvTopic, String annotation ) {
  Institution owner = IntactContext.getCurrentInstance().getInstitution();
  CvTopic topic = getCvObjectByLabel( CvTopic.class, cvTopic );
  if ( topic == null ) {
    if ( CvTopic.URL.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.URL_MI_REF, CvTopic.URL );
    } else if ( CvTopic.SEARCH_URL.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.SEARCH_URL_MI_REF, CvTopic.SEARCH_URL );
    } else if ( CvTopic.XREF_VALIDATION_REGEXP.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.XREF_VALIDATION_REGEXP_MI_REF, CvTopic.XREF_VALIDATION_REGEXP );
    } else if ( CvTopic.COMMENT.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.COMMENT_MI_REF, CvTopic.COMMENT );
    } else if ( CvTopic.OBSOLETE.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.OBSOLETE_MI_REF, CvTopic.OBSOLETE );
      topic.setFullName( CvTopic.OBSOLETE );
    } else {
      log.error( "Unexpected topic found on annotation: " + cvTopic );
      return null;
    }
  }
  if ( log.isTraceEnabled() )
    log.debug( "Returning from toAnnotation: owner: " + owner + "  topic: " + topic + " annotation  " + annotation );
  return new Annotation( owner, topic, annotation );
}
origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

public Institution getDefaultInstitutionForAcs() {
  if (defaultInstitutionForAcs == null && IntactContext.currentInstanceExists()) {
    defaultInstitutionForAcs = IntactContext.getCurrentInstance().getInstitution();
    if (defaultInstitutionForAcs != null) {
      InstitutionXref xref = XrefUtils.getPsiMiIdentityXref(defaultInstitutionForAcs);
      if (xref != null) {
        defaultInstitutionPrimaryIdForAcs = xref.getPrimaryId();
      }
    }
  }
  return defaultInstitutionForAcs;
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 *
 * @param xref the xref to check
 * @return
 */
private boolean xrefPointsToOwnAc(Xref xref) {
  if (xref.getPrimaryId().startsWith(config.getAcPrefix())) {
    return true;
  } else {
    for (InstitutionXref institutionXref : IntactContext.getCurrentInstance().getInstitution().getXrefs()) {
      if (institutionXref.getPrimaryId().equals(xref.getCvDatabase().getIdentifier())) {
        return true;
      }
    }
    return false;
  }
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 *
 * @param xref the xref to check
 * @return
 */
private boolean xrefPointsToOwnAc(Xref xref) {
  if (xref.getPrimaryId().startsWith(config.getAcPrefix())) {
    return true;
  } else {
    for (InstitutionXref institutionXref : IntactContext.getCurrentInstance().getInstitution().getXrefs()) {
      if (institutionXref.getPrimaryId().equals(xref.getCvDatabase().getIdentifier())) {
        return true;
      }
    }
    return false;
  }
}
origin: uk.ac.ebi.intact.core/intact-core

public static <X extends Xref> X createIdentityXref(AnnotatedObject<X, ?> parent, String primaryId, CvXrefQualifier identityQual, CvDatabase cvDatabase) {
  X xref = (X) newXrefInstanceFor(parent.getClass());
  Institution owner = parent.getOwner();
  if (owner == null) {
    owner = IntactContext.getCurrentInstance().getInstitution();
  }
  xref.setOwner(owner);
  xref.setCvDatabase(cvDatabase);
  xref.setCvXrefQualifier(identityQual);
  xref.setPrimaryId(primaryId);
  xref.setParent(parent);
  return xref;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

public static <X extends Xref> X createIdentityXref(AnnotatedObject<X, ?> parent, String primaryId, CvXrefQualifier identityQual, CvDatabase cvDatabase) {
  X xref = (X) newXrefInstanceFor(parent.getClass());
  Institution owner = parent.getOwner();
  if (owner == null) {
    owner = IntactContext.getCurrentInstance().getInstitution();
  }
  xref.setOwner(owner);
  xref.setCvDatabase(cvDatabase);
  xref.setCvXrefQualifier(identityQual);
  xref.setPrimaryId(primaryId);
  xref.setParent(parent);
  return xref;
}
origin: uk.ac.ebi.intact.dbupdate/protein-mapping

/**
 * Create a new InteractorXref for the protein
 * @param uniprotAc : the uniprot accession
 * @return the InteractorXref with the uniprot ac and qualifier identity
 */
private InteractorXref createIdentityInteractorXrefForUniprotAc(String uniprotAc){
  IntactContext intactContext = IntactContext.getCurrentInstance();
  if (uniprotAc == null){
    return null;
  }
  final CvDatabase uniprot = intactContext.getDaoFactory().getCvObjectDao(CvDatabase.class).getByPsiMiRef( CvDatabase.UNIPROT_MI_REF );
  final CvXrefQualifier identity = intactContext.getDaoFactory().getCvObjectDao(CvXrefQualifier.class).getByPsiMiRef(CvXrefQualifier.IDENTITY_MI_REF);
  InteractorXref xRef = new InteractorXref(intactContext.getInstitution(), uniprot, uniprotAc, identity);
  return xRef;
}
origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

public static CvObjectXref createSecondaryXref(CvDagObject term, String database, String identifier) {
  DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory();
  CvObjectXref cvXref;
  CvXrefQualifier secondary = factory.getCvObjectDao(CvXrefQualifier.class).getByPsiMiRef(CvXrefQualifier.SECONDARY_AC_MI_REF);
  CvDatabase db = factory.getCvObjectDao(CvDatabase.class).getByPsiMiRef(database);
  if (secondary == null){
    secondary = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvXrefQualifier.class, CvXrefQualifier.SECONDARY_AC_MI_REF, CvXrefQualifier.SECONDARY_AC);
    IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(secondary);
  }
  if (db == null){
    db = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvDatabase.class, database, database);
    IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(db);
  }
  // create identity xref
  cvXref = XrefUtils.createIdentityXref(term, identifier, secondary, db);
  term.addXref(cvXref);
  return cvXref;
}
origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

public static CvObjectXref createIdentityXref(CvDagObject term, String database, String identifier) {
  DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory();
  CvObjectXref cvXref;
  CvXrefQualifier identity = factory.getCvObjectDao(CvXrefQualifier.class).getByPsiMiRef(CvXrefQualifier.IDENTITY_MI_REF);
  CvDatabase db = factory.getCvObjectDao(CvDatabase.class).getByPsiMiRef(database);
  if (identity == null){
    identity = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvXrefQualifier.class, CvXrefQualifier.IDENTITY_MI_REF, CvXrefQualifier.IDENTITY);
    IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(identity);
  }
  if (db == null){
    db = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvDatabase.class, database, database);
    IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(db);
  }
  // create identity xref
  cvXref = XrefUtils.createIdentityXref(term, identifier, identity, db);
  term.addXref(cvXref);
  return cvXref;
}
origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

public static Annotation hideTerm(CvObject c, String message){
  DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory();
  CvTopic topicFromDb = factory.getCvObjectDao(CvTopic.class).getByShortLabel(CvTopic.HIDDEN);
  if (topicFromDb == null){
    topicFromDb = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvTopic.class, null, CvTopic.HIDDEN);
    IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(topicFromDb);
  }
  Annotation newAnnotation = new Annotation(topicFromDb, message);
  c.addAnnotation(newAnnotation);
  return newAnnotation;
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

private CvTopic createCvTopicObsolete() {
  final DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory();
  if ( obsoleteTopic != null ) {
    if (daoFactory.getBaseDao().isTransient(obsoleteTopic) && obsoleteTopic.getAc() != null) {
      obsoleteTopic = daoFactory.getCvObjectDao( CvTopic.class ).getByAc( obsoleteTopic.getAc() );
    }
  } else {
    obsoleteTopic = daoFactory.getCvObjectDao( CvTopic.class ).getByPsiMiRef( CvTopic.OBSOLETE_MI_REF );
  }
  if ( obsoleteTopic == null ) {
    // create the obsolete term (which is obsolete too!)
    obsoleteTopic = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(), CvTopic.class, CvTopic.OBSOLETE_MI_REF, CvTopic.OBSOLETE );
    obsoleteTopic.setFullName( "obsolete term" );
    addObsoleteAnnotation( obsoleteTopic, "Deprecated CV term that should not be used to annotate entries" );
  }
  return obsoleteTopic;
}
uk.ac.ebi.intact.core.contextIntactContextgetInstitution

Javadoc

Gets the institution from the RuntimeConfig object. In addition, tries to refresh the instance from the database if it is detached.

Popular methods of IntactContext

  • getCurrentInstance
    Gets the current (ThreadLocal) instance of IntactContext. If no such instance exist, IntAct Core wil
  • getDataContext
  • getDaoFactory
  • getCorePersister
  • currentInstanceExists
    Checks if an instance already exists.
  • getSpringContext
  • getLifecycleManager
    Gets the lifecycle manager for publications.
  • getPersisterHelper
  • initContext
    Initializes a standalone context.
  • bindToApplication
  • getApplication
  • getConfig
  • getApplication,
  • getConfig,
  • getConfigurationHandler,
  • getCoreDeleter,
  • getUserContext,
  • initStandaloneContextInMemory,
  • setApplication

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Notification (javax.management)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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