public BioSource createBioSource(int taxId, String shortLabel) { BioSource bioSource = new BioSource(getInstitution(), shortLabel, String.valueOf(taxId)); CvDatabase newt = createCvObject(CvDatabase.class, CvDatabase.NEWT_MI_REF, CvDatabase.NEWT); BioSourceXref newtXref = createIdentityXref(bioSource, String.valueOf(taxId), newt); bioSource.addXref(newtXref); return bioSource; }
public BioSource createBioSource(int taxId, String shortLabel) { BioSource bioSource = new BioSource(getInstitution(), shortLabel, String.valueOf(taxId)); CvDatabase newt = createCvObject(CvDatabase.class, CvDatabase.NEWT_MI_REF, CvDatabase.NEWT); BioSourceXref newtXref = createIdentityXref(bioSource, String.valueOf(taxId), newt); bioSource.addXref(newtXref); return bioSource; }
public BioSource createBioSource(int taxId, String shortLabel) { BioSource bioSource = new BioSource(getInstitution(), shortLabel, String.valueOf(taxId)); CvDatabase newt = createCvObject(CvDatabase.class, CvDatabase.NEWT_MI_REF, CvDatabase.NEWT); BioSourceXref newtXref = createIdentityXref(bioSource, String.valueOf(taxId), newt); bioSource.addXref(newtXref); return bioSource; }
/** * Create a BioSource * * @param shortlabel shortlabel of the Biosource. * @param fullname fullname of the Biosource. * @param taxid taxid of the Biosource. * @return a persistent BioSource. */ private BioSource createBioSource(String shortlabel, String fullname, String taxid) throws BioSourceServiceException { if (log.isDebugEnabled()) { log.debug("Persisting BioSource(" + taxid + ", " + shortlabel + ", " + fullname + ")"); } DataContext dataContext = IntactContext.getCurrentInstance().getDataContext(); DaoFactory daoFactory = dataContext.getDaoFactory(); if (institution == null) { institution = IntactContext.getCurrentInstance().getInstitution(); } // Instanciate it BioSource bioSource = new BioSource(institution, shortlabel, taxid); bioSource.setFullName(fullname); return bioSource; }
BioSource bioSource = new BioSource( institution, term.getCommonName(), String.valueOf( term.getTaxid() ) ); bioSource.setFullName( term.getScientificName() );
BioSource bioSource = new BioSource( institution, shortlabel, taxid ); bioSource.setFullName( fullname );
/** * Maps the provided protein to a uniprot identifier. * @param proteinToMap the protein to be Mapped */ public void map(Protein proteinToMap) throws BridgeFailedException { if(proteinToMap == null){ throw new IllegalArgumentException("Cannot remap a null protein"); } clear(); IdentificationContext context = new IdentificationContext(); if( proteinToMap.getOrganism() != null ) context.setOrganism(new BioSource(proteinToMap.getOrganism().getCommonName() != null ? proteinToMap.getOrganism().getCommonName() : "not specified", Integer.toString(proteinToMap.getOrganism().getTaxId()))); if(priorityIdentifiers == prioritySequence) mapWithBothPriorities(proteinToMap, context); else if(priorityIdentifiers) mapWithPriorityToIdentifiers(proteinToMap, context); else if(prioritySequence) mapWithPriorityToSequence(proteinToMap, context); }
public BioSource cloneBioSource(BioSource bioSource) throws IntactClonerException { if (bioSource == null) return null; BioSource clone = new BioSource(); clonerManager.addClone(bioSource, clone); clone.setTaxId(bioSource.getTaxId()); clone.setCvCellType(clone(bioSource.getCvCellType())); clone.setCvTissue(clone(bioSource.getCvTissue())); return clone; }
public BioSource cloneBioSource(BioSource bioSource) throws IntactClonerException { if (bioSource == null) return null; BioSource clone = new BioSource(); clonerManager.addClone(bioSource, clone); clone.setTaxId(bioSource.getTaxId()); clone.setCvCellType(clone(bioSource.getCvCellType())); clone.setCvTissue(clone(bioSource.getCvTissue())); return clone; }
BioSource bioSource = new BioSource(institution, shortlabel, taxid); bioSource.setFullName(fullname);
public BioSource psiToIntact(Organism psiObject) { if (psiObject == null) return null; psiStartConversion(psiObject); int taxId = psiObject.getNcbiTaxId(); BioSource bioSource = new BioSource(); bioSource.setTaxId(String.valueOf(taxId)); bioSource.setOwner(getInstitution()); IntactConverterUtils.populateNames(psiObject.getNames(), bioSource, aliasConverter); // cell type final CellType cellType = psiObject.getCellType(); if (cellType != null) { CvCellType intactCellType = cellTypeConverter.psiToIntact(cellType); bioSource.setCvCellType(intactCellType); } // tissue final Tissue tissue = psiObject.getTissue(); if (tissue != null) { CvTissue intactTissue = tissueConverter.psiToIntact(tissue); bioSource.setCvTissue(intactTissue); } if (psiObject.getCompartment() != null){ log.warn("Organism having a compartment : "+psiObject.getNcbiTaxId()+". Compartment is not converted in IntAct and is ignored."); } psiEndConversion(psiObject); return bioSource; }
BioSource bs = new BioSource( institution, label, taxid ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCurrentInstance(IntactContext.getCurrentInstance()).getBioSourceDao().persist( bs );
BioSource bs = new BioSource( institution, label, taxid ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCurrentInstance(IntactContext.getCurrentInstance()).getBioSourceDao().persist( bs );
BioSource bs = new BioSource( institution, label, taxid ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCurrentInstance(IntactContext.getCurrentInstance()).getBioSourceDao().persist( bs );
/** * Rigourous Test :-) */ public void testIsValidArgument() { Institution institution = new Institution("EBI"); BioSource bioSource = new BioSource(institution, "human", "9606"); CvInteractorType cvInteractorType = new CvInteractorType(institution,"protein"); Protein protein = new ProteinImpl(institution, bioSource, "lsm7", cvInteractorType); // This should return true. assertTrue(MethodArgumentValidator.isValidArgument(protein,Protein.class) ); // This should return true as Protein is a sub class of Interactor assertTrue(MethodArgumentValidator.isValidArgument(protein,Interactor.class) ); //This should send an IllegalArgumentException try{ MethodArgumentValidator.isValidArgument(protein,BioSource.class); fail("This should have sent and IllegalArgumentException as protein is not a BioSource"); }catch(IllegalArgumentException e){ assertTrue(true); } //This should send an NullPointerException try{ assertTrue(MethodArgumentValidator.isValidArgument(null,Interactor.class) ); fail("This should have sent and NullPointerException as protein is null"); }catch( NullPointerException e){ assertTrue(true); } }