public CvExperimentalRole getEnzymeTarget() throws IntactException { return getByMiRef( CvExperimentalRole.class, CvExperimentalRole.ENZYME_TARGET_PSI_REF ); }
public void loadCommonCvObjects() { getByMiRef( CvDatabase.class, CvDatabase.INTACT_MI_REF ); getByMiRef( CvDatabase.class, CvDatabase.GO_MI_REF ); getByMiRef( CvDatabase.class, CvDatabase.INTERPRO_MI_REF ); getByMiRef( CvDatabase.class, CvDatabase.FLYBASE_MI_REF ); getByMiRef( CvDatabase.class, CvDatabase.REACTOME_PROTEIN_PSI_REF ); getByMiRef( CvDatabase.class, CvDatabase.HUGE_MI_REF ); getByMiRef( CvXrefQualifier.class, CvXrefQualifier.IDENTITY_MI_REF ); getByMiRef( CvXrefQualifier.class, CvXrefQualifier.SECONDARY_AC_MI_REF ); getByMiRef( CvXrefQualifier.class, CvXrefQualifier.ISOFORM_PARENT_MI_REF ); // only one search by shortlabel as it still doesn't have MI number. getByLabel( CvTopic.class, CvTopic.ISOFORM_COMMENT ); getByLabel( CvTopic.class, CvTopic.NON_UNIPROT ); getByMiRef( CvAliasType.class, CvAliasType.GENE_NAME_MI_REF ); getByMiRef( CvAliasType.class, CvAliasType.GENE_NAME_SYNONYM_MI_REF ); getByMiRef( CvAliasType.class, CvAliasType.ISOFORM_SYNONYM_MI_REF ); getByMiRef( CvAliasType.class, CvAliasType.LOCUS_NAME_MI_REF ); getByMiRef( CvAliasType.class, CvAliasType.ORF_NAME_MI_REF ); getByMiRef( CvInteractorType.class, CvInteractorType.getProteinMI() ); }
private void clearCvContext() { CvContext.getCurrentInstance(session).clearCache(); }
public <T extends CvObject> T getByLabel( Class<T> cvType, String label ) { return getByLabel( cvType, label, false ); }
newCvObject = IntactContext.getCurrentInstance().getCvContext().getUnspecified(); } else if ( hasPsiXref( cvObject, CvComponentRole.PREY_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getUnspecified(); } else if ( hasPsiXref( cvObject, CvComponentRole.NEUTRAL_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getUnspecified(); } else if ( hasPsiXref( cvObject, CvComponentRole.SELF_PSI_REF ) ) { newCvObject = cvObject;
newCvObject = cvObject; } else if ( hasPsiXref( cvObject, CvComponentRole.ENZYME_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getNeutral(); } else if ( hasPsiXref( cvObject, CvComponentRole.ENZYME_TARGET_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getNeutral(); } else if ( hasPsiXref( cvObject, CvComponentRole.UNSPECIFIED_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getNeutral(); } else {
public static CvContext getCurrentInstance( IntactSession session ) { CvContext cvContext; if (session.isWebapp()) { cvContext = ( CvContext ) session.getApplicationAttribute(SESSION_PARAM_NAME); } else { cvContext = ( CvContext ) session.getAttribute(SESSION_PARAM_NAME); } if ( cvContext == null ) { log.debug( "Creating new CvContext" ); cvContext = new CvContext( session ); if (session.isWebapp()) { session.setApplicationAttribute(SESSION_PARAM_NAME, cvContext ); } else { session.setAttribute(SESSION_PARAM_NAME, cvContext ); } } // check if the transaction /* String oldTransactionId = (String) session.getAttribute(CURRENT_TRANS_ID); String transactionId = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCurrentTransaction().getId(); if (oldTransactionId != null && !oldTransactionId.equals(transactionId)) { if (log.isDebugEnabled()) log.debug("CvContext cache is stale"); cvContext.clearCache(); } session.setAttribute(CURRENT_TRANS_ID, transactionId); */ return cvContext; }
/** * Answers the question: is that AnnotatedObject (Interaction, Experiment) annotated as negative ? * * @param annotatedObject the object we want to introspect * * @return true if the object is annotated with the 'negative' CvTopic, otherwise false. */ public boolean isNegative(AnnotatedObject annotatedObject) { boolean isNegative = false; Collection<Annotation> annotations = annotatedObject.getAnnotations(); for (Iterator<Annotation> iterator = annotations.iterator(); iterator.hasNext() && false == isNegative;) { Annotation annotation = iterator.next(); if (getCvContext().getByLabel(CvTopic.class, CvTopic.NEGATIVE).equals(annotation.getCvTopic())) { isNegative = true; } } return isNegative; }
newCvObject = IntactContext.getCurrentInstance().getCvContext().getUnspecified(); } else if ( hasPsiXref( cvObject, CvComponentRole.PREY_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getUnspecified(); } else if ( hasPsiXref( cvObject, CvComponentRole.NEUTRAL_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getUnspecified(); } else if ( hasPsiXref( cvObject, CvComponentRole.SELF_PSI_REF ) ) { newCvObject = cvObject;
newCvObject = cvObject; } else if ( hasPsiXref( cvObject, CvComponentRole.ENZYME_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getNeutral(); } else if ( hasPsiXref( cvObject, CvComponentRole.ENZYME_TARGET_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getNeutral(); } else if ( hasPsiXref( cvObject, CvComponentRole.UNSPECIFIED_PSI_REF ) ) { newCvObject = IntactContext.getCurrentInstance().getCvContext().getNeutral(); } else {
public CvExperimentalRole getPrey() throws IntactException { return getByMiRef( CvExperimentalRole.class, CvExperimentalRole.PREY_PSI_REF ); }
private static void initialise( ) { if ( initialisationDone == false ) { CvContext cvContext = IntactContext.getCurrentInstance().getCvContext(); // load CVs by shortlabel authorConfidenceTopic = cvContext.getByMiRef(CvTopic.class, CvTopic.AUTHOR_CONFIDENCE_MI_REF); noUniprotUpdate = cvContext.getByLabel(CvTopic.class, CvTopic.NON_UNIPROT); // load CVs by MI reference primaryReferenceXrefQualifier = cvContext.getByMiRef( CvXrefQualifier.class, CvXrefQualifier.PRIMARY_REFERENCE_MI_REF ); seeAlsoXrefQualifier = cvContext.getByMiRef( CvXrefQualifier.class, CvXrefQualifier.SEE_ALSO_MI_REF ); identityXrefQualifier = cvContext.getByMiRef( CvXrefQualifier.class, CvXrefQualifier.IDENTITY_MI_REF ); geneName = cvContext.getByMiRef(CvAliasType.class, CvAliasType.GENE_NAME_MI_REF ); initialisationDone = true; } } // init
/** * Checks if the protein has been annotated with the no-uniprot-update CvTopic, if so, return false, otherwise true. * That flag is added to a protein when created via the editor. As some protein may have a UniProt ID as identity we * don't want those to be overwitten. * * @param protein the protein to check * * @return false if no Annotation having CvTopic( no-uniprot-update ), otherwise true. */ protected boolean needsUniprotUpdate(final Protein protein) { boolean needsUpdate = true; CvTopic noUniprotUpdate = getCvContext().getByLabel(CvTopic.class, CvTopic.NON_UNIPROT); if (null == noUniprotUpdate) { // in case the term hasn't been created, assume there are no proteins created via editor. return true; } for (Iterator<Annotation> iterator = protein.getAnnotations().iterator(); iterator.hasNext() && true == needsUpdate;) { Annotation annotation = iterator.next(); if (noUniprotUpdate.equals(annotation.getCvTopic())) { needsUpdate = false; } } return needsUpdate; }
public CvExperimentalRole getEnzyme() throws IntactException { return getByMiRef( CvExperimentalRole.class, CvExperimentalRole.ENZYME_PSI_REF ); }
private static void initialise( ) { if ( initialisationDone == false ) { CvContext cvContext = IntactContext.getCurrentInstance().getCvContext(); // load CVs by shortlabel authorConfidenceTopic = cvContext.getByMiRef(CvTopic.class, CvTopic.AUTHOR_CONFIDENCE_MI_REF); noUniprotUpdate = cvContext.getByLabel(CvTopic.class, CvTopic.NON_UNIPROT); // load CVs by MI reference primaryReferenceXrefQualifier = cvContext.getByMiRef( CvXrefQualifier.class, CvXrefQualifier.PRIMARY_REFERENCE_MI_REF ); seeAlsoXrefQualifier = cvContext.getByMiRef( CvXrefQualifier.class, CvXrefQualifier.SEE_ALSO_MI_REF ); identityXrefQualifier = cvContext.getByMiRef( CvXrefQualifier.class, CvXrefQualifier.IDENTITY_MI_REF ); geneName = cvContext.getByMiRef(CvAliasType.class, CvAliasType.GENE_NAME_MI_REF ); initialisationDone = true; } } // init
/** * @param interaction * * @return */ protected Collection<String> getCCnote(Interaction interaction) { Collection<String> notes = null; for (Annotation annotation : interaction.getAnnotations()) { if (getCvContext().getByLabel(CvTopic.class, CvTopic.CC_NOTE).equals(annotation.getCvTopic())) { if (notes == null) { notes = new ArrayList<String>(2); // should rarely have more than 2 } notes.add(annotation.getAnnotationText()); } } return notes; }
public <T extends CvObject> T getByMiRef( Class<T> cvType, String miRef ) { return getByMiRef( cvType, miRef, false ); }
cv = IntactContext.getCurrentInstance().getCvContext().getByMiRef(clazz, mi); if (cv == null) { out.println("ERROR: The MI reference you gave doesn't exists. Using the shortlabel instead."); cv = IntactContext.getCurrentInstance().getCvContext().getByLabel(clazz, shortlabel);
cvComponentRole = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvComponentRole.class, role); cvComponentRole = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvComponentRole.class, CvComponentRole.NEUTRAL ); if ( cvComponentRole == null ) { cvComponentRole = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvComponentRole.class, role );
public CvExperimentalRole getBait() throws IntactException { return getByMiRef( CvExperimentalRole.class, CvExperimentalRole.BAIT_PSI_REF ); }