public static <X extends Xref> X getPsiMiIdentityXref(AnnotatedObject<X, ?> annotatedObject) { if (annotatedObject == null) { throw new NullPointerException("annotatedObject should not be null"); } X psiMiXref = null; Collection<X> identityXrefs = AnnotatedObjectUtils.searchXrefs(annotatedObject, CvDatabase.PSI_MI_MI_REF, CvXrefQualifier.IDENTITY_MI_REF); if (!identityXrefs.isEmpty()) { psiMiXref = identityXrefs.iterator().next(); } return psiMiXref; }
if (log.isDebugEnabled()) log.debug("Populating identifier for: "+cvObject.getShortLabel()); Collection<CvObjectXref> miIdXrefs = AnnotatedObjectUtils.searchXrefs(cvObject, CvDatabase.PSI_MI_MI_REF, CvXrefQualifier.IDENTITY_MI_REF);
public static <X extends Xref> X getPsiMiIdentityXref(AnnotatedObject<X, ?> annotatedObject) { if (annotatedObject == null) { throw new NullPointerException("annotatedObject should not be null"); } X psiMiXref = null; Collection<X> identityXrefs = AnnotatedObjectUtils.searchXrefs(annotatedObject, CvDatabase.PSI_MI_MI_REF, CvXrefQualifier.IDENTITY_MI_REF); if (!identityXrefs.isEmpty()) { psiMiXref = identityXrefs.iterator().next(); } return psiMiXref; }
listOfXrefLists.add(searchXrefs(ao, xrefFilter));
listOfXrefLists.add(searchXrefs(ao, xrefFilter));
/** * Search for all Xrefs having Xref with the given CvDatabase. * * @param ao the non null AnnotatedObject to search on. * @param db the non null CvDatabase filter. * @return a non null Collection of Xref, may be empty. */ public static Collection<Xref> searchXrefs(AnnotatedObject ao, CvDatabase db) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (db == null) { throw new NullPointerException("CvDatabase must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedCvObject(db); return searchXrefs(ao, new XrefCvFilter(cvFilterGroup)); }
/** * Search for all Xrefs having Xref with the given CvDatabase. * * @param ao the non null AnnotatedObject to search on. * @param db the non null CvDatabase filter. * @return a non null Collection of Xref, may be empty. */ public static Collection<Xref> searchXrefs(AnnotatedObject ao, CvDatabase db) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (db == null) { throw new NullPointerException("CvDatabase must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedCvObject(db); return searchXrefs(ao, new XrefCvFilter(cvFilterGroup)); }
/** * Search for all Xrefs having Xref with the given CvDatabase MI. * * @param ao the non null AnnotatedObject to search on. * @param dbMi the non null CvDatabase filter. * @return a non null Collection of Xref, may be empty. */ public static <X extends Xref> Collection<X> searchXrefsByDatabase(AnnotatedObject<X, ?> ao, String dbMi) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (dbMi == null) { throw new NullPointerException("dbMi must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedIdentifier(dbMi); return searchXrefs(ao, new XrefCvFilter(cvFilterGroup)); }
/** * Search for all Xrefs having Xref with the given CvDatabase MI. * * @param ao the non null AnnotatedObject to search on. * @param dbMi the non null CvDatabase filter. * @return a non null Collection of Xref, may be empty. */ public static <X extends Xref> Collection<X> searchXrefsByDatabase(AnnotatedObject<X, ?> ao, String dbMi) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (dbMi == null) { throw new NullPointerException("dbMi must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedIdentifier(dbMi); return searchXrefs(ao, new XrefCvFilter(cvFilterGroup)); }
/** * Search for all Xrefs having Xref with the given CvXrefQualifier. * * @param ao the non null AnnotatedObject to search on. * @param qualifierMi the non null CvXrefQualifier filter. * @return a non null Collection of Xref, may be empty. */ public static <X extends Xref> Collection<X> searchXrefsByQualifier(AnnotatedObject<X, ?> ao, String qualifierMi) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (qualifierMi == null) { throw new NullPointerException("qualifierMi must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedIdentifier(qualifierMi); return searchXrefs(ao, new XrefCvFilter(new CvObjectFilterGroup(), cvFilterGroup)); }
/** * Search for all Xrefs having Xref with the given CvXrefQualifier. * * @param ao the non null AnnotatedObject to search on. * @param qualifierMi the non null CvXrefQualifier filter. * @return a non null Collection of Xref, may be empty. */ public static <X extends Xref> Collection<X> searchXrefsByQualifier(AnnotatedObject<X, ?> ao, String qualifierMi) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (qualifierMi == null) { throw new NullPointerException("qualifierMi must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedIdentifier(qualifierMi); return searchXrefs(ao, new XrefCvFilter(new CvObjectFilterGroup(), cvFilterGroup)); }
Collection<Xref> xrefs = AnnotatedObjectUtils.searchXrefs( spliceVariant, isoformParent );
/** * Search for all Xrefs having Xref with both the given CvDatabase and CvXrefQualifier MIs. * * @param ao the non null AnnotatedObject to search on. * @param dbMi the non null CvDatabase filter. * @param qualifierMi the non null CvXrefQualifier filter. * @return a non null Collection of Xref, may be empty. */ public static <X extends Xref> Collection<X> searchXrefs(AnnotatedObject<X, ?> ao, String dbMi, String qualifierMi) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (dbMi == null) { throw new NullPointerException("dbMi must not be null."); } CvObjectFilterGroup databaseCvFilterGroup = new CvObjectFilterGroup(); databaseCvFilterGroup.addIncludedIdentifier(dbMi); CvObjectFilterGroup qualifierCvFilterGroup = new CvObjectFilterGroup(); qualifierCvFilterGroup.addIncludedIdentifier(qualifierMi); return searchXrefs(ao, new XrefCvFilter(databaseCvFilterGroup, qualifierCvFilterGroup)); }
/** * Search for all Xrefs having Xref with the given CvXrefQualifier. * * @param ao the non null AnnotatedObject to search on. * @param qu the non null CvXrefQualifier filter. * @return a non null Collection of Xref, may be empty. */ public static Collection<Xref> searchXrefs(AnnotatedObject ao, CvXrefQualifier qu) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (qu == null) { throw new NullPointerException("CvXrefQualifier must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedCvObject(qu); return searchXrefs(ao, new XrefCvFilter(new CvObjectFilterGroup(), cvFilterGroup)); }
/** * Search for all Xrefs having Xref with both the given CvDatabase and CvXrefQualifier. * * @param ao the non null AnnotatedObject to search on. * @param db the non null CvDatabase filter. * @param qu the non null CvXrefQualifier filter. * @return a non null Collection of Xref, may be empty. */ public static Collection<Xref> searchXrefs(AnnotatedObject ao, CvDatabase db, CvXrefQualifier qu) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (db == null) { throw new NullPointerException("CvDatabase must not be null."); } if (qu == null) { throw new NullPointerException("CvXrefQualifier must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedCvObject(db); CvObjectFilterGroup qualifierCvFilterGroup = new CvObjectFilterGroup(); qualifierCvFilterGroup.addIncludedCvObject(qu); return searchXrefs(ao, new XrefCvFilter(cvFilterGroup, qualifierCvFilterGroup)); }
/** * Search for all Xrefs having Xref with the given CvXrefQualifier. * * @param ao the non null AnnotatedObject to search on. * @param qu the non null CvXrefQualifier filter. * @return a non null Collection of Xref, may be empty. */ public static Collection<Xref> searchXrefs(AnnotatedObject ao, CvXrefQualifier qu) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (qu == null) { throw new NullPointerException("CvXrefQualifier must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedCvObject(qu); return searchXrefs(ao, new XrefCvFilter(new CvObjectFilterGroup(), cvFilterGroup)); }
/** * Search for all Xrefs having Xref with both the given CvDatabase and CvXrefQualifier. * * @param ao the non null AnnotatedObject to search on. * @param db the non null CvDatabase filter. * @param qu the non null CvXrefQualifier filter. * @return a non null Collection of Xref, may be empty. */ public static Collection<Xref> searchXrefs(AnnotatedObject ao, CvDatabase db, CvXrefQualifier qu) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (db == null) { throw new NullPointerException("CvDatabase must not be null."); } if (qu == null) { throw new NullPointerException("CvXrefQualifier must not be null."); } CvObjectFilterGroup cvFilterGroup = new CvObjectFilterGroup(); cvFilterGroup.addIncludedCvObject(db); CvObjectFilterGroup qualifierCvFilterGroup = new CvObjectFilterGroup(); qualifierCvFilterGroup.addIncludedCvObject(qu); return searchXrefs(ao, new XrefCvFilter(cvFilterGroup, qualifierCvFilterGroup)); }
/** * Search for all Xrefs having Xref with both the given CvDatabase and CvXrefQualifier MIs. * * @param ao the non null AnnotatedObject to search on. * @param dbMi the non null CvDatabase filter. * @param qualifierMi the non null CvXrefQualifier filter. * @return a non null Collection of Xref, may be empty. */ public static <X extends Xref> Collection<X> searchXrefs(AnnotatedObject<X, ?> ao, String dbMi, String qualifierMi) { if (ao == null) { throw new NullPointerException("AnnotatedObject must not be null."); } if (dbMi == null) { throw new NullPointerException("dbMi must not be null."); } CvObjectFilterGroup databaseCvFilterGroup = new CvObjectFilterGroup(); databaseCvFilterGroup.addIncludedIdentifier(dbMi); CvObjectFilterGroup qualifierCvFilterGroup = new CvObjectFilterGroup(); qualifierCvFilterGroup.addIncludedIdentifier(qualifierMi); return searchXrefs(ao, new XrefCvFilter(databaseCvFilterGroup, qualifierCvFilterGroup)); }
/** * Get the Xref identities for an interactor, allowing the exclude the identities that come from the IMEx partners (intact, mint and dip) * * @param interactor * @param excludeIdentitiesFromImexPartners * * @return */ public static List<InteractorXref> getIdentityXrefs(Interactor interactor, boolean excludeIdentitiesFromImexPartners) { CvObjectFilterGroup qualifierFilterGroup = new CvObjectFilterGroup(); qualifierFilterGroup.addIncludedIdentifier(CvXrefQualifier.IDENTITY_MI_REF); CvObjectFilterGroup databaseFilterGroup = new CvObjectFilterGroup(); if (excludeIdentitiesFromImexPartners) { // TODO this has to be maintained in case we get new IMEx partners // TODO a work around could be to load the list of MI identities of all institutions present in the repository databaseFilterGroup.addExcludedIdentifier(CvDatabase.INTACT_MI_REF); databaseFilterGroup.addExcludedIdentifier(CvDatabase.MINT_MI_REF); databaseFilterGroup.addExcludedIdentifier(CvDatabase.DIP_MI_REF); } return AnnotatedObjectUtils.searchXrefs(interactor, new XrefCvFilter(databaseFilterGroup, qualifierFilterGroup)); }
/** * Get the Xref identities for an interactor, allowing the exclude the identities that come from the IMEx partners (intact, mint and dip) * * @param interactor * @param excludeIdentitiesFromImexPartners * * @return */ public static List<InteractorXref> getIdentityXrefs(Interactor interactor, boolean excludeIdentitiesFromImexPartners) { CvObjectFilterGroup qualifierFilterGroup = new CvObjectFilterGroup(); qualifierFilterGroup.addIncludedIdentifier(CvXrefQualifier.IDENTITY_MI_REF); CvObjectFilterGroup databaseFilterGroup = new CvObjectFilterGroup(); if (excludeIdentitiesFromImexPartners) { // TODO this has to be maintained in case we get new IMEx partners // TODO a work around could be to load the list of MI identities of all institutions present in the repository databaseFilterGroup.addExcludedIdentifier(CvDatabase.INTACT_MI_REF); databaseFilterGroup.addExcludedIdentifier(CvDatabase.MINT_MI_REF); databaseFilterGroup.addExcludedIdentifier(CvDatabase.DIP_MI_REF); } return AnnotatedObjectUtils.searchXrefs(interactor, new XrefCvFilter(databaseFilterGroup, qualifierFilterGroup)); }