public Interaction createInteractionRandomBinary() { CvInteractionType cvInteractionType = createCvObject(CvInteractionType.class, CvInteractionType.DIRECT_INTERACTION_MI_REF, CvInteractionType.DIRECT_INTERACTION); Interaction interaction = new InteractionImpl(new ArrayList<Experiment>(Arrays.asList(createExperimentEmpty())), cvInteractionType, null, nextString("label"), getInstitution()); interaction.addComponent(createComponentBait(interaction, createProteinRandom())); interaction.addComponent(createComponentPrey(interaction, createProteinRandom())); String shortLabel = InteractionUtils.calculateShortLabel(interaction); interaction.setShortLabel(shortLabel); return interaction; }
public Interaction createInteractionRandomBinary(String imexId) { CvInteractionType cvInteractionType = createCvObject(CvInteractionType.class, CvInteractionType.DIRECT_INTERACTION_MI_REF, CvInteractionType.DIRECT_INTERACTION); CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.INTERACTION_MI_REF, CvInteractorType.INTERACTION ); Experiment experimentEmpty = createExperimentEmpty(); Interaction interaction = new InteractionImpl(new ArrayList<Experiment>(Arrays.asList(experimentEmpty)), cvInteractionType, intType, nextString("label"), getInstitution()); experimentEmpty.getInteractions().add(interaction); createComponentBait(interaction, createProteinRandom()); createComponentPrey(interaction, createProteinRandom()); String shortLabel = InteractionUtils.calculateShortLabel(interaction); interaction.setShortLabel(shortLabel); if (imexId != null) { CvObjectBuilder cvBuilder = new CvObjectBuilder(); CvXrefQualifier idQual = cvBuilder.createIdentityCvXrefQualifier(getInstitution()); CvDatabase imexDb = createCvObject(CvDatabase.class, CvDatabase.IMEX_MI_REF, CvDatabase.IMEX); interaction.addXref(new InteractorXref(getInstitution(), imexDb, imexId, idQual)); } return interaction; }
public Interaction createInteractionRandomBinary(String imexId) { CvInteractionType cvInteractionType = createCvObject(CvInteractionType.class, CvInteractionType.DIRECT_INTERACTION_MI_REF, CvInteractionType.DIRECT_INTERACTION); CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.INTERACTION_MI_REF, CvInteractorType.INTERACTION ); Experiment experimentEmpty = createExperimentEmpty(); Interaction interaction = new InteractionImpl(new ArrayList<Experiment>(Arrays.asList(experimentEmpty)), cvInteractionType, intType, nextString("label"), getInstitution()); experimentEmpty.getInteractions().add(interaction); createComponentBait(interaction, createProteinRandom()); createComponentPrey(interaction, createProteinRandom()); String shortLabel = InteractionUtils.calculateShortLabel(interaction); interaction.setShortLabel(shortLabel); if (imexId != null) { CvObjectBuilder cvBuilder = new CvObjectBuilder(); CvXrefQualifier idQual = cvBuilder.createIdentityCvXrefQualifier(getInstitution()); CvDatabase imexDb = createCvObject(CvDatabase.class, CvDatabase.IMEX_MI_REF, CvDatabase.IMEX); interaction.addXref(new InteractorXref(getInstitution(), imexDb, imexId, idQual)); } return interaction; }