Tabnine Logo
XrefTag.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
uk.ac.ebi.intact.application.dataConversion.psiUpload.model.XrefTag

Best Java code snippets using uk.ac.ebi.intact.application.dataConversion.psiUpload.model.XrefTag.getId (Showing top 20 results out of 315)

origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

/**
 * Get from a feature object the primaryId of an Xref having the given database.
 *
 * @param feature
 * @param database
 *
 * @return the primaryId of null if we can't find it.
 */
private String getFeatureId( FeatureTag feature, String database ) {
  for ( Iterator iterator = feature.getXrefs().iterator(); iterator.hasNext(); ) {
    XrefTag xref = (XrefTag) iterator.next();
    if ( xref.getDb().equalsIgnoreCase( database ) ) {
      return xref.getId();
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.util/data-conversion

/**
 * Get from a feature object the primaryId of an Xref having the given database.
 *
 * @param feature
 * @param database
 *
 * @return the primaryId of null if we can't find it.
 */
private String getFeatureId( FeatureTag feature, String database ) {
  for ( Iterator iterator = feature.getXrefs().iterator(); iterator.hasNext(); ) {
    XrefTag xref = (XrefTag) iterator.next();
    if ( xref.getDb().equalsIgnoreCase( database ) ) {
      return xref.getId();
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.app/data-conversion

/**
 * Get from a feature object the primaryId of an Xref having the given database.
 *
 * @param feature
 * @param database
 *
 * @return the primaryId of null if we can't find it.
 */
private String getFeatureId( FeatureTag feature, String database ) {
  for ( Iterator iterator = feature.getXrefs().iterator(); iterator.hasNext(); ) {
    XrefTag xref = (XrefTag) iterator.next();
    if ( xref.getDb().equalsIgnoreCase( database ) ) {
      return xref.getId();
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

  public String toString() {
    final StringBuffer buf = new StringBuffer();
    buf.append( "HostOrganismTag" );
    buf.append( "{taxId=" ).append( taxId );

    buf.append( ", tissue=" );
    if ( null == tissue || tissue.getPsiDefinition() == null) {
      buf.append( '-' );
    } else {
      buf.append( tissue.getPsiDefinition().getId() );
    }

    buf.append( ", cellType=" );
    if ( null == cellType || cellType.getPsiDefinition() == null) {
      buf.append( '-' );
    } else {
      buf.append( cellType.getPsiDefinition().getId() );
    }
    buf.append( '}' );
    return buf.toString();
  }
}
origin: uk.ac.ebi.intact.app/data-conversion

  public String toString() {
    final StringBuffer buf = new StringBuffer();
    buf.append( "HostOrganismTag" );
    buf.append( "{taxId=" ).append( taxId );

    buf.append( ", tissue=" );
    if ( null == tissue || tissue.getPsiDefinition() == null) {
      buf.append( '-' );
    } else {
      buf.append( tissue.getPsiDefinition().getId() );
    }

    buf.append( ", cellType=" );
    if ( null == cellType || cellType.getPsiDefinition() == null) {
      buf.append( '-' );
    } else {
      buf.append( cellType.getPsiDefinition().getId() );
    }
    buf.append( '}' );
    return buf.toString();
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

  public String toString() {
    final StringBuffer buf = new StringBuffer();
    buf.append( "HostOrganismTag" );
    buf.append( "{taxId=" ).append( taxId );

    buf.append( ", tissue=" );
    if ( null == tissue || tissue.getPsiDefinition() == null) {
      buf.append( '-' );
    } else {
      buf.append( tissue.getPsiDefinition().getId() );
    }

    buf.append( ", cellType=" );
    if ( null == cellType || cellType.getPsiDefinition() == null) {
      buf.append( '-' );
    } else {
      buf.append( cellType.getPsiDefinition().getId() );
    }
    buf.append( '}' );
    return buf.toString();
  }
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

  public static void check( final InteractionTypeTag interactionType ) {

    final XrefTag psiDef = interactionType.getPsiDefinition();
    XrefChecker.check( psiDef );

    final String id = psiDef.getId();

    if ( !cache.keySet().contains( id ) ) {
      CvInteractionType cvInteractionType = null;

      try {
        cvInteractionType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteractionType.class, id);

        if ( cvInteractionType == null ) {
          MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractionType " +
                                        "for the PSI definition: " + id ) );
        } else {
          System.out.println( "Found InteractionType " + id + " as " + cvInteractionType.getShortLabel() );
        }

      } catch ( IntactException e ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteractionType " +
                                      "having the PSI definition: " + id ) );
        e.printStackTrace();
      }

      cache.put( id, cvInteractionType );
    }
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

  public static void check( final ParticipantDetectionTag participantDetection ) {

    final XrefTag psiDef = participantDetection.getPsiDefinition();
    XrefChecker.check( psiDef );

    final String id = psiDef.getId();

    if ( !cache.keySet().contains( id ) ) {
      CvIdentification cvIdentification = null;

      try {
        cvIdentification = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvIdentification.class,id);

        if ( cvIdentification == null ) {
          MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvIdentification for the PSI definition: " + id ) );
        } else {
          System.out.println( "Found ParticipantDetection " + id + " as " + cvIdentification.getShortLabel() );
        }
      } catch ( IntactException e ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteraction " +
                                      "having the PSI definition: " + id ) );
        e.printStackTrace();
      }

      cache.put( id, cvIdentification );
    }
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

  public static void check( final InteractionDetectionTag interactionDetection ) {

    final XrefTag psiDef = interactionDetection.getPsiDefinition();
    XrefChecker.check( psiDef );

    final String id = psiDef.getId();

    if ( !cache.keySet().contains( id ) ) {
      CvInteraction cvInteraction = null;

      try {
        cvInteraction = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteraction.class,id);

        if ( cvInteraction == null ) {
          MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteraction by PSI definition: " + id ) );
        } else {
          System.out.println( "Found CvInteraction " + id + " as " + cvInteraction.getShortLabel() );
        }
      } catch ( IntactException e ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteraction " +
                                      "having the PSI definition: " + id ) );
        e.printStackTrace();
      }

      cache.put( id, cvInteraction );
    }
  }
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

private static void checkCvTypeIdentification( FeatureTag feature ) {
  XrefTag psiDef = feature.getFeatureType().getPsiDefinition();
  XrefChecker.check( psiDef );
  final String id = psiDef.getId();
  if ( !featureTypeCache.keySet().contains( id ) ) {
    CvFeatureType featureType = null;
    try {
      featureType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvFeatureType.class,id);
      if ( featureType == null ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvFeatureType by PSI definition: " + id ) );
      } else {
        System.out.println( "Found CvFeatureType " + id + " as " + featureType.getShortLabel() );
      }
    } catch ( IntactException e ) {
      MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvFeatureType " +
                                    "having the PSI definition: " + id ) );
      e.printStackTrace();
    }
    featureTypeCache.put( id, featureType );
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

private static void checkCvTypeIdentification( FeatureTag feature ) {
  XrefTag psiDef = feature.getFeatureType().getPsiDefinition();
  XrefChecker.check( psiDef );
  final String id = psiDef.getId();
  if ( !featureTypeCache.keySet().contains( id ) ) {
    CvFeatureType featureType = null;
    try {
      featureType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvFeatureType.class,id);
      if ( featureType == null ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvFeatureType by PSI definition: " + id ) );
      } else {
        System.out.println( "Found CvFeatureType " + id + " as " + featureType.getShortLabel() );
      }
    } catch ( IntactException e ) {
      MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvFeatureType " +
                                    "having the PSI definition: " + id ) );
      e.printStackTrace();
    }
    featureTypeCache.put( id, featureType );
  }
}
origin: uk.ac.ebi.intact.app/data-conversion

  public static void check( final InteractionTypeTag interactionType ) {

    final XrefTag psiDef = interactionType.getPsiDefinition();
    XrefChecker.check( psiDef );

    final String id = psiDef.getId();

    if ( !cache.keySet().contains( id ) ) {
      CvInteractionType cvInteractionType = null;

      try {
        cvInteractionType = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvInteractionType.class).getByXref(id);

        if ( cvInteractionType == null ) {
          MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractionType " +
                                        "for the PSI definition: " + id ) );
        } else {
          System.out.println( "Found InteractionType " + id + " as " + cvInteractionType.getShortLabel() );
        }

      } catch ( IntactException e ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteractionType " +
                                      "having the PSI definition: " + id ) );
        e.printStackTrace();
      }

      cache.put( id, cvInteractionType );
    }
  }
}
origin: uk.ac.ebi.intact.app/data-conversion

  private static void checkCvFeatureIdentification( FeatureTag feature ) {

    final XrefTag psiDef = feature.getFeatureDetection().getPsiDefinition();

    XrefChecker.check( psiDef );

    final String id = psiDef.getId();

    if ( !featureIdentificationCache.keySet().contains( id ) ) {
      CvFeatureIdentification cvFeatureIdentification = null;

      try {
        cvFeatureIdentification = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvFeatureIdentification.class).getByXref(id);

        if ( cvFeatureIdentification == null ) {
          MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvFeatureIdentification by PSI definition: " + id ) );
        } else {
          System.out.println( "Found CvFeatureIdentification " + id + " as " + cvFeatureIdentification.getShortLabel() );
        }
      } catch ( IntactException e ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvFeatureIdentification " +
                                      "having the PSI definition: " + id ) );
        e.printStackTrace();
      }

      featureIdentificationCache.put( id, cvFeatureIdentification );
    }
  }
}
origin: uk.ac.ebi.intact.app/data-conversion

private static void checkCvTypeIdentification( FeatureTag feature ) {
  XrefTag psiDef = feature.getFeatureType().getPsiDefinition();
  XrefChecker.check( psiDef );
  final String id = psiDef.getId();
  if ( !featureTypeCache.keySet().contains( id ) ) {
    CvFeatureType featureType = null;
    try {
      featureType = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvFeatureType.class).getByXref(id);
      if ( featureType == null ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvFeatureType by PSI definition: " + id ) );
      } else {
        System.out.println( "Found CvFeatureType " + id + " as " + featureType.getShortLabel() );
      }
    } catch ( IntactException e ) {
      MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvFeatureType " +
                                    "having the PSI definition: " + id ) );
      e.printStackTrace();
    }
    featureTypeCache.put( id, featureType );
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

  /**
   * Get an Intact Protein out of a ProteinInteractorTag.
   *
   * @param proteinParticipant
   *
   * @return the IntAct Protein correcponding to the given ProteinParticipantTag.
   */
  private static ProteinHolder getProtein( final ProteinParticipantTag proteinParticipant ) {

    final ProteinInteractorTag proteinInteractor = proteinParticipant.getProteinInteractor();

    OrganismTag organism = proteinInteractor.getOrganism();
    BioSource bioSource = null;
    if ( organism != null ) {
      bioSource = OrganismChecker.getBioSource( proteinInteractor.getOrganism() );
    }

    String proteinId = proteinInteractor.getPrimaryXref().getId();
    String db = proteinInteractor.getPrimaryXref().getDb();

//        System.out.println( "Search interactor (" + proteinInteractor.getShortlabel() + ") from cache(" +
//                            proteinId + ", " + db + ", " + bioSource.getShortLabel() + ")" );

    return ProteinInteractorChecker.getProtein( proteinId, db, bioSource );
  }
}
origin: uk.ac.ebi.intact.app/data-conversion

  /**
   * Get an Intact Protein out of a ProteinInteractorTag.
   *
   * @param proteinParticipant
   *
   * @return the IntAct Protein correcponding to the given ProteinParticipantTag.
   */
  private static ProteinHolder getProtein( final ProteinParticipantTag proteinParticipant ) {

    final ProteinInteractorTag proteinInteractor = proteinParticipant.getProteinInteractor();

    OrganismTag organism = proteinInteractor.getOrganism();
    BioSource bioSource = null;
    if ( organism != null ) {
      bioSource = OrganismChecker.getBioSource( proteinInteractor.getOrganism() );
    }

    String proteinId = proteinInteractor.getPrimaryXref().getId();
    String db = proteinInteractor.getPrimaryXref().getDb();

//        System.out.println( "Search interactor (" + proteinInteractor.getShortlabel() + ") from cache(" +
//                            proteinId + ", " + db + ", " + bioSource.getShortLabel() + ")" );

    return ProteinInteractorChecker.getProtein( proteinId, db, bioSource );
  }
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

  /**
   * Get an Intact Protein out of a ProteinInteractorTag.
   *
   * @param proteinParticipant
   *
   * @return the IntAct Protein correcponding to the given ProteinParticipantTag.
   */
  private static ProteinHolder getProtein( final ProteinParticipantTag proteinParticipant ) {

    final ProteinInteractorTag proteinInteractor = proteinParticipant.getProteinInteractor();

    OrganismTag organism = proteinInteractor.getOrganism();
    BioSource bioSource = null;
    if ( organism != null ) {
      bioSource = OrganismChecker.getBioSource( proteinInteractor.getOrganism() );
    }

    String proteinId = proteinInteractor.getPrimaryXref().getId();
    String db = proteinInteractor.getPrimaryXref().getDb();

//        System.out.println( "Search interactor (" + proteinInteractor.getShortlabel() + ") from cache(" +
//                            proteinId + ", " + db + ", " + bioSource.getShortLabel() + ")" );

    return ProteinInteractorChecker.getProtein( proteinId, db, bioSource );
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

private static void createXref( Protein protein,
                XrefTag xrefTag,
                boolean identity ) throws IntactException {
  CvXrefQualifier qualifier = null;
  if ( identity ) {
    qualifier = ControlledVocabularyRepository.getIdentityQualifier();
  }
  CvDatabase database = XrefChecker.getCvDatabase( xrefTag.getDb() );
  if ( database == null ) {
    // failed to find the database, skip the Xref creation
  } else {
    InteractorXref xref = new InteractorXref( IntactContext.getCurrentInstance().getInstitution(),
               database,
               xrefTag.getId(),
               xrefTag.getSecondary(),
               xrefTag.getVersion(),
               qualifier );
    protein.addXref( xref );
    IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref );
  }
}
origin: uk.ac.ebi.intact.app/data-conversion

private static void createXref( Protein protein,
                XrefTag xrefTag,
                boolean identity ) throws IntactException {
  CvXrefQualifier qualifier = null;
  if ( identity ) {
    qualifier = ControlledVocabularyRepository.getIdentityQualifier();
  }
  CvDatabase database = XrefChecker.getCvDatabase( xrefTag.getDb() );
  if ( database == null ) {
    // failed to find the database, skip the Xref creation
  } else {
    InteractorXref xref = new InteractorXref( IntactContext.getCurrentInstance().getInstitution(),
               database,
               xrefTag.getId(),
               xrefTag.getSecondary(),
               xrefTag.getVersion(),
               qualifier );
    protein.addXref( xref );
    IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref );
  }
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

private static void createXref( Protein protein,
                XrefTag xrefTag,
                boolean identity ) throws IntactException {
  CvXrefQualifier qualifier = null;
  if ( identity ) {
    qualifier = ControlledVocabularyRepository.getIdentityQualifier();
  }
  CvDatabase database = XrefChecker.getCvDatabase( xrefTag.getDb() );
  if ( database == null ) {
    // failed to find the database, skip the Xref creation
  } else {
    InteractorXref xref = new InteractorXref( IntactContext.getCurrentInstance().getInstitution(),
               database,
               xrefTag.getId(),
               xrefTag.getSecondary(),
               xrefTag.getVersion(),
               qualifier );
    protein.addXref( xref );
    IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref );
  }
}
uk.ac.ebi.intact.application.dataConversion.psiUpload.modelXrefTaggetId

Popular methods of XrefTag

  • <init>
  • equals
  • getDb
  • getSecondary
  • getType
  • getVersion
  • hashCode
  • isPrimaryRef

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setScale (BigDecimal)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 12 Jupyter Notebook extensions
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