public Protein createPeptide(String uniprotId, String shortLabel, BioSource bioSource) { CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.PEPTIDE_MI_REF, "peptide"); return createProtein(uniprotId, shortLabel, bioSource, intType); }
public Protein createProtein(String uniprotId, String shortLabel, BioSource bioSource) { return createProtein(uniprotId, shortLabel, extractGeneNameFromLabel(shortLabel), bioSource); }
public Protein createProtein(String uniprotId, String shortLabel, BioSource bioSource, CvInteractorType intType) { return createProtein(uniprotId, shortLabel, extractGeneNameFromLabel(shortLabel), bioSource, intType); }
public Protein createProtein(String uniprotId, String shortLabel) { return createProtein(uniprotId, shortLabel, createBioSourceRandom()); }
public Protein createProtein(String uniprotId, String shortLabel, String geneName, BioSource bioSource) { CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.PROTEIN_MI_REF, CvInteractorType.PROTEIN); return createProtein(uniprotId, shortLabel, geneName, bioSource, intType ); }
public Protein createPeptide(String uniprotId, String shortLabel, BioSource bioSource) { CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.PEPTIDE_MI_REF, "peptide"); return createProtein(uniprotId, shortLabel, bioSource, intType); }
public Protein createProtein(String uniprotId, String shortLabel, String geneName, BioSource bioSource) { CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.PROTEIN_MI_REF, CvInteractorType.PROTEIN); return createProtein(uniprotId, shortLabel, geneName, bioSource, intType ); }
public Protein createProtein(String uniprotId, String shortLabel, BioSource bioSource, CvInteractorType intType) { return createProtein(uniprotId, shortLabel, extractGeneNameFromLabel(shortLabel), bioSource, intType); }
public Protein createProtein(String uniprotId, String shortLabel) { return createProtein(uniprotId, shortLabel, createBioSourceRandom()); }
public Protein createProtein(String uniprotId, String shortLabel) { return createProtein(uniprotId, shortLabel, createBioSourceRandom()); }
public Protein createDeterministicProtein(String uniprotId, String shortLabel) { return createProtein(uniprotId, shortLabel, createDeterministicBioSource()); }
public Protein createProteinRandom() { return createProtein(nextString("primId"), nextString(), createBioSourceRandom()); }
public Protein createProteinRandom() { return createProtein(nextString("primId"), nextString(), createBioSourceRandom()); }
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; }
@Test @Rollback(true) public void getByQuery_default() throws Exception { Assert.assertEquals(0, getDaoFactory().getProteinDao().countAll()); Protein prot1 = getMockBuilder().createProtein("A", "prot1"); Protein prot2 = getMockBuilder().createProtein("M", "pr0"); Protein prot3 = getMockBuilder().createProtein("Z", "prot2"); getPersisterHelper().save(prot1, prot2, prot3); SimpleSearchService searchService = new SimpleSearchService(); Collection<ProteinImpl> results = searchService.search(ProteinImpl.class, "prot*", null, null); Assert.assertEquals(2, results.size()); Assert.assertEquals(results.size(), searchService.count(ProteinImpl.class, "prot*")); }
@Test @Rollback(true) public void getByQuery_default() throws Exception { Assert.assertEquals(0, getDaoFactory().getProteinDao().countAll()); Protein prot1 = getMockBuilder().createProtein("A", "prot1"); Protein prot2 = getMockBuilder().createProtein("M", "pr0"); Protein prot3 = getMockBuilder().createProtein("Z", "prot2"); getPersisterHelper().save(prot1, prot2, prot3); SimpleSearchService searchService = new SimpleSearchService(); Collection<ProteinImpl> results = searchService.search(ProteinImpl.class, "prot*", null, null); Assert.assertEquals(2, results.size()); Assert.assertEquals(results.size(), searchService.count(ProteinImpl.class, "prot*")); }
public Protein createProteinSpliceVariant(Protein masterProt, String uniprotId, String shortLabel) { Protein spliceVariant = createProtein(uniprotId, shortLabel); if (masterProt.getAc() == null) { throw new IllegalArgumentException("Cannot create an splice variant if the master protein does not have an AC: "+masterProt.getShortLabel()); } CvXrefQualifier isoformParent = createCvObject(CvXrefQualifier.class, CvXrefQualifier.ISOFORM_PARENT_MI_REF, CvXrefQualifier.ISOFORM_PARENT); CvDatabase uniprotKb = createCvObject(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT); InteractorXref isoformXref = createXref(spliceVariant, masterProt.getAc(), isoformParent, uniprotKb); spliceVariant.addXref(isoformXref); return spliceVariant; }
public Protein createProteinChain(Protein masterProt, String uniprotId, String shortLabel) { Protein chain = createProtein(uniprotId, shortLabel); if (masterProt.getAc() == null) { throw new IllegalArgumentException("Cannot create a chain if the master protein does not have an AC: "+masterProt.getShortLabel()); } CvXrefQualifier chainParent = createCvObject(CvXrefQualifier.class, CvXrefQualifier.CHAIN_PARENT_MI_REF, CvXrefQualifier.CHAIN_PARENT); CvDatabase uniprotKb = createCvObject(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT); InteractorXref isoformXref = createXref(chain, masterProt.getAc(), chainParent, uniprotKb); chain.addXref(isoformXref); return chain; }
public Protein createProteinSpliceVariant(Protein masterProt, String uniprotId, String shortLabel) { Protein spliceVariant = createProtein(uniprotId, shortLabel); if (masterProt.getAc() == null) { throw new IllegalArgumentException("Cannot create an splice variant if the master protein does not have an AC: "+masterProt.getShortLabel()); } CvXrefQualifier isoformParent = createCvObject(CvXrefQualifier.class, CvXrefQualifier.ISOFORM_PARENT_MI_REF, CvXrefQualifier.ISOFORM_PARENT); CvDatabase uniprotKb = createCvObject(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT); InteractorXref isoformXref = createXref(spliceVariant, masterProt.getAc(), isoformParent, uniprotKb); spliceVariant.addXref(isoformXref); return spliceVariant; }
public Protein createProteinChain(Protein masterProt, String uniprotId, String shortLabel) { Protein chain = createProtein(uniprotId, shortLabel); if (masterProt.getAc() == null) { throw new IllegalArgumentException("Cannot create a chain if the master protein does not have an AC: "+masterProt.getShortLabel()); } CvXrefQualifier chainParent = createCvObject(CvXrefQualifier.class, CvXrefQualifier.CHAIN_PARENT_MI_REF, CvXrefQualifier.CHAIN_PARENT); CvDatabase uniprotKb = createCvObject(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT); InteractorXref isoformXref = createXref(chain, masterProt.getAc(), chainParent, uniprotKb); chain.addXref(isoformXref); return chain; }