/** * Retreives Imex identifier stored in the Xrefs. * * @param interaction the interaction to search on. * @return an imex id or null if not found. */ public static String getImexIdentifier(Interaction interaction) { if (interaction == null) { throw new IllegalArgumentException("You must give a non null interaction"); } for (InteractorXref xref : interaction.getXrefs()) { if (CvDatabase.IMEX_MI_REF.equals(xref.getCvDatabase().getIdentifier())) { return xref.getPrimaryId(); } } // Could not find an IMEx id return null; }
/** * Retreives Imex identifier stored in the Xrefs. * * @param interaction the interaction to search on. * @return an imex id or null if not found. */ public static String getImexIdentifier(Interaction interaction) { if (interaction == null) { throw new IllegalArgumentException("You must give a non null interaction"); } for (InteractorXref xref : interaction.getXrefs()) { if (CvDatabase.IMEX_MI_REF.equals(xref.getCvDatabase().getIdentifier())) { return xref.getPrimaryId(); } } // Could not find an IMEx id return null; }
/** * Retreives Imex identifier stored in the Xrefs. * * @param interaction the interaction to search on. * @return an imex id or null if not found. */ public static String getImexIdentifier( Interaction interaction ) { if ( interaction == null ) { throw new IllegalArgumentException( "You must give a non null interaction" ); } for ( InteractorXref xref : interaction.getXrefs() ) { CvObjectXref idCvDatabase = CvObjectUtils.getPsiMiIdentityXref( xref.getCvDatabase() ); if ( idCvDatabase.getPrimaryId().equals( CvDatabase.IMEX_MI_REF ) ) { return xref.getPrimaryId(); } } // Could not find an IMEx id return null; }
for ( Iterator iterator = interaction.getXrefs().iterator(); iterator.hasNext(); ) { Xref xref = (Xref) iterator.next();
for ( Iterator iterator = interaction.getXrefs().iterator(); iterator.hasNext(); ) { Xref xref = (Xref) iterator.next();
for ( Iterator iterator = interaction.getXrefs().iterator(); iterator.hasNext(); ) { Xref xref = (Xref) iterator.next();
/****************************/ // enrich fields in the SolrDocument passed as parameter public void enrich ( Interaction interaction, SolrInputDocument solrDocument ) throws Exception { // check parameters and information if ( interaction == null ) { return ; } // Enrich interaction type enrichInteractionType(interaction.getCvInteractionType(), solrDocument) ; // Enrich Complex Organism fields enrichOrganism(interaction, solrDocument) ; // Enrich Complex Xref fields enrichInteractionXref(interaction.getXrefs(), solrDocument) ; }
protected Xref getImexXref(Interaction interaction) { Collection<? extends Xref> refs; if (isCheckInitializedCollections()){ refs = IntactCore.ensureInitializedXrefs(interaction); } else { refs = interaction.getXrefs(); } for (Xref xref : refs) { if (CvDatabase.IMEX_MI_REF.equals(xref.getCvDatabase().getIdentifier()) && xref.getCvXrefQualifier() != null && CvXrefQualifier.IMEX_PRIMARY_MI_REF.equals(xref.getCvXrefQualifier().getIdentifier())) { return xref; } } return null; }
protected void fixSourceReferenceXrefsIfNecessary(Interaction interaction) { InteractorXref xrefToFix = null; if( ConverterContext.getInstance().isAutoFixInteractionSourceReference() ) { // Look up source reference xref and only try to fix identity if there is no source ref present. // if the qualifier is identity, we will check if the owner identity MI is the same as the database MI for (InteractorXref xref : interaction.getXrefs()) { if (xref.getCvXrefQualifier() != null && getInstitutionPrimaryId() != null && getInstitutionPrimaryId().equals( xref.getPrimaryId() ) && !CvXrefQualifier.SOURCE_REFERENCE_MI_REF.equals(xref.getCvXrefQualifier().getIdentifier())) { xrefToFix = xref; break; } } if ( xrefToFix != null ) { log.warn("Interaction identity xref found pointing to the source database. It should be of type 'source-reference'. Will be fixed automatically: "+xrefToFix); CvXrefQualifier sourceReference = CvObjectUtils.createCvObject(interaction.getOwner(), CvXrefQualifier.class, CvXrefQualifier.SOURCE_REFERENCE_MI_REF, CvXrefQualifier.SOURCE_REFERENCE); xrefToFix.setCvXrefQualifier(sourceReference); addMessageToContext(MessageLevel.WARN, "Interaction identity xref found pointing to the source database. It should be of type 'source-reference'. Fixed.", true); } } }
for ( Iterator iterator = interaction.getXrefs().iterator(); iterator.hasNext() && imexId == null; ) { Xref xref = (Xref) iterator.next();
for ( Iterator iterator = interaction.getXrefs().iterator(); iterator.hasNext() && imexId == null; ) { Xref xref = (Xref) iterator.next();
for ( Iterator iterator = interaction.getXrefs().iterator(); iterator.hasNext() && imexId == null; ) { Xref xref = (Xref) iterator.next();
Collection<InteractorXref> interactionRefs = interaction.getXrefs();