Tabnine Logo
AnnotationDao
Code IndexAdd Tabnine to your IDE (free)

How to use
AnnotationDao
in
uk.ac.ebi.intact.core.persistence.dao

Best Java code snippets using uk.ac.ebi.intact.core.persistence.dao.AnnotationDao (Showing top 15 results out of 315)

origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

@Transactional(propagation = Propagation.REQUIRES_NEW)
/**
 * Delete hidden annotations for each cv given in the collection
 */
public void removeHiddenFrom(Collection<CvObject> cvs){
  DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory();
  AnnotationDao annDao = factory.getAnnotationDao();
  for (CvObject cv : cvs){
    cv = factory.getEntityManager().merge(cv);
    Collection<Annotation> annotations = new ArrayList<Annotation>(cv.getAnnotations());
    for (Annotation annotation : annotations){
      if (annotation.getCvTopic() != null && CvTopic.HIDDEN.equalsIgnoreCase(annotation.getCvTopic().getShortLabel())){
        cv.removeAnnotation(annotation);
        annDao.delete(annotation);
      }
    }
  }
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Prints the most counts in the database.
 * @param ps The printStream to use
 *
 * @since 1.9.0
 */
public static void printDatabaseCounts(PrintStream ps) {
  final DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory();
  ps.println("Publications: "+ daoFactory.getPublicationDao().countAll());
  ps.println("\tXrefs: "+ daoFactory.getXrefDao(PublicationXref.class).countAll());
  ps.println("\tAliases: "+ daoFactory.getAliasDao(PublicationAlias.class).countAll());
  ps.println("Experiments: "+ daoFactory.getExperimentDao().countAll());
  ps.println("\tXrefs: "+ daoFactory.getXrefDao(ExperimentXref.class).countAll());
  ps.println("\tAliases: "+ daoFactory.getAliasDao(ExperimentAlias.class).countAll());
  ps.println("Interactors: "+ daoFactory.getInteractorDao().countAll());
  ps.println("\tInteractions: "+ daoFactory.getInteractionDao().countAll());
  ps.println("\tPolymers: " + daoFactory.getPolymerDao().countAll());
  ps.println("\t\tProteins: "+ daoFactory.getProteinDao().countAll());
  ps.println("\t\tNucleic Acids: "+ daoFactory.getInteractorDao(NucleicAcidImpl.class).countAll());
  ps.println("\tSmall molecules: " + daoFactory.getInteractorDao(SmallMoleculeImpl.class).countAll());
  ps.println("\tInteractor Xrefs: "+ daoFactory.getXrefDao(InteractorXref.class).countAll());
  ps.println("\tInteractor Aliases: "+ daoFactory.getAliasDao(InteractorAlias.class).countAll());
  ps.println("Components: "+ daoFactory.getComponentDao().countAll());
  ps.println("Features: "+ daoFactory.getFeatureDao().countAll());
  ps.println("\tRanges: "+ daoFactory.getRangeDao().countAll());
  ps.println("CvObjects: "+ daoFactory.getCvObjectDao().countAll());
  ps.println("BioSources: "+ daoFactory.getBioSourceDao().countAll());
  ps.println("Annotations: "+ daoFactory.getAnnotationDao().countAll());
  ps.println("Institutions: "+ daoFactory.getInstitutionDao().countAll());
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Retrieves the annotations from an AnnotatedObject, initializing them if necessary.
 *
 * @param ao The annotated object instance with possibly non-initialized annotations
 * @return The returned annotations are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<Annotation> ensureInitializedAnnotations(AnnotatedObject ao) {
  Collection<Annotation> annotations;
  if (IntactCore.isInitialized(ao.getAnnotations())) {
    annotations = ao.getAnnotations();
  } else {
    annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(ao.getClass(), ao.getAc());
  }
  return annotations;
}
origin: uk.ac.ebi.intact.bridges.coredep/intact-cdb

IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation );
  IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().update( annotation );
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().delete( annotation );
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().update( annot );
containsAnnotation = true;
break;
origin: uk.ac.ebi.intact.core/intact-core-readonly

private Annotation synchronizeAnnotation( Annotation annotation, AnnotatedObject parent ) {
  if (annotation.getAc() != null) {
    return IntactContext.getCurrentInstance().getDataContext().getDaoFactory()
        .getAnnotationDao().getByAc(annotation.getAc());
  }
  else {
  }
  annotation.setCvTopic( synchronize( annotation.getCvTopic() ) );
  if (annotation.getAc() == null && parent.getAc() != null) {
    annotatedObjectsToPersist.put(keyBuilder.keyForAnnotation(annotation, parent), annotation);
  }
  return annotation;
}
origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

@Transactional(propagation = Propagation.REQUIRES_NEW)
/**
 * Hide all the given cvs with the given message
 */
public void hideTerms(Collection<CvObject> cvs, String message){
  DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory();
  AnnotationDao annDao = factory.getAnnotationDao();
  for (CvObject cv : cvs){
    cv = factory.getEntityManager().merge(cv);
    boolean hasHidden = false;
    for (Annotation annotation : cv.getAnnotations()){
      if (annotation.getCvTopic() != null && CvTopic.HIDDEN.equalsIgnoreCase(annotation.getCvTopic().getShortLabel())){
        hasHidden = true;
      }
    }
    if (!hasHidden){
      annDao.persist(CvUpdateUtils.hideTerm(cv, message));
    }
  }
}
origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

annotationDao.update(updated);
annotationDao.persist(created);
annotationDao.delete(deleted);
origin: uk.ac.ebi.intact.core/intact-core

private Annotation synchronizeAnnotation( Annotation annotation, AnnotatedObject parent ) {
  if (annotation.getAc() != null) {
    return IntactContext.getCurrentInstance().getDataContext().getDaoFactory()
        .getAnnotationDao().getByAc(annotation.getAc());
  }
  else {
  }
  annotation.setCvTopic( synchronize( annotation.getCvTopic() ) );
  if (annotation.getAc() == null && parent.getAc() != null) {
    annotatedObjectsToPersist.put(keyBuilder.keyForAnnotation(annotation, parent), annotation);
  }
  return annotation;
}
origin: uk.ac.ebi.intact.bridges.coredep/intact-cdb

if ( ! experiment.getAnnotations().contains( annotation ) ) {
  IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation );
  experiment.addAnnotation( annotation );
  IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getExperimentDao().update( experiment );
origin: uk.ac.ebi.intact.dbupdate/protein-mapping

log.info("annotation no_uniprot_update removed from the annotations of " + accession);
prot.removeAnnotation(a);
daoFactory.getAnnotationDao().delete(a);
log.info("caution removed from the annotations of " + accession);
prot.removeAnnotation(a2);
daoFactory.getAnnotationDao().delete(a2);
origin: uk.ac.ebi.intact.core/intact-core

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

/**
 * Prints the most counts in the database.
 * @param ps The printStream to use
 *
 * @since 1.9.0
 */
public static void printDatabaseCounts(PrintStream ps) {
  final DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory();
  ps.println("Publications: "+ daoFactory.getPublicationDao().countAll());
  ps.println("\tXrefs: "+ daoFactory.getXrefDao(PublicationXref.class).countAll());
  ps.println("\tAliases: "+ daoFactory.getAliasDao(PublicationAlias.class).countAll());
  ps.println("Experiments: "+ daoFactory.getExperimentDao().countAll());
  ps.println("\tXrefs: "+ daoFactory.getXrefDao(ExperimentXref.class).countAll());
  ps.println("\tAliases: "+ daoFactory.getAliasDao(ExperimentAlias.class).countAll());
  ps.println("Interactors: "+ daoFactory.getInteractorDao().countAll());
  ps.println("\tInteractions: "+ daoFactory.getInteractionDao().countAll());
  ps.println("\tPolymers: " + daoFactory.getPolymerDao().countAll());
  ps.println("\t\tProteins: "+ daoFactory.getProteinDao().countAll());
  ps.println("\t\tNucleic Acids: "+ daoFactory.getInteractorDao(NucleicAcidImpl.class).countAll());
  ps.println("\tSmall molecules: " + daoFactory.getInteractorDao(SmallMoleculeImpl.class).countAll());
  ps.println("\tInteractor Xrefs: "+ daoFactory.getXrefDao(InteractorXref.class).countAll());
  ps.println("\tInteractor Aliases: "+ daoFactory.getAliasDao(InteractorAlias.class).countAll());
  ps.println("Components: "+ daoFactory.getComponentDao().countAll());
  ps.println("Features: "+ daoFactory.getFeatureDao().countAll());
  ps.println("\tRanges: "+ daoFactory.getRangeDao().countAll());
  ps.println("CvObjects: "+ daoFactory.getCvObjectDao().countAll());
  ps.println("BioSources: "+ daoFactory.getBioSourceDao().countAll());
  ps.println("Annotations: "+ daoFactory.getAnnotationDao().countAll());
  ps.println("Institutions: "+ daoFactory.getInstitutionDao().countAll());
}
origin: uk.ac.ebi.intact.core/intact-core

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-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;
}
uk.ac.ebi.intact.core.persistence.daoAnnotationDao

Most used methods

  • delete
  • update
  • countAll
  • getByAc
  • getByParentAc
    Fetches the annotations using its parent AC.
  • persist

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JComboBox (javax.swing)
  • Github Copilot alternatives
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