public static String createExperimentTempShortLabel() { return new IntactMockBuilder().randomString(5)+"-0000"; }
public Component createComponentNeutral( Interactor interactor ) { CvInteractionType cvInteractionType = createCvObject(CvInteractionType.class, CvInteractionType.DIRECT_INTERACTION_MI_REF, CvInteractionType.DIRECT_INTERACTION); CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.INTERACTION_MI_REF, CvInteractorType.INTERACTION ); CvExperimentalRole expRole = createCvObject(CvExperimentalRole.class, CvExperimentalRole.NEUTRAL_PSI_REF, CvExperimentalRole.NEUTRAL); CvBiologicalRole bioRole = createCvObject(CvBiologicalRole.class, CvBiologicalRole.UNSPECIFIED_PSI_REF, CvBiologicalRole.UNSPECIFIED); Interaction interaction = new InteractionImpl(new ArrayList<Experiment>(Arrays.asList(createExperimentEmpty())), cvInteractionType, intType, nextString("label"), getInstitution()); Component component = createComponent(interaction, interactor, expRole, bioRole); for (int i=0; i<childRandom(0,2); i++) { component.addBindingDomain(createFeatureRandom()); } return component; }
public Annotation createAnnotation(String annotationText, String cvTopicPrimaryId, String cvTopicShortLabel) { CvTopic cvTopic = createCvObject(CvTopic.class, cvTopicPrimaryId, cvTopicShortLabel); return createAnnotation(annotationText, cvTopic); }
public Component createComponentBait(Interaction interaction, Interactor interactor) { CvExperimentalRole expRole = createCvObject(CvExperimentalRole.class, CvExperimentalRole.BAIT_PSI_REF, CvExperimentalRole.BAIT); CvBiologicalRole bioRole = createCvObject(CvBiologicalRole.class, CvBiologicalRole.UNSPECIFIED_PSI_REF, CvBiologicalRole.UNSPECIFIED); return createComponent(interaction, interactor, expRole, bioRole); }
public Component createComponentEnzymeTarget(Interactor interactor) { Interaction interaction = createInteractionDirect(); CvExperimentalRole expRole = createCvObject(CvExperimentalRole.class, CvExperimentalRole.ENZYME_TARGET_PSI_REF, CvExperimentalRole.ENZYME_TARGET); CvBiologicalRole bioRole = createCvObject(CvBiologicalRole.class, CvBiologicalRole.UNSPECIFIED_PSI_REF, CvBiologicalRole.UNSPECIFIED); return createComponent(interaction, interactor, expRole, bioRole); }
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; }
/** * 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; }
public Experiment createExperimentEmpty(String shortLabel) { Experiment experiment = new Experiment(getInstitution(), shortLabel, createBioSourceRandom()); experiment.setCvInteraction(createCvObject(CvInteraction.class, CvInteraction.COSEDIMENTATION_MI_REF, CvInteraction.COSEDIMENTATION)); experiment.setCvIdentification(createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED)); experiment.setPublication(createPublicationRandom()); experiment.addXref(createPrimaryReferenceXref(experiment, experiment.getPublication().getShortLabel())); return experiment; }
public Protein createProtein(String uniprotId, String shortLabel, BioSource bioSource) { CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.PROTEIN_MI_REF, CvInteractorType.PROTEIN); Protein protein = new ProteinImpl(getInstitution(), bioSource, shortLabel, intType); InteractorXref idXref = createIdentityXrefUniprot(protein, uniprotId); protein.addXref(idXref); InteractorAlias alias = createAliasGeneName(protein, shortLabel.toUpperCase()); protein.addAlias(alias); String sequence = randomPeptideSequence(); String crc64 = Crc64.getCrc64(sequence); protein.setSequence(sequence); protein.setCrc64(crc64); return protein; }
public Interaction createInteraction(String ... interactorShortLabels) { 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()); for (String interactorShortLabel : interactorShortLabels) { interaction.addComponent(createComponentNeutral(interaction, createProtein("uniprotId", interactorShortLabel))); } if (interactorShortLabels.length == 1) { interaction.addComponent(createComponentNeutral(interaction, createProtein("uniprotId", interactorShortLabels[0]))); } String shortLabel = InteractionUtils.calculateShortLabel(interaction); interaction.setShortLabel(shortLabel); return interaction; }
institution.setFullName(description); IntactMockBuilder mockBuilder = new IntactMockBuilder(institution); InstitutionXref idXref = mockBuilder.createIdentityXrefPsiMi(institution, miAc); institution.addXref(idXref); CvDatabase cvPubmed = mockBuilder.createCvObject(CvDatabase.class, CvDatabase.PUBMED_MI_REF, CvDatabase.PUBMED); InstitutionXref pubmedXref = mockBuilder.createIdentityXref(institution, pubmed, cvPubmed); institution.addXref(pubmedXref); CvTopic cvUrl = CvObjectUtils.createCvObject(institution, CvTopic.class, CvTopic.URL_MI_REF, CvTopic.URL); Annotation annotation = mockBuilder.createAnnotation( url, cvUrl); institution.addAnnotation(annotation); CvTopic cvEmail = CvObjectUtils.createCvObject(institution, CvTopic.class, CvTopic.CONTACT_EMAIL_MI_REF, CvTopic.CONTACT_EMAIL); Annotation annotation = mockBuilder.createAnnotation(email, cvEmail); institution.addAnnotation(annotation);
public Experiment createExperimentEmpty(String shortLabel, String pubId) { Experiment experiment = new Experiment(getInstitution(), shortLabel, createBioSourceRandom()); experiment.setCvInteraction(createCvObject(CvInteraction.class, CvInteraction.COSEDIMENTATION_MI_REF, CvInteraction.COSEDIMENTATION)); experiment.setCvIdentification(createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED)); Publication publication = createPublication(pubId); publication.addExperiment(experiment); experiment.addXref(createPrimaryReferenceXref(experiment, pubId)); return experiment; }
public Component createComponentNeutral(Interaction interaction, Interactor interactor) { CvExperimentalRole expRole = createCvObject(CvExperimentalRole.class, CvExperimentalRole.NEUTRAL_PSI_REF, CvExperimentalRole.NEUTRAL); CvBiologicalRole bioRole = createCvObject(CvBiologicalRole.class, CvBiologicalRole.UNSPECIFIED_PSI_REF, CvBiologicalRole.UNSPECIFIED); Component component = createComponent(interaction, interactor, expRole, bioRole); for (int i=0; i<childRandom(0,2); i++) { component.addBindingDomain(createFeatureRandom()); } return component; }
public Interaction createInteraction(String shortLabel, Interactor bait, Interactor prey, Experiment experiment) { CvInteractionType cvInteractionType = createCvObject(CvInteractionType.class, CvInteractionType.DIRECT_INTERACTION_MI_REF, CvInteractionType.DIRECT_INTERACTION ); CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.INTERACTION_MI_REF, CvInteractorType.INTERACTION ); Interaction interaction = new InteractionImpl(new ArrayList<Experiment>(Arrays.asList(experiment)), cvInteractionType, intType, shortLabel, getInstitution()); createComponentBait(interaction, bait); createComponentPrey(interaction, prey); return interaction; }
public Interaction createInteraction(Interactor ... interactors) { CvInteractionType cvInteractionType = createCvObject(CvInteractionType.class, CvInteractionType.DIRECT_INTERACTION_MI_REF, CvInteractionType.DIRECT_INTERACTION); Experiment experiment = createExperimentEmpty(); CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.INTERACTION_MI_REF, CvInteractorType.INTERACTION ); Interaction interaction = new InteractionImpl(new ArrayList<Experiment>(Arrays.asList(experiment)), cvInteractionType, intType, "temp", getInstitution()); Component[] components = new Component[interactors.length]; for (int i=0; i<interactors.length; i++) { components[i] = createComponentNeutral(interaction, interactors[i]); components[i].setInteraction(null); } return createInteraction(components); }
public BioSource createBioSourceRandom() { return createBioSource(nextId(), nextString("label")); }
public Protein createProteinRandom() { return createProtein(nextString("primId"), nextString(), createBioSourceRandom()); }
public NucleicAcid createNucleicAcid( String emblGenbankDdbjId, BioSource biosource, String shortlabel ) { CvInteractorType type = createCvObject(CvInteractorType.class, CvInteractorType.NUCLEIC_ACID_MI_REF, CvInteractorType.NUCLEIC_ACID); NucleicAcid na = new NucleicAcidImpl(getInstitution(), biosource, shortlabel, type); InteractorXref idXref = createIdentityXrefEmblGenbankDdbj(na, emblGenbankDdbjId); na.addXref(idXref); InteractorAlias alias = createAliasGeneName(na, shortlabel.toUpperCase()); na.addAlias(alias); return na; }
public SmallMolecule createSmallMolecule(String chebiId, String shortLabel) { CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.SMALL_MOLECULE_MI_REF, CvInteractorType.SMALL_MOLECULE); SmallMolecule smallMolecule = new SmallMoleculeImpl(shortLabel, getInstitution(), intType); InteractorXref idXref = createIdentityXrefChebi(smallMolecule, chebiId); smallMolecule.addXref(idXref); InteractorAlias alias = createAliasGeneName(smallMolecule, shortLabel.toUpperCase()); smallMolecule.addAlias(alias); return smallMolecule; }
public String randomString() { return randomString(childRandom(4,10)); }