public <T extends CvObject> T getByLabel( Class<T> cvType, String label ) { return getByLabel( cvType, label, false ); }
/** * 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; }
cv = IntactContext.getCurrentInstance().getCvContext().getByLabel(clazz, shortlabel);
/** * 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; }
/** * @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; }
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 );
if (getCvContext().getByLabel(CvTopic.class, CvTopic.UNIPROT_DR_EXPORT).equals(annotation.getCvTopic())) {
public static void check( final XrefTag xref ) { final String db = xref.getDb(); if ( !cache.keySet().contains( db ) ) { CvDatabase cvDatabase = null; try { cvDatabase = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvDatabase.class, db ); if ( cvDatabase != null ) { System.out.println( "Found CvDatabase with shortlabel: " + db ); } else { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvDatabase " + "by shortlabel: " + db ) ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " + "for CvDatabase " + "having the shortlabel: " + db ) ); e.printStackTrace(); } cache.put( db, cvDatabase ); } } }
String cvShortLabel = ( String ) term.getValue(); CvDagObject cvDagObject = ( CvDagObject ) IntactContext.getCurrentInstance().getCvContext() .getByLabel( cvType, cvShortLabel );
public static void check( final XrefTag xref ) { final String db = xref.getDb(); if ( !cache.keySet().contains( db ) ) { CvDatabase cvDatabase = null; try { cvDatabase = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvDatabase.class, db ); if ( cvDatabase != null ) { System.out.println( "Found CvDatabase with shortlabel: " + db ); } else { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvDatabase " + "by shortlabel: " + db ) ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " + "for CvDatabase " + "having the shortlabel: " + db ) ); e.printStackTrace(); } cache.put( db, cvDatabase ); } } }
if (getCvContext().getByLabel(CvTopic.class, CvTopic.UNIPROT_DR_EXPORT).equals(_annotation.getCvTopic())) {
experimentalRole = IntactContext.getCurrentInstance().getCvContext().getByLabel( CvExperimentalRole.class, role ); experimentalRole = IntactContext.getCurrentInstance().getCvContext().getByLabel( CvExperimentalRole.class, CvExperimentalRole.NEUTRAL ); if ( experimentalRole == null ) { experimentalRole = IntactContext.getCurrentInstance().getCvContext().getByLabel( CvExperimentalRole.class, role );
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
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
cv = cvContext.getByLabel(clazz, shortlabel);
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() ); }
cvTopic = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvTopic.class, type );
cvTopic = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvTopic.class, type );
GoXrefHelper goXrefHelper = new GoXrefHelper( xrefTag.getId() ); if ( goXrefHelper.getQualifier() != null ) { cvXrefQualifier = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvXrefQualifier.class, goXrefHelper.getQualifier());
GoXrefHelper goXrefHelper = new GoXrefHelper( xrefTag.getId() ); if ( goXrefHelper.getQualifier() != null ) { cvXrefQualifier = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvXrefQualifier.class, goXrefHelper.getQualifier());