Examples of TaxonLabel


Examples of org.cipres.treebase.domain.taxon.TaxonLabel

    List<TaxonLabel> taxonLabels = tlSet.getTaxonLabelsReadOnly();

    // add rows
    for (int rowIndex = 0; rowIndex < taxonLabels.size(); rowIndex++) {

      TaxonLabel label = taxonLabels.get(rowIndex);

      MatrixRow aRow = new MatrixRow();
      aRow.setTaxonLabel(label);
      m.addRow(aRow);
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.TaxonLabel

    }
    if ( tbNode.isRootNode() ) {
      xmlNode.setRoot(true);
    }
    attachTreeBaseID(xmlNode, tbNode,PhyloTreeNode.class)
    TaxonLabel taxonLabel = tbNode.getTaxonLabel();
    if ( null != taxonLabel ) {
      Long taxonId = taxonLabel.getId();
      for ( OTUs xmlOTUs : getDocument().getOTUsList() ) {
        OTU xmlOTU = getOTUById(xmlOTUs, taxonId);
        if ( null != xmlOTU ) {
          xmlNode.setOTU(xmlOTU);
          break;
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.TaxonLabel

    else die("Unrecognized class name '" + className + "'");
  }
 
  public void doDeleteTaxonLabel(Long id) {
    TaxonLabelHome tlh = (TaxonLabelHome) ContextManager.getBean("taxonLabelHome");
    TaxonLabel tl = tlh.findPersistedObjectByID(TaxonLabel.class, id);
    if (tl == null) return;
    tlh.delete(tl);
  }
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.TaxonLabel

    if ( null != xmlOTUs.getLabel() ) {
      labelSet.setTitle(xmlOTUs.getLabel());
    }
    labelSet.setTaxa(true);
    for ( OTU xmlOTU : xmlOTUs.getAllOTUs() ) {
      TaxonLabel taxonLabel = fromXmlToTreeBase(xmlOTU);
      labelSet.addPhyloTaxonLabel(taxonLabel);
   
    return labelSet;
  }
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.TaxonLabel

   *
   * @param xmlOTU
   * @return
   */
  private TaxonLabel fromXmlToTreeBase(OTU xmlOTU) {
    TaxonLabel taxonLabel = getTaxonLabelHome().getByDescriptionAndStudy(xmlOTU.getLabel(), getStudy());
    taxonLabel.setStudy(getStudy());
    attachTreeBaseID(xmlOTU,taxonLabel,TaxonLabel.class);
    return taxonLabel;   
 
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.TaxonLabel

  private void traverseXmlTree(Tree<?> xmlTree, StringBuilder sb, Node xmlNode, PhyloTreeNode tbNode, PhyloTree tbTree) {
    tbTree.addTreeNode(tbNode);
    if ( null != xmlNode.getOTU() ) {
      Long tbTaxonLabelId = readTreeBaseID(xmlNode.getOTU());
      if ( null != tbTaxonLabelId ) {
        TaxonLabel tbTaxonLabel = getTaxonLabelHome()
          .findPersistedObjectByID(TaxonLabel.class, tbTaxonLabelId);
        tbNode.setTaxonLabel(tbTaxonLabel);
      }
    }
   
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.TaxonLabel

  public void setFixture(TaxonLabelHome fixture) {
    mFixture = fixture;
  }

  public void testFindTaxonLabelSets() {
    TaxonLabel tl = (TaxonLabel) loadObject(TaxonLabel.class);
   
    Set<TaxonLabelSet> tlSets = getFixture().findTaxonLabelSets(tl);
    assertFalse(tlSets.isEmpty());
   
    for (TaxonLabelSet tls : tlSets) {
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.TaxonLabel

    Study study = ControllerUtil.findStudy(request, mStudyService);
    Collection<TaxonLabel> taxonLabels = getTaxonLabelHome().findByStudy(study);
    Iterator<TaxonLabel> taxonLabelsIterator = taxonLabels.iterator();
    List<String> errors = new ArrayList<String>();
    while ( taxonLabelsIterator.hasNext() ) {
      TaxonLabel label = taxonLabelsIterator.next();
      if ( ! label.getAttemptedLinking() ) {
        errors.add(label.getTaxonLabel() + " has not been linked to the external taxonomy");
      }
      else if ( label.getAttemptedLinking() && label.getNcbiTaxID() == null ) {
        errors.add(label.getTaxonLabel() + " - an unsuccessful attempt has been made to link this to the external taxonomy");
      }
    }
   
    Map<Long,String> homonyms = (Map<Long,String>)request.getSession().getAttribute("homonyms");
    if ( homonyms != null ) {
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.TaxonLabel

    HttpServletRequest request,
    HttpServletResponse response,
    Object command,
    BindException bindExp) throws Exception {
    List<String> ubioResultErrors = new ArrayList<String>();
    TaxonLabel taxonLabel = (TaxonLabel) command;
    taxonLabel.setTaxonVariant(null);
    processRedirection(request, "onSubmit");
    TaxonVariant variant = getTaxonVariant(request, taxonLabel, ubioResultErrors);
    if ( variant != null ) {
      Map<Long,String> homonyms = (Map<Long,String>)request.getSession().getAttribute("homonyms");
      if ( homonyms != null ) {
        homonyms.remove(taxonLabel.getId());
        request.getSession().setAttribute("homonyms", homonyms);
      }
      taxonLabel.setAttemptedLinking(true);
      taxonLabel.setTaxonVariant(variant);
      getTaxonLabelService().update(taxonLabel);
      getTaxonLabelService().updateAndRegenerateNewick(taxonLabel);// Trees still need to be updated
      return new ModelAndView(getSuccessView());
    }

    long starttime = System.currentTimeMillis();
    variant = getTaxonLabelService().createFromUBIOService(taxonLabel);
    if ( variant == null ) {
      // For now user is not forced to enter the valid Taxon Label.
      // String message = "Taxon label: " + alabel + " is invalid.";
      // request.setAttribute("errors", message);
      // return showForm(request, response, bindExp);
    }
    else {
      taxonLabel.setAttemptedLinking(true);
      taxonLabel.setTaxonVariant(variant);
      getTaxonLabelService().update(taxonLabel);
    }

    if ( LOGGER.isInfoEnabled() ) {
      long endtime = System.currentTimeMillis();
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.TaxonLabel

   *
   * @throws ServletException
   */
  protected Object formBackingObject(HttpServletRequest request) throws ServletException {
    String taxonlabelid = ServletRequestUtils.getStringParameter(request, "taxonlabelid", null);
    TaxonLabel txnLabel = getTaxonLabelService().findByID(Long.parseLong(taxonlabelid));
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("VALUE OF Taxon Label ID in FORM BACKING =" + taxonlabelid);
    }
    Collection<TaxonVariant> variants = getTaxonLabelService().findTaxonVariants(txnLabel);   
    TaxonVariant currentVariant = txnLabel.getTaxonVariant();
    if ( currentVariant != null ) {
      request.getSession().setAttribute("currentVariantId", currentVariant.getId());   
      if ( ! variants.contains(currentVariant) ) {
        variants.add(currentVariant);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.