Examples of TaxonLabelSet


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

    OTUs xmlOTUs = xmlTreeBlock.getOTUs();
    Long tbTaxonLabelSetId = readTreeBaseID(xmlOTUs);
    TreeBlock tbTreeBlock = new TreeBlock();
    tbTreeBlock.setTitle(xmlTreeBlock.getLabel());
    if ( null != tbTaxonLabelSetId ) {
      TaxonLabelSet tbTaxonLabelSet = getTaxonLabelHome()
        .findPersistedObjectByID(TaxonLabelSet.class, tbTaxonLabelSetId);
      tbTreeBlock.setTaxonLabelSet(tbTaxonLabelSet);
    }
    Iterator<Network<?>> xmlNetworkIterator = xmlTreeBlock.iterator();
    while ( xmlNetworkIterator.hasNext() ) {
View Full Code Here

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

  @Override
  protected String getFileContent(long objectId, HttpServletRequest request) {
    Study pStudy = ControllerUtil.findStudy(request, getStudyService());
    Matrix matrix = getMatrixService().findByID(objectId);
    TaxonLabelSet taxa = matrix.getTaxa();   
    if ( getFormat(request) == FORMAT_NEXML || getFormat(request) == FORMAT_RDF ) {
      NexusDataSet pNexusDataSet = new NexusDataSet();
      pNexusDataSet.getTaxonLabelSets().add(taxa);
      pNexusDataSet.getMatrices().add(matrix);
      return getNexmlService().serialize(pNexusDataSet,getDefaultProperties(request),matrix.getStudy());
    }
    /*else if ( getFormat(request) == FORMAT_RDF ) {
      NexusDataSet pNexusDataSet = new NexusDataSet();
      pNexusDataSet.getTaxonLabelSets().add(taxa);
      pNexusDataSet.getMatrices().add(matrix);
      return getRdfaService().serialize(pNexusDataSet,getDefaultProperties(request),matrix.getStudy());     
    }*/
    else { // FORMAT_NEXUS or none
      StringBuilder matrixContent = new StringBuilder();
      matrixContent.append("#NEXUS\n");
      TreebaseUtil.attachStudyHeader(pStudy, matrixContent);
      if (taxa != null) {
        //one taxon per line, no line number:
        taxa.buildNexusBlockTaxa(matrixContent, true, false);
      }
      matrix.generateNexusBlock(matrixContent);   
      return matrixContent.toString();     
    }
  }
View Full Code Here

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

        builder.append(doc.getXmlString());
      }
      else {
        Set<PhyloTree> trees =  treeResults.getResults();
        TreeBlock treeBlock = new TreeBlock();
        TaxonLabelSet taxonLabelSet = new TaxonLabelSet();
        List<String> taxonLabels = new ArrayList<String>();

       
        for (PhyloTree pTree : trees) {
          for (TaxonLabel pTaxLabel : pTree.getTreeBlock().getTaxonLabelList()) {
            if (! taxonLabels.contains(pTaxLabel.getTaxonLabel())) {
              taxonLabelSet.addPhyloTaxonLabel(pTaxLabel);
              taxonLabels.add(pTaxLabel.getTaxonLabel());       
            }
          }
          treeBlock.addPhyloTree(pTree)
        }
       
        treeBlock.setTaxonLabelSet(taxonLabelSet);
        taxonLabelSet.setTitle("TB" + date.getTime());

       
        builder.append("#NEXUS\n\n");
     
        taxonLabelSet.buildNexusBlockTaxa(builder, true, false);
     
        treeBlock.generateAFileDynamicallyNoTranslate(builder);
        fileName += ".nex";
      }
     
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.