@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("BioSource [ac: ").append(ac).append(", "); sb.append("taxId: ").append(taxId).append(", "); sb.append("shortLabel: ").append(getShortLabel()).append("]"); return sb.toString(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("BioSource [ac: ").append(ac).append(", "); sb.append("taxId: ").append(taxId).append(", "); sb.append("shortLabel: ").append(getShortLabel()).append("]"); return sb.toString(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("BioSource [ac: ").append(ac).append(", "); sb.append("taxId: ").append(taxId).append(", "); sb.append("shortLabel: ").append(getShortLabel()).append("]"); return sb.toString(); }
private SimpleBioSource(BioSource bioSource) { this.label = bioSource.getShortLabel(); this.taxId = bioSource.getTaxId(); }
@Override public String toString() { StringBuffer result = new StringBuffer( 512 ); result.append( "Experiment [AC: " + this.getAc() + " Shortlabel: " + getShortLabel() ); result.append( " BioSource: " + ( getBioSource() == null ? "-" : getBioSource().getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvIdentification: " + ( cvIdentification == null ? "-" : cvIdentification.getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvInteraction: " + ( cvInteraction == null ? "NOT SPECIFIED" : cvInteraction.getShortLabel() ) ); result.append( NEW_LINE ); result.append( ']' ); return result.toString(); } }
@Override public String toString() { StringBuffer result = new StringBuffer( 512 ); result.append( "Experiment [AC: " + this.getAc() + " Shortlabel: " + getShortLabel() ); result.append( " BioSource: " + ( getBioSource() == null ? "-" : getBioSource().getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvIdentification: " + ( cvIdentification == null ? "-" : cvIdentification.getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvInteraction: " + ( cvInteraction == null ? "NOT SPECIFIED" : cvInteraction.getShortLabel() ) ); result.append( NEW_LINE ); result.append( ']' ); return result.toString(); } }
@Override public void visitBioSource(BioSource bioSource) { currentNode.setUserObject("BioSource: "+bioSource.getShortLabel()+" (taxid:"+bioSource.getTaxId()+")"); }
private static void displayFoundMessage( BioSource bioSource ) { StringBuffer sb = new StringBuffer( 128 ); sb.append( "Found BioSource by taxid " ).append( bioSource.getTaxId() ); sb.append( ". Shortlabel is " ).append( bioSource.getShortLabel() ); if ( null != bioSource.getCvCellType() ) { sb.append( ", Celltype shortlabel: " ).append( bioSource.getCvCellType().getShortLabel() ); } else { sb.append( ", No CellType" ); } if ( null != bioSource.getCvTissue() ) { sb.append( ", Tissue shortlabel: " ).append( bioSource.getCvTissue().getShortLabel() ); } else { sb.append( ", No Tissue" ); } System.out.println( sb.toString() ); }
private static void displayFoundMessage( BioSource bioSource ) { StringBuffer sb = new StringBuffer( 128 ); sb.append( "Found BioSource by taxid " ).append( bioSource.getTaxId() ); sb.append( ". Shortlabel is " ).append( bioSource.getShortLabel() ); if ( null != bioSource.getCvCellType() ) { sb.append( ", Celltype shortlabel: " ).append( bioSource.getCvCellType().getShortLabel() ); } else { sb.append( ", No CellType" ); } if ( null != bioSource.getCvTissue() ) { sb.append( ", Tissue shortlabel: " ).append( bioSource.getCvTissue().getShortLabel() ); } else { sb.append( ", No Tissue" ); } System.out.println( sb.toString() ); }
@Override public void visitBioSource(BioSource bioSource) { currentNode.setUserObject("BioSource: "+bioSource.getShortLabel()+" (taxid:"+bioSource.getTaxId()+")"); }
private static void displayFoundMessage( BioSource bioSource ) { StringBuffer sb = new StringBuffer( 128 ); sb.append( "Found BioSource by taxid " ).append( bioSource.getTaxId() ); sb.append( ". Shortlabel is " ).append( bioSource.getShortLabel() ); if ( null != bioSource.getCvCellType() ) { sb.append( ", Celltype shortlabel: " ).append( bioSource.getCvCellType().getShortLabel() ); } else { sb.append( ", No CellType" ); } if ( null != bioSource.getCvTissue() ) { sb.append( ", Tissue shortlabel: " ).append( bioSource.getCvTissue().getShortLabel() ); } else { sb.append( ", No Tissue" ); } System.out.println( sb.toString() ); }
/**************************/ // is for find the ontology term for a specific interaction. Needs to take the host organism coming from experiment public OntologyTerm findOrganism(Interaction interaction) throws SolrServerException { // get BioSource information from interaction Collection<Experiment> exps = interaction.getExperiments(); if (exps.isEmpty()){ return null; } // TODO what do we do when we have several experiments? Experiment experiment = exps.iterator().next(); BioSource biosource = experiment.getBioSource(); // return an OntologyTerm using tax id and short label return biosource != null ? findOntologyTerm(biosource.getTaxId(), biosource.getShortLabel()) : null ; }
private static void printBiosource( BioSource bs, CvCellType cellType, CvTissue tissue ) { System.out.println( "Updating biosource: " + bs.getShortLabel() + "(taxid: " + bs.getTaxId() + " | CellType: " + (cellType != null ? cellType.getShortLabel() : "-") + " | Tissue: " + (tissue != null ? tissue.getShortLabel() : "-") + " | #alias: "+ bs.getAliases().size() +")" ); }
public static String getSpeciesName(InteractionImpl complex) { if (!complex.getExperiments().isEmpty()) { Experiment exp = complex.getExperiments().iterator().next(); BioSource bioSource = exp.getBioSource(); if (bioSource != null) { return bioSource.getFullName() != null ? bioSource.getFullName() : bioSource.getShortLabel(); } } return null; }
public static String getSpeciesName(InteractionImpl complex) { if (!complex.getExperiments().isEmpty()) { Experiment exp = complex.getExperiments().iterator().next(); BioSource bioSource = exp.getBioSource(); if (bioSource != null) { return bioSource.getFullName() != null ? bioSource.getFullName() : bioSource.getShortLabel(); } } return null; }
@Override public String toString() { StringBuffer result = new StringBuffer( 128 ); result.append( "Experiment [AC: " + this.getAc() + " Shortlabel: " + getShortLabel() ); result.append( " BioSource: " + ( getBioSource() == null ? "-" : getBioSource().getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvIdentification: " + ( cvIdentification == null ? "-" : cvIdentification.getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvInteraction: " + ( cvInteraction == null ? "NOT SPECIFIED" : cvInteraction.getShortLabel() ) ); result.append( NEW_LINE ); // TODO in experiments with many interactions this can throw OutOfMemoryErrors // result.append( "Interactions (" ); // if( null != getInteractions() ) { // for( Iterator iterator = interactions.iterator(); iterator.hasNext(); ) { // Interaction interaction = (Interaction) iterator.next(); // result.append( interaction.getShortLabel() ).append( ", " ); // } // } // result.append( ')' ); // result.append( NEW_LINE ); result.append( ']' ); return result.toString(); }
protected void copyInteractorCommons( Interactor source, Interactor target ) { if ( target.getBioSource() != null && source.getBioSource() == null ) { throw new PersisterException( "Operation not permitted: nullifying biosource of a " + target.getClass().getSimpleName() + " (" + target.getShortLabel() + ") - " + " current biosource is " + target.getBioSource().getShortLabel() ); } copyProperty(source, "bioSource", target); copyProperty(source, "cvInteractorType", target); }
protected void copyInteractorCommons( Interactor source, Interactor target ) { if ( target.getBioSource() != null && source.getBioSource() == null ) { throw new PersisterException( "Operation not permitted: nullifying biosource of a " + target.getClass().getSimpleName() + " (" + target.getShortLabel() + ") - " + " current biosource is " + target.getBioSource().getShortLabel() ); } copyProperty(source, "bioSource", target); copyProperty(source, "cvInteractorType", target); }
/** * Search the IntAct database and retreive a BioSource having the given taxid and no CvCellType or CvTissue. * * @param taxid a non null taxid. * @return a BioSource or null if none is found. */ private BioSource searchIntactByTaxid(String taxid) throws BioSourceServiceException { log.debug("Searching in the database for BioSource(" + taxid + ")"); DataContext dataContext = IntactContext.getCurrentInstance().getDataContext(); TransactionStatus transactionStatus = dataContext.beginTransaction(); BioSourceDao bsDao = dataContext.getDaoFactory().getBioSourceDao(); BioSource biosource = bsDao.getByTaxonIdUnique(taxid); try { dataContext.commitTransaction(transactionStatus); } catch (IntactTransactionException e) { throw new BioSourceServiceException("Problem committing", e); } if (log.isDebugEnabled()) { if (biosource == null) { log.debug("Could not find Biosource having taxid: " + taxid); } else { log.debug("Found 1 biosource: " + biosource.getShortLabel() + " [" + biosource.getAc() + "]"); } } return biosource; }
public Organism intactToMitab(BioSource organism){ if (organism != null && organism.getTaxId() != null){ Organism mitabOrganism = new OrganismImpl(); String name = organism.getShortLabel(); String fullName = organism.getFullName(); String taxId = organism.getTaxId(); if (name != null){ mitabOrganism.addIdentifier(new CrossReferenceImpl(TAXID, organism.getTaxId(), name)); } if (fullName != null){ mitabOrganism.addIdentifier(new CrossReferenceImpl(TAXID, organism.getTaxId(), fullName)); } return mitabOrganism; } return null; } }