/** * Creates an instance of Polymer type based on type. * * @param owner The Institution which owns this instance * @param source The biological source of the Protein observation * @param shortLabel The memorable label to identify this instance * @param type The interactor type. This alone decides which type to create - should be not null. * * @return an instance of <code>Polymer</code> based on <code>type</code> or null if a Polymer cannot be * instantiated (for exampple, no MI found in given type) */ public static Polymer factory( Institution owner, BioSource source, String shortLabel, CvInteractorType type ) { Polymer polymer = null; if ( CvObjectUtils.isProteinType( type ) ) { polymer = new ProteinImpl( owner, source, shortLabel, type ); } else if ( CvObjectUtils.isPeptideType( type ) ) { polymer = new ProteinImpl( owner, source, shortLabel, type ); } else if ( CvObjectUtils.isNucleicAcidType( type ) ) { polymer = new NucleicAcidImpl( owner, source, shortLabel, type ); } else { throw new IllegalArgumentException( "The given MI is neither a Protein, a Peptide or a NUcleicAcid MI: " + type ); } return polymer; }
public boolean isProteinEligible(ProteinImpl protein) { // Skip proteins annotated no-uniprot-update if (false == needsUniprotUpdate(protein)) { getOut().println(protein.getAc() + " " + protein.getShortLabel() + " is not from UniProt, skip it."); return false; } return isHighConfidence(protein); }
/** * add a new uniprot cross reference with qualifier identity to the list of cross references of the protein * @param prot : the protein * @param uniprotAc : the uniprot accession * @param factory : the Intact factory (not used) */ private void addUniprotCrossReferenceTo(ProteinImpl prot, String uniprotAc, DaoFactory factory){ InteractorXref ref = createIdentityInteractorXrefForUniprotAc(uniprotAc); if (ref != null){ log.info("cross reference to uniprot "+ uniprotAc +" added to the cross references of " + prot.getAc()); //factory.getXrefDao(InteractorXref.class).persist( ref ); prot.addXref(ref); } }
this.context.clean(); String accession = prot.getAc(); Collection<InteractorXref> refs = prot.getXrefs(); String sequence = prot.getSequence(); BioSource organism = prot.getBioSource();
String accession = prot.getAc(); String shortLabel = prot.getShortLabel(); log.info("Protein AC = " + accession + " shortLabel = " + shortLabel); Collection<InteractorXref> refs = prot.getXrefs(); Collection<Annotation> annotations = prot.getAnnotations(); String sequence = prot.getSequence(); BioSource organism = prot.getBioSource(); prot.removeAnnotation(a); daoFactory.getAnnotationDao().delete(a); prot.removeAnnotation(a2); daoFactory.getAnnotationDao().delete(a2);
public MineInteraction( ProteinImpl protein1, ProteinImpl protein2, InteractionImpl interaction ) { this.pk = new MineInteractionPk( protein1, protein2, interaction ); this.shortLabel1 = protein1.getShortLabel(); this.shortLabel2 = protein2.getShortLabel(); }
getOut().println("ERROR: The splice variant having the AC(" + protein.getAc() + ") doesn't have it's master AC."); } else { master = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getProteinDao().getByAc(masterAc); protein.getAc() + ") having the AC(" + masterAc + ")"); } else {
String accession = prot.getAc(); String shortLabel = prot.getShortLabel(); log.info("Protein AC = " + accession + " shortLabel = " + shortLabel); Collection<InteractorXref> refs = prot.getXrefs(); String sequence = prot.getSequence(); BioSource organism = prot.getBioSource();
public MineInteraction( ProteinImpl protein1, ProteinImpl protein2, InteractionImpl interaction ) { this.pk = new MineInteractionPk( protein1, protein2, interaction ); this.shortLabel1 = protein1.getShortLabel(); this.shortLabel2 = protein2.getShortLabel(); }
/** * Creates an instance of Polymer type based on type. * * @param owner The Institution which owns this instance * @param source The biological source of the Protein observation * @param shortLabel The memorable label to identify this instance * @param type The interactor type. This alone decides which type to create - should be not null. * * @return an instance of <code>Polymer</code> based on <code>type</code> or null if a Polymer cannot be * instantiated (for exampple, no MI found in given type) */ public static Polymer factory( Institution owner, BioSource source, String shortLabel, CvInteractorType type ) { Polymer polymer = null; if ( CvObjectUtils.isProteinType( type ) ) { polymer = new ProteinImpl( owner, source, shortLabel, type ); } else if ( CvObjectUtils.isPeptideType( type ) ) { polymer = new ProteinImpl( owner, source, shortLabel, type ); } else if ( CvObjectUtils.isNucleicAcidType( type ) ) { polymer = new NucleicAcidImpl( owner, source, shortLabel, type ); } else { throw new IllegalArgumentException( "The given MI is neither a Protein, a Peptide or a NUcleicAcid MI: " + type ); } return polymer; }
public boolean isProteinEligible(ProteinImpl protein) { // Skip proteins annotated no-uniprot-update if (false == needsUniprotUpdate(protein)) { getOut().println(protein.getAc() + " " + protein.getShortLabel() + " is not from UniProt, skip it."); return false; } return isHighConfidence(protein); }
public MineInteraction( ProteinImpl protein1, ProteinImpl protein2, InteractionImpl interaction ) { this.pk = new MineInteractionPk( protein1, protein2, interaction ); this.shortLabel1 = protein1.getShortLabel(); this.shortLabel2 = protein2.getShortLabel(); }
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 boolean isProteinEligible(ProteinImpl protein) { // Skip proteins annotated no-uniprot-update if (false == needsUniprotUpdate(protein)) { getOut().println(protein.getAc() + " " + protein.getShortLabel() + " is not from UniProt, skip it."); return false; } return isInvolvedWithBinaryInteractions(protein); }
@Test @Rollback(true) public void getByQuery_sorted() 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("xrefs.primaryId", false); Collection<ProteinImpl> results = searchService.search(ProteinImpl.class, "pr*", null, null); Assert.assertEquals(3, results.size()); Assert.assertEquals(results.size(), searchService.count(ProteinImpl.class, "pr*")); int i=0; for (ProteinImpl prot : results) { if (i ==0) Assert.assertEquals("prot2", prot.getShortLabel()); // Z if (i ==1) Assert.assertEquals("pr0", prot.getShortLabel()); // M if (i ==2) Assert.assertEquals("prot1", prot.getShortLabel()); // A i++; } }
polymer = new ProteinImpl( owner, source, shortLabel, type ); } else if ( CvInteractorType.isNucleicAcidMI( mi ) ) { polymer = new NucleicAcidImpl( owner, source, shortLabel, type );
getOut().println(protein.getAc() + " " + protein.getShortLabel() + " is not from UniProt, skip it."); continue; // process next AC if (protein.getShortLabel().indexOf('-') != -1) { getOut().println("ERROR: The splice variant having the AC(" + protein.getAc() + ") doesn't have it's master AC."); } else { master = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getProteinDao().getByAc(masterAc); protein.getAc() + ") having the AC(" + masterAc + ")"); } else {
@Test @Rollback(true) public void getByQuery_sorted() 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("xrefs.primaryId", false); Collection<ProteinImpl> results = searchService.search(ProteinImpl.class, "pr*", null, null); Assert.assertEquals(3, results.size()); Assert.assertEquals(results.size(), searchService.count(ProteinImpl.class, "pr*")); int i=0; for (ProteinImpl prot : results) { if (i ==0) Assert.assertEquals("prot2", prot.getShortLabel()); // Z if (i ==1) Assert.assertEquals("pr0", prot.getShortLabel()); // M if (i ==2) Assert.assertEquals("prot1", prot.getShortLabel()); // A i++; } }
private Protein createProtein(String uniprotId, String shortLabel, String geneName, BioSource bioSource, CvInteractorType intType) { Protein protein = new ProteinImpl(getInstitution(), bioSource, shortLabel, intType); InteractorXref idXref = createIdentityXrefUniprot(protein, uniprotId); protein.addXref(idXref); InteractorAlias alias = createAliasGeneName(protein, geneName); protein.addAlias(alias); String sequence = randomPeptideSequence(); String crc64 = Crc64.getCrc64(sequence); protein.setSequence(sequence); protein.setCrc64(crc64); return protein; }