uk.ac.ebi.intact.model.Interaction类的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(15.6k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中uk.ac.ebi.intact.model.Interaction类的一些代码示例,展示了Interaction类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Interaction类的具体详情如下:
包路径:uk.ac.ebi.intact.model.Interaction
类名称:Interaction

Interaction介绍

暂无

代码示例

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

if (isCollectionClonable(interaction.getComponents())) {
  Collection<Component> components = IntactCore.ensureInitializedParticipants(interaction);
    clone.getComponents().add(clonedComp);
clone.setCvInteractionType(clone(interaction.getCvInteractionType()));
clone.setCvInteractorType(clone(interaction.getCvInteractorType()));
if (isCollectionClonable(interaction.getExperiments())) {
  Collection<Experiment> experiments = IntactCore.ensureInitializedExperiments(interaction);
    clone.addExperiment(clone(experiment));
clone.setKD(interaction.getKD());
clone.setCrc(interaction.getCrc());
if (isCollectionClonable(interaction.getConfidences())) {
  Collection<Confidence> confidences = IntactCore.ensureInitializedConfidences(interaction);
    clone.addConfidence(clone(confidence));
if (isCollectionClonable(interaction.getParameters())) {
  Collection<InteractionParameter> parameters = IntactCore.ensureInitializedInteractionParameters(interaction);
    clone.addParameter(clone(interactionParameter));

代码示例来源: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.dataexchange.psimi/intact-solr-core

/****************************/
// 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) ;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-persister

public void onPrePersist(Interaction objToPersist)
{
  String shortLabel = objToPersist.getShortLabel();
  String newShortLabel = InteractionUtils.syncShortLabelWithDb(shortLabel);
  if (!shortLabel.equals(newShortLabel)) {
    if (log.isDebugEnabled()) log.debug("Interaction with label '"+shortLabel+"' renamed '"+newShortLabel+"'" );
    objToPersist.setShortLabel(newShortLabel);
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-persister

protected void syncExperiments(Interaction intactObject)  {
    ExperimentPersister persister = ExperimentPersister.getInstance();

    List<Experiment> experiments = new ArrayList<Experiment>(intactObject.getExperiments().size());

    for (Experiment experiment : intactObject.getExperiments()) {
      Experiment exp = persister.syncIfTransient(experiment);
      experiments.add(exp);
    }

    intactObject.setExperiments(experiments);
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

protected void copyInteraction( Interaction source, Interaction target ) {
  copyProperty(source, "KD", target);
  copyProperty(source, "crc", target);
  copyProperty(source, "cvInteractionType", target);
  copyCollection( source.getComponents(), target.getComponents() );
  copyCollection( source.getExperiments(), target.getExperiments() );
  copyCollection( source.getConfidences(), target.getConfidences() );
  
  copyCollection( source.getParameters(), target.getParameters() );
  copyInteractorCommons( source, target );
  // we have ommited CRC on purpose
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

private void synchronizeInteraction( Interaction interaction, boolean synchronizeAnnotatedAttributes ) {
  interaction.setCvInteractionType( synchronize( interaction.getCvInteractionType() ) );
  interaction.setCvInteractorType( synchronize( interaction.getCvInteractorType() ) );
  if (IntactCore.isInitializedAndDirty(interaction.getComponents())){
    Collection<Component> components = synchronizeCollection(interaction.getComponents());
    interaction.getComponents().clear();
    interaction.getComponents().addAll(components);
  }
  interaction.setBioSource( synchronize( interaction.getBioSource() ) );
  if (IntactCore.isInitializedAndDirty(interaction.getExperiments())){
    Collection<Experiment> experiment = synchronizeCollection(interaction.getExperiments());
    interaction.getExperiments().clear();
    interaction.getExperiments().addAll(experiment);
  }
  // cannot call setConfidences in interaction because of orphan relationship limitation
  if (IntactCore.isInitializedAndDirty(interaction.getConfidences())){
    Collection<Confidence> confidences = synchronizeConfidences(interaction.getConfidences(), interaction);
    interaction.getConfidences().clear();
    interaction.getConfidences().addAll(confidences);
  }
  // cannot call setParameters in interaction because of orphan relationship limitation
  if (IntactCore.isInitializedAndDirty(interaction.getParameters())){
    Collection<InteractionParameter> interactionParameters = synchronizeInteractionParameters(interaction.getParameters(), interaction);
    interaction.getParameters().clear();
    interaction.getParameters().addAll(interactionParameters);
  }
  if (synchronizeAnnotatedAttributes){
    synchronizeAnnotatedObjectCommons( interaction );
  }
}

代码示例来源:origin: uk.ac.ebi.intact/intact-ebi-search-engine-export

out.write( i + "<entry id=\"" + interaction.getAc() + "\">" + NEW_LINE );
out.write( ii + "<name>" + interaction.getShortLabel() + "</name>" + NEW_LINE );
if ( interaction.getFullName() != null ) {
  out.write( ii + "<description>" + escapeXml( interaction.getFullName() ) + "</description>" + NEW_LINE );
writeCreationDate( out, interaction.getCreated(), iii );
writeLastUpdateDate( out, interaction.getUpdated(), iii );
out.write( ii + "</dates>" + NEW_LINE );
boolean hasXrefs = !interaction.getXrefs().isEmpty();
boolean hasLinks = !interaction.getComponents().isEmpty();
    for ( Xref xref : interaction.getXrefs() ) {
      String db = xref.getCvDatabase().getShortLabel();
      String id = xref.getPrimaryId();
    for ( Component c : interaction.getComponents() ) {
      for ( Experiment experiment : interaction.getExperiments() ) {
        experimentAcs.add( experiment.getAc() );
for ( Alias alias : interaction.getAliases() ) {
  String aliasName = escapeXml( alias.getName() );
  writeField( out, alias.getCvAliasType().getShortLabel(), aliasName, iii );
writeCvTerm( out, interaction.getCvInteractionType(), iii );
for ( Experiment e : interaction.getExperiments() ) {
  cvs.add( e.getCvInteraction() );

代码示例来源:origin: uk.ac.ebi.intact.util/data-conversion

for ( Iterator iterator = interaction.getXrefs().iterator(); iterator.hasNext() && imexId == null; ) {
  Xref xref = (Xref) iterator.next();
Collection experiments = interaction.getExperiments();
Element experimentList = session.getExperimentListElement();
Element localExperimentList = null;
if ( !interaction.getComponents().isEmpty() ) {
  for ( Iterator iterator = interaction.getComponents().iterator(); iterator.hasNext(); ) {
    Component component = (Component) iterator.next();
HashSet inferedInteractions = new HashSet( 2 );
for ( Iterator iterator = interaction.getComponents().iterator(); iterator.hasNext(); ) {
  Component component = (Component) iterator.next();
    for ( Iterator iterator2 = interaction.getExperiments().iterator(); iterator2.hasNext(); ) {
      Experiment experiment = (Experiment) iterator2.next();
if ( interaction.getCvInteractionType() != null ) {
  CvObject2xmlFactory.getInstance( session ).create( session, element, interaction.getCvInteractionType() );

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psimitab-converters

if (interaction.getCvInteractionType() != null){
  CrossReference type = cvObjectConverter.toCrossReference(interaction.getCvInteractionType());
if (!interaction.getConfidences().isEmpty()){
  for (uk.ac.ebi.intact.model.Confidence conf : interaction.getConfidences()){
    Confidence confField = confidenceConverter.intactToCalimocho(conf);
if (interaction.getAc() != null){
  CrossReference id = new CrossReferenceImpl();
  id.setIdentifier(interaction.getAc());
  for (Experiment exp : interaction.getExperiments()){
    experimentConverter.intactToMitab(exp, binary, false, processPublicationDetails);
Collection<InteractorXref> interactionRefs = interaction.getXrefs();
if (!interaction.getParameters().isEmpty()){
  for (Parameter param : interaction.getParameters()){
    psidev.psi.mi.tab.model.Parameter paramField = parameterConverter.intactToMitab(param);
if (interaction.getCrc() != null){
  Checksum crc = new ChecksumImpl(CRC, interaction.getCrc());
  binary.getChecksums().add(crc);
if (interaction.getUpdated() != null){
  binary.getUpdateDate().add(interaction.getUpdated());

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

interaction.setOwner(getInstitution());
interaction.getExperiments().addAll(experiments);
interaction.setCvInteractionType(interactionType);
interaction.setCvInteractorType(interactorType);
if (imexId != null && !alreadyContainsImexXref(interaction)) {
  final InteractorXref imexXref = createImexXref(interaction, imexId);
  interaction.addXref(imexXref);
  log.error("Interaction without any participants : " + interaction.getShortLabel());
interaction.getComponents().addAll(components);
  interaction.addConfidence( confidence);
  interaction.addParameter(parameter);
  interaction.addAnnotation( new Annotation( getInstitution(),
      new CvTopic( getInstitution(), NEGATIVE ),
      TRUE ) );
  interaction.addAnnotation( new Annotation( getInstitution(),
      new CvTopic( getInstitution(), INTRA_MOLECULAR ),
      TRUE ) );
  interaction.addAnnotation( new Annotation( getInstitution(),

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

List<Component> components = new ArrayList<Component>(interaction.getComponents());
Collections.sort(components, new ComponentComparator());
experiments.addAll(interaction.getExperiments());
sb.append(createUniquenessString(interaction.getCvInteractionType()));
annotations.addAll(interaction.getAnnotations());

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psimitab-converters

protected boolean isExpandableBasic(Interaction interaction) {
  if (interaction.getComponents().isEmpty()) {
    return false;
  }
  return true;
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

private void updateExperimentParticipantDetectionMethod(Interaction interaction) {
  for (Experiment experiment : interaction.getExperiments()) {
    if (experiment.getCvIdentification() == null) {
      String partDetMethod = calculateParticipantDetMethod(interaction.getComponents());
      if (partDetMethod != null) {
        final String message = "Experiment ("+ experiment.getShortLabel() +") without participant detection method. One was calculated from the components: " + partDetMethod;
        addMessageToContext(MessageLevel.INFO, message, true);
        if (log.isWarnEnabled()) {
          log.warn(message);
        }
        CvIdentification detMethod = CvObjectUtils.createCvObject(experiment.getOwner(), CvIdentification.class, partDetMethod, "undefined");
        experiment.setCvIdentification(detMethod);
      } else {
        final String message = "Neither the Experiment nor its participants have CvIdentification (participant detection method). Using the term \"experimental particp\" (MI:0661).";
        if (log.isWarnEnabled()) log.warn(": Experiment '"+experiment.getShortLabel()+
            "', Interaction '"+interaction.getShortLabel()+"' - Location: "+ConverterContext.getInstance().getLocation().getCurrentLocation().pathFromRootAsString());
        addMessageToContext(MessageLevel.WARN, message, true);
        CvIdentification detMethod = CvObjectUtils.createCvObject(experiment.getOwner(), CvIdentification.class, "MI:0661", "experimental particp");
        experiment.setCvIdentification(detMethod);
      }
    }
  }
}

代码示例来源:origin: uk.ac.ebi.intact/intact-core

if ( !cvInteractionType.equals( interaction.getCvInteractionType() ) ) {
    return false;
  if ( interaction.getCvInteractionType() != null ) {
    return false;
  if ( !kD.equals( interaction.getKD() ) ) {
    return false;
  if ( interaction.getKD() != null ) {
    return false;
return CollectionUtils.isEqualCollection( getComponents(), interaction.getComponents() );

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

/**
  * This creates a stable (non-random) interaction
  */
 public Interaction createDeterministicInteraction() {
   Interaction interaction = createInteraction("fooprey-barbait",
                         createDeterministicProtein("A2", "barbait"),
                         createDeterministicProtein("A1", "fooprey"),
                         createDeterministicExperiment());
   interaction.getAnnotations().add(createAnnotation("This is an annotation", CvTopic.COMMENT_MI_REF, CvTopic.COMMENT));
   CvFeatureType featureType = createCvObject(CvFeatureType.class, CvFeatureType.EXPERIMENTAL_FEATURE_MI_REF, CvFeatureType.EXPERIMENTAL_FEATURE);
   Feature feature = createFeature("feature1", featureType);
   feature.setComponent(null);
   Range range = createRange(1, 1, 5, 5);
   feature.addRange(range);
   interaction.getComponents().iterator().next().addBindingDomain(feature);
//       interaction.getComponents().iterator().next().addComponentParameter(createDeterministicComponentParameter());
//       interaction.addXref(createPrimaryReferenceXref( interaction , "testreference"));
   interaction.addConfidence( createDeterministicConfidence());
   interaction.addParameter( createDeterministicInteractionParameter() );
   return interaction;
 }

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

interaction.setBioSource( intactExperiment.getBioSource() );
interaction.setFullName( interactionTag.getFullname() );
    interaction.setKD( kd );
    interaction.addAnnotation( annotation );
    interaction.addXref( xref );
    IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref );
  interaction.addAnnotation( annotation );

代码示例来源:origin: uk.ac.ebi.intact.core/intact-persister

/**
 * Used to create a unique chain of experiment labels, used to differenciate interactions
 * that could just have the same short label
 */
private String experimentLabels(Interaction interaction) {
  StringBuilder sb = new StringBuilder( interaction.getExperiments().size() * 21 ); // init to max size
  for (Experiment exp : interaction.getExperiments()) {
    sb.append( exp.getShortLabel() ).append( '_' );
  }
  return sb.toString();
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

/**
 * Retrieves the components from an interaction, initializing them if necessary.
 * Do not set the initialized collection of components because components cannot be orphan
 *
 * @param interaction the interaction
 * @return The returned components are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<Component> ensureInitializedParticipants(Interaction interaction) {
  Collection<Component> components;
  if (IntactCore.isInitialized(interaction.getComponents())) {
    components = interaction.getComponents();
  } else {
    components = IntactContext.getCurrentInstance().getDaoFactory().getComponentDao().getByInteractionAc(interaction.getAc());
  }
  return components;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Retrieves the experiment from an interaction, initializing them if necessary.
 *
 * @param interaction the interaction
 * @return The returned experiments are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<Experiment> ensureInitializedExperiments(Interaction interaction) {
  Collection<Experiment> experiments;
  if (IntactCore.isInitialized(interaction.getExperiments())) {
    experiments = interaction.getExperiments();
  } else {
    experiments = IntactContext.getCurrentInstance().getDaoFactory().getExperimentDao().getByInteractionAc(interaction.getAc());
  }
  return experiments;
}

相关文章