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

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

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

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

/**
 * @since 2.4.0
 */
public CoreDeleter getCoreDeleter() {
  return (CoreDeleter) IntactContext.getCurrentInstance().getSpringContext().getBean("coreDeleter");
}
origin: uk.ac.ebi.intact.core/intact-core

  @Deprecated
  public CorePersister getCorePersister() {
    return IntactContext.getCurrentInstance().getCorePersister();
  }
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

  @Deprecated
  public CorePersister getCorePersister() {
    return IntactContext.getCurrentInstance().getCorePersister();
  }
}
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.dataexchange.uniprotexport/intact-uniprot-export

public List<String> getInferredInteractions() {
  DataContext dataContext = IntactContext.getCurrentInstance().getDataContext();
  TransactionStatus transactionStatus = dataContext.beginTransaction();
  Query query = IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().createQuery(inferredInteractions);
  query.setParameter("inferred_author", INFERRED_AUTHOR);
  query.setParameter("inferred_curator", CvInteraction.INFERRED_BY_CURATOR_MI_REF);
  List<String> interactions = query.getResultList();
  dataContext.commitTransaction(transactionStatus);
  return interactions;
}
origin: uk.ac.ebi.intact.dataexchange.uniprotexport/intact-uniprot-export

public List<String> getInteractionsFromExperimentExportSpecified() {
  DataContext dataContext = IntactContext.getCurrentInstance().getDataContext();
  TransactionStatus transactionStatus = dataContext.beginTransaction();
  Query query = IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().createQuery(interactionsFromExperimentExportSpecified);
  query.setParameter("drExport", CvTopic.UNIPROT_DR_EXPORT);
  List<String> interactions = query.getResultList();
  dataContext.commitTransaction(transactionStatus);
  return interactions;
}
origin: uk.ac.ebi.intact.core/intact-core

@Override
@Transactional
public Institution convertFromString(String str) {
  if (str == null) return null;
  return IntactContext.getCurrentInstance().getDaoFactory().getInstitutionDao().getByShortLabel(str);
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

protected Map<String, Class> getMapOfExistingCvs() {
  Map<String, Class> existingMi2Class = new HashMap<String, Class>();
  List<CvObject> allExistingCvs = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao().getAll();
  for ( CvObject cvObject : allExistingCvs ) {
    existingMi2Class.put( CvObjectUtils.getIdentity( cvObject ), cvObject.getClass() );
  }
  return existingMi2Class;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Checks if the object is managed.
 * @param io the IntactObject
 * @return true is the object is found to be managed, otherwise false.
 */
public static boolean isManaged( IntactObject io ) {
  return IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().contains( io );
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

public SearchableDao getDao() {
  if (searchableDao == null) {
    searchableDao = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getSearchableDao();
  }
  return searchableDao;
}
origin: uk.ac.ebi.intact.dbupdate/intact-datasets-update

private List<Publication> getPublicationsContainingComponents(Collection<String> intactAccession) throws DatasetException {
  // get the intact datacontext and daofactory
  final DataContext dataContext = IntactContext.getCurrentInstance().getDataContext();
  final DaoFactory daoFactory = dataContext.getDaoFactory();
  // This query is looking for all experiences with at least one interaction involving the component of interest
  String componentQuery = "select i.ac from InteractionImpl i join i.components as c " +
      "where c.ac in (:accession)";
  return getPublicationsWithSpecificSelection(componentQuery, intactAccession, daoFactory);
}
origin: uk.ac.ebi.intact.core/intact-core

public Collection<String> getNucleicAcidMIs() {
   final CvObjectDao<CvInteractorType> itdao = IntactContext.getCurrentInstance().getDataContext()
        .getDaoFactory().getCvObjectDao( CvInteractorType.class);
  // 1. load the root term
  CvInteractorType root = itdao.getByPsiMiRef( CvInteractorType.NUCLEIC_ACID_MI_REF );
  Collection<String> collectedMIs = new ArrayList<String>( );
  if( root != null ) {
    // 2. traverse children and collect their MIs
    CvObjectUtils.getChildrenMIs( root, collectedMIs );
  }
  
  return collectedMIs;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

protected void changeStatus(Publication publication, String cvPublicationStatusIdentifier) {
  IntactContext intactContext = IntactContext.getCurrentInstance();
  final CvObjectDao<CvPublicationStatus> cvObjectDao = intactContext.getDaoFactory().getCvObjectDao( CvPublicationStatus.class );
  CvPublicationStatus publicationStatus = cvObjectDao.getByIdentifier( cvPublicationStatusIdentifier );
  publication.setStatus(publicationStatus);
}
origin: uk.ac.ebi.intact.core/intact-core

private Collection<Confidence> synchronizeConfidences( Collection<Confidence> confidencesToSynchronize, Interaction parentInteraction ) {
  List<Confidence> confidences = new ArrayList<Confidence>(confidencesToSynchronize.size());
  for ( Confidence confidence : confidencesToSynchronize ) {
    if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().isTransient(confidence)) {
      confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().getByAc(confidence.getAc());
    }
    confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType()));
    confidence.setInteraction((InteractionImpl)parentInteraction);
    confidences.add(confidence);
  }
  return confidences;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

private Collection<Confidence> synchronizeConfidences( Collection<Confidence> confidencesToSynchronize, Interaction parentInteraction ) {
  List<Confidence> confidences = new ArrayList<Confidence>(confidencesToSynchronize.size());
  for ( Confidence confidence : confidencesToSynchronize ) {
    if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().isTransient(confidence)) {
      confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().getByAc(confidence.getAc());
    }
    confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType()));
    confidence.setInteraction((InteractionImpl)parentInteraction);
    confidences.add(confidence);
  }
  return confidences;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

public Publication createPublication(String pmid) {
  Publication pub = new Publication(getInstitution(), pmid);
  IntactContext.getCurrentInstance().getLifecycleManager().getStartStatus().create(pub, "Mock builder");
  return pub;
}
origin: uk.ac.ebi.intact.core/intact-core

private SelectionRandomizer<User> createSelectionRandomizer() {
  SelectionRandomizer<User> selectionRandomizer = new SelectionRandomizer<User>();
  List<User> reviewers = IntactContext.getCurrentInstance().getDaoFactory().getUserDao().getByRole(Role.ROLE_REVIEWER);
  for (User reviewer : reviewers) {
    Integer availability = UserUtils.getReviewerAvailability(reviewer);
    selectionRandomizer.addObject(reviewer, availability);
  }
  return selectionRandomizer;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

private static Collection<Annotation> fetchAnnotations(Interaction interaction) {
  Collection<Annotation> annotations;
  if (IntactCore.isInitialized(interaction.getAnnotations())) {
    annotations = interaction.getAnnotations();
  } else {
    annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(InteractionImpl.class, interaction.getAc());
  }
  return annotations;
}
origin: uk.ac.ebi.intact.core/intact-core

private Alias synchronizeAlias( Alias alias, AnnotatedObject parent ) {
  if (alias.getAc() != null) {
    return IntactContext.getCurrentInstance().getDataContext().getDaoFactory()
        .getAliasDao().getByAc(alias.getAc());
  }
  alias.setCvAliasType( synchronize( alias.getCvAliasType() ) );
  alias.setParent(parent);
  if (alias.getAc() == null && parent.getAc() != null) {
    annotatedObjectsToPersist.put(keyBuilder.keyForAlias(alias), alias);
  }
  return alias;
}
origin: uk.ac.ebi.intact.core/intact-core

private static void addStartAndEndPercentIfNecessary( QueryTerm term ) {
  if ( term.hasModifier( QueryModifier.PHRASE_DELIM ) ) {
    return;
  }
  String acPrefix = IntactContext.getCurrentInstance().getConfig().getAcPrefix();
  if ( !term.startsWith( acPrefix ) && !term.hasModifier( QueryModifier.WILDCARD_START ) ) {
    term.addModifier( QueryModifier.WILDCARD_START );
  }
  if ( !term.startsWith( acPrefix ) && !term.hasModifier( QueryModifier.WILDCARD_END ) ) {
    term.addModifier( QueryModifier.WILDCARD_END );
  }
}
uk.ac.ebi.intact.core.contextIntactContextgetCurrentInstance

Javadoc

Gets the current (ThreadLocal) instance of IntactContext. If no such instance exist, IntAct Core will be automatically initialized using JPA configurations in the classpath, configured DataConfigs and, if these are not found, using a temporary database.

Popular methods of IntactContext

  • getDataContext
  • getInstitution
    Gets the institution from the RuntimeConfig object. In addition, tries to refresh the instance from
  • 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

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Top 12 Jupyter Notebook extensions
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