Tabnine Logo
InteractorXref.getPrimaryId
Code IndexAdd Tabnine to your IDE (free)

How to use
getPrimaryId
method
in
uk.ac.ebi.intact.model.InteractorXref

Best Java code snippets using uk.ac.ebi.intact.model.InteractorXref.getPrimaryId (Showing top 20 results out of 315)

origin: uk.ac.ebi.intact.core/intact-core

  public int compare(InteractorXref o1, InteractorXref o2) {
    return o1.getPrimaryId().compareTo(o2.getPrimaryId());
  }
};
origin: uk.ac.ebi.intact.core/intact-core-readonly

  public int compare(InteractorXref o1, InteractorXref o2) {
    return o1.getPrimaryId().compareTo(o2.getPrimaryId());
  }
};
origin: uk.ac.ebi.intact.core/intact-core-readonly

  public int compare(InteractorXref o1, InteractorXref o2) {
    return o1.getPrimaryId().toLowerCase().compareTo(o2.getPrimaryId().toLowerCase());
  }
});
origin: uk.ac.ebi.intact.core/intact-core

  public int compare(InteractorXref o1, InteractorXref o2) {
    return o1.getPrimaryId().toLowerCase().compareTo(o2.getPrimaryId().toLowerCase());
  }
});
origin: uk.ac.ebi.intact.dbupdate/intact-update-model

@Override
public ProteinUpdateError createInvalidCollectionOfParentsError(String proteinAc, UpdateError errorLabel, Collection<InteractorXref> isoformParents, Collection<InteractorXref> chainParents) {
  InvalidCollectionOfParents error = new InvalidCollectionOfParents(null, proteinAc, errorLabel);
  for (InteractorXref ref : isoformParents){
    error.getIsoformParents().add(ref.getPrimaryId());
  }
  for (InteractorXref ref : chainParents){
    error.getChainParents().add(ref.getPrimaryId());
  }
  return error;
}
origin: uk.ac.ebi.intact.dbupdate/intact-update-model

@Override
public ProteinUpdateError createMultiUniprotIdentitiesError(String proteinAc, Collection<InteractorXref> identities) {
  MultiUniprotIdentities error = new MultiUniprotIdentities(null, proteinAc);
  for (InteractorXref ref : identities){
    error.getUniprotIdentities().add(ref.getPrimaryId());
  }
  return error;
}
origin: uk.ac.ebi.intact.dbupdate/intact-update-model

public PersistentProteinEvent(ProteinUpdateProcess process, Protein protein){
  super(process);
  this.proteinAc = protein != null ? protein.getAc() : null;
  InteractorXref uniprotXref = ProteinUtils.getUniprotXref(protein);
  if (uniprotXref != null){
    this.uniprotAc = uniprotXref.getPrimaryId();
  }
  else {
    this.uniprotAc = null;
  }
  this.message = null;
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * 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;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * 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;
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Gets the Interactor Identifiers for that interaction
 *
 * @since 1.7.2
 */
public static List<String> getInteractorPrimaryIDs(Interaction interaction) {
  final Collection<Component> components = interaction.getComponents();
  List<String> ids = new ArrayList<String>(components.size());
  for (Component component : components) {
    Interactor interactor = component.getInteractor();
    final Collection<InteractorXref> idXrefs = XrefUtils.getIdentityXrefs(interactor);
    if (idXrefs.size() > 0) {
      final Iterator<InteractorXref> iterator = idXrefs.iterator();
      ids.add(iterator.next().getPrimaryId());
      if (log.isDebugEnabled()) {
        if (iterator.hasNext()) {
          log.debug("Interaction contains interactor with more than one identities. Interaction: " + interaction.getShortLabel() + "(" + interaction.getAc() + ") " +
              " - Xrefs: " + idXrefs);
        }
      }
    }
  }
  return ids;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Gets the Interactor Identifiers for that interaction
 *
 * @since 1.7.2
 */
public static List<String> getInteractorPrimaryIDs(Interaction interaction) {
  final Collection<Component> components = interaction.getComponents();
  List<String> ids = new ArrayList<String>(components.size());
  for (Component component : components) {
    Interactor interactor = component.getInteractor();
    final Collection<InteractorXref> idXrefs = XrefUtils.getIdentityXrefs(interactor);
    if (idXrefs.size() > 0) {
      final Iterator<InteractorXref> iterator = idXrefs.iterator();
      ids.add(iterator.next().getPrimaryId());
      if (log.isDebugEnabled()) {
        if (iterator.hasNext()) {
          log.debug("Interaction contains interactor with more than one identities. Interaction: " + interaction.getShortLabel() + "(" + interaction.getAc() + ") " +
              " - Xrefs: " + idXrefs);
        }
      }
    }
  }
  return ids;
}
origin: uk.ac.ebi.intact/intact-core

/**
 * 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;
}
origin: uk.ac.ebi.intact.core/intact-core

protected ProteinImpl getProteinTranscriptsMasterProtein( Protein proteinTranscript, String cvXRefQualifier) {
  if ( proteinTranscript == null ) {
    throw new NullPointerException( "proteinTranscript must not be null." );
  }
  if ( cvXRefQualifier == null ) {
    throw new NullPointerException( "The Cv Xref qualifier must not be null." );
  }
  String masterProtAc = null;
  for (InteractorXref xref : proteinTranscript.getXrefs()) {
    if (xref.getCvXrefQualifier() != null && cvXRefQualifier.equals(xref.getCvXrefQualifier().getIdentifier())) {
      if (masterProtAc == null) {
        masterProtAc = xref.getPrimaryId();
      } else {
        throw new IntactException("This protein transcript contains more than one "+cvXRefQualifier+" xrefs: "+proteinTranscript.getShortLabel() );
      }
    }
  }
  // search protein by AC
  return getByAc(masterProtAc);
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

protected ProteinImpl getProteinTranscriptsMasterProtein( Protein proteinTranscript, String cvXRefQualifier) {
  if ( proteinTranscript == null ) {
    throw new NullPointerException( "proteinTranscript must not be null." );
  }
  if ( cvXRefQualifier == null ) {
    throw new NullPointerException( "The Cv Xref qualifier must not be null." );
  }
  String masterProtAc = null;
  for (InteractorXref xref : proteinTranscript.getXrefs()) {
    if (xref.getCvXrefQualifier() != null && cvXRefQualifier.equals(xref.getCvXrefQualifier().getIdentifier())) {
      if (masterProtAc == null) {
        masterProtAc = xref.getPrimaryId();
      } else {
        throw new IntactException("This protein transcript contains more than one "+cvXRefQualifier+" xrefs: "+proteinTranscript.getShortLabel() );
      }
    }
  }
  // search protein by AC
  return getByAc(masterProtAc);
}
origin: uk.ac.ebi.intact.dataexchange.uniprotexport/intact-uniprot-export

/**
 * Get the uniprot primary ID from Protein and Splice variant.
 *
 * @param protein the Protein for which we want the uniprot ID.
 *
 * @return the uniprot ID as a String or null if none is found (should not occur)
 */
public String getUniprotID(final Protein protein) {
  if (protAcToUniprotIdCache.containsKey(protein.getAc())) {
    return protAcToUniprotIdCache.get(protein.getAc());
  }
  String uniprotId = null;
  Collection<InteractorXref> xrefs = protein.getXrefs();
  for (InteractorXref xref : xrefs) {
    if (getUniprot().getIdentifier().equals(xref.getCvDatabase().getIdentifier()) &&
        getIdentity().equals(xref.getCvXrefQualifier())) {
      uniprotId = xref.getPrimaryId();
      break;
    }
  }
  protAcToUniprotIdCache.put(protein.getAc(), uniprotId);
  return uniprotId;
}
origin: uk.ac.ebi.intact.dbupdate/intact-update-model

@Override
@Transactional( "update" )
public void onDeadProteinFound(DeadUniprotEvent evt) throws ProcessorException {
  // reattach the updateProcess to the entity manager
  ProteinUpdateProcess updateProcess = IntactUpdateContext.getCurrentInstance().getUpdateFactory().getEntityManager().merge(this.updateProcess);
  Protein protein = evt.getProtein();
  String identity = evt.getUniprotIdentityXref() != null ? evt.getUniprotIdentityXref().getPrimaryId() : null;
  Collection<InteractorXref> deletedXrefs = evt.getDeletedXrefs();
  DeadProteinEvent proteinEvt = new DeadProteinEvent(updateProcess, protein, identity);
  if (deletedXrefs != null && !deletedXrefs.isEmpty()){
    proteinEvt.addDeletedReferencesFromXref(deletedXrefs);
  }
  IntactUpdateContext.getCurrentInstance().getUpdateFactory().getDeadProteinEventDao().persist(proteinEvt);
}
origin: uk.ac.ebi.intact.dataexchange.uniprotexport/intact-uniprot-export

  /**
   * Get the uniprot primary ID from Protein and Splice variant.
   *
   * @param protein the Protein for which we want the uniprot ID.
   *
   * @return the uniprot ID as a String or null if none is found (should not occur)
   */
  public String getUniprotPrimaryAc(final Protein protein) {

    if (protAcToUniprotIdCache.containsKey(protein.getAc())) {
      return protAcToUniprotIdCache.get(protein.getAc());
    }

    String uniprotId = null;

    Collection<InteractorXref> xrefs = protein.getXrefs();

    for (InteractorXref xref : xrefs) {
      if (getUniprot().equals(xref.getCvDatabase()) &&
          getIdentity().equals(xref.getCvXrefQualifier())) {
        uniprotId = xref.getPrimaryId();
        break;
      }
    }

    protAcToUniprotIdCache.put(protein.getAc(), uniprotId);

    return uniprotId;
  }
}
origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

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);
    }
  }
}
origin: uk.ac.ebi.intact.dbupdate/intact-update-model

@Override
@Transactional( "update" )
public void onInvalidIntactParent(InvalidIntactParentFoundEvent evt) throws ProcessorException {
  // reattach the updateProcess to the entity manager
  ProteinUpdateProcess updateProcess = IntactUpdateContext.getCurrentInstance().getUpdateFactory().getEntityManager().merge(this.updateProcess);
  Protein protein = evt.getProtein();
  String newParentAc = evt.getNewParentAc();
  String oldParentAc = evt.getOldParentAc();
  InteractorXref uniprotXref = ProteinUtils.getUniprotXref(evt.getProtein());
  String uniprotAc= uniprotXref != null ? uniprotXref.getPrimaryId() : null;
  IntactTranscriptUpdateEvent protEvt = new IntactTranscriptUpdateEvent(updateProcess, protein, uniprotAc, oldParentAc, newParentAc);
  IntactUpdateContext.getCurrentInstance().getUpdateFactory().getIntactTranscriptEventDao().persist(protEvt);
}
origin: uk.ac.ebi.intact.dbupdate/intact-update-model

@Override
@Transactional( "update" )
public void onSecondaryAcsFound(UpdateCaseEvent evt) throws ProcessorException {
  // reattach the updateProcess to the entity manager
  ProteinUpdateProcess updateProcess = IntactUpdateContext.getCurrentInstance().getUpdateFactory().getEntityManager().merge(this.updateProcess);
  Collection<Protein> secondaryProteins = evt.getSecondaryProteins();
  Collection<ProteinTranscript> secondaryIsoforms = evt.getSecondaryIsoforms();
  Collection<XrefUpdaterReport> secondaryXrefReports = evt.getXrefUpdaterReports();
  for (Protein prot : secondaryProteins){
    InteractorXref oldPrimary = ProteinUtils.getUniprotXref(prot);
    String oldAc = oldPrimary != null ? oldPrimary.getPrimaryId() : null;
    SecondaryProteinEvent protEvt = new SecondaryProteinEvent(updateProcess, prot, oldAc, evt.getProtein().getPrimaryAc());
    IntactUpdateContext.getCurrentInstance().getUpdateFactory().getSecondaryProteinEventDao().persist(protEvt);
  }
  for (ProteinTranscript protTrans : secondaryIsoforms){
    Protein prot = protTrans.getProtein();
    InteractorXref oldPrimary = ProteinUtils.getUniprotXref(prot);
    String oldAc = oldPrimary != null ? oldPrimary.getPrimaryId() : null;
    SecondaryProteinEvent protEvt = new SecondaryProteinEvent(updateProcess, prot, oldAc, protTrans.getUniprotVariant().getPrimaryAc());
    IntactUpdateContext.getCurrentInstance().getUpdateFactory().getSecondaryProteinEventDao().persist(protEvt);
  }
}
uk.ac.ebi.intact.modelInteractorXrefgetPrimaryId

Popular methods of InteractorXref

  • getCvXrefQualifier
  • getCvDatabase
  • <init>
  • equals
  • getParent
  • setCvXrefQualifier

Popular in Java

  • Making http requests using okhttp
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for WebStorm
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