Examples of TaxonLabelSet


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

  }

  @Transient
  public void generateAFileDynamically(StringBuilder pBuilder) {

    TaxonLabelSet tlSet = getTaxonLabelSet();
    List<TaxonLabel> txnlbllist = tlSet.getTaxonLabelsReadOnly();
    int numoftxnlbls = getTaxonNumber();

    String title = getTitle();
    if (TreebaseUtil.isEmpty(title)) {
      //use the default title:
      //title = "List of Uploaded Tree Block";
    }
    pBuilder.append("BEGIN TREES;\n");
    pBuilder.append("      TITLE " + StringUtil.tokenize(getTitle()) + ";\n");
    pBuilder.append("      LINK TAXA = " + StringUtil.tokenize(tlSet.getTitle().replaceAll("Input|Output", "")) + ";\n");
    pBuilder.append("         TRANSLATE\n");

    tlSet.buildTaxonWithLineNumber(pBuilder);

    for (PhyloTree atree : getTreeList()) {
      pBuilder.append("      TREE " + StringUtil.tokenize(atree.getLabel()) + " = ");

      if (atree.getRootedTree() != null) {
        if (atree.getRootedTree().booleanValue()) {
          pBuilder.append("[&R] ");
        } else {
          pBuilder.append("[&U] ");
        }

      }
      String tmpnewick, newick = atree.getNewickString();
      List<TaxonLabel> txnlbllistclone = new ArrayList<TaxonLabel>(txnlbllist);
      tlSet.sortByTaxonLabelLength(txnlbllistclone);
      HashMap<String, Integer> txnOrder = new HashMap<String, Integer>();
      for (int y = 0; y < numoftxnlbls; y++) {
        txnOrder.put(txnlbllist.get(y).getTaxonLabel(), y);
      }
      for (int z = 0; z < numoftxnlbls; z++) {
View Full Code Here

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

  }
 
  @Transient
  public void generateAFileDynamicallyNoTranslate(StringBuilder pBuilder) {

    TaxonLabelSet tlSet = getTaxonLabelSet();
    List<TaxonLabel> txnlbllist = tlSet.getTaxonLabelsReadOnly();
    int numoftxnlbls = getTaxonNumber();

    String title = getTitle();
    if (TreebaseUtil.isEmpty(title)) {
      //use the default title:
      //title = "List of Uploaded Tree Block";
    }
    pBuilder.append("BEGIN TREES;\n");
    //pBuilder.append("      TITLE " + StringUtil.tokenize(getTitle()) + ";\n");
   
    pBuilder.append("      TITLE " + StringUtil.tokenize(Integer.toString(getTreeList().size())) + "Trees;\n");
    pBuilder.append("      LINK TAXA = " + StringUtil.tokenize(tlSet.getTitle().replaceAll("Input|Output", "")) + ";\n");


    for (PhyloTree atree : getTreeList()) {
      pBuilder.append("      TREE Tr" + atree.getId() + " = ");
View Full Code Here

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

    return getTaxonLabelList().size();
  }

  @Transient
  public List<TaxonLabel> getTaxonLabelList() {
    TaxonLabelSet tlSet = getTaxonLabelSet();
    return tlSet == null ? new ArrayList<TaxonLabel>()
                     : tlSet.getTaxonLabelsReadOnly();
  }
View Full Code Here

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

    m.setMissingSymbol(pMesqMatrix.getUnassignedSymbol());
    m.setGapSymbol(pMesqMatrix.getInapplicableSymbol());
    m.setDataType(getMatrixDataType());

    Taxa mesqTaxa = pMesqMatrix.getTaxa();
    TaxonLabelSet tlSet = pDataSet.getTaxonLabelSet(mesqTaxa);
    m.setTaxa(tlSet);
    List<TaxonLabel> taxonLabels = tlSet.getTaxonLabelsReadOnly();

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

      TaxonLabel label = taxonLabels.get(rowIndex);
View Full Code Here

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

    Collection<AnalyzedData> dataLink = getAnalyzedDataHome().findByMatrix(pMatrix);
    for (AnalyzedData data : dataLink) {
      data.getAnalysisStep().removeAnalyzedData(data);
    }
   
    TaxonLabelSet tSet = pMatrix.getTaxa();
    List<TaxonLabel> tList = pMatrix.getAllTaxonLabels();
     
    getHibernateTemplate().delete(pMatrix)
   
    getTaxonLabelHome().clean(tSet);
View Full Code Here

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

   * @see org.cipres.treebase.domain.tree.PhyloTreeHome#deleteTreeBlock(org.cipres.treebase.domain.tree.TreeBlock)
   */
  public void deleteTreeBlock(TreeBlock pTreeBlock) {
    if (pTreeBlock != null && pTreeBlock.getId() != null) {
     
      TaxonLabelSet tSet=pTreeBlock.getTaxonLabelSet();
     
      // bi-directional relationships:
      // * submission -> treeblock
      Submission sub = getSubmissionHome().findByTreeBlock(pTreeBlock);
      if (sub != null) {
View Full Code Here

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

   *
   * @param treeBlock
   * @return
   */
  public org.nexml.model.TreeBlock fromTreeBaseToXML(TreeBlock treeBlock) {
    TaxonLabelSet taxonLabelSet = treeBlock.getTaxonLabelSet();
    OTUs xmlOTUs = getOTUsById(taxonLabelSet.getId());
    org.nexml.model.TreeBlock xmlTreeBlock = getDocument().createTreeBlock(xmlOTUs);
    attachTreeBaseID((Annotatable)xmlTreeBlock,treeBlock,TreeBlock.class);
   
    // attach base uri and skos:historyNote
    xmlTreeBlock.addAnnotationValue("skos:historyNote", Constants.SKOSURI, "Mapped from TreeBASE schema using "+this.toString()+" $Rev: 1040 $");
View Full Code Here

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

    NexusDataSet nexusDataSet = new NexusDataSet();
    nexusDataSet.setNexmlProject(pDocument);
   
    NexmlOTUReader noc = new NexmlOTUReader(getStudy(),getTaxonLabelHome(),pDocument);
    for ( OTUs xmlOTUs : pDocument.getOTUsList() ) {
      TaxonLabelSet taxonLabelSet = noc.fromXmlToTreeBase(xmlOTUs);
      nexusDataSet.addTaxonLabelSet(xmlOTUs, taxonLabelSet);
    }
   
    NexmlMatrixReader nmc = new NexmlMatrixReader(getStudy(),getTaxonLabelHome(),pDocument);
    for ( Matrix<?> xmlMatrix : pDocument.getMatrices() ) {
View Full Code Here

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

   *
   * @param xmlOTUs
   * @return
   */
  public TaxonLabelSet fromXmlToTreeBase (OTUs xmlOTUs) {
    TaxonLabelSet labelSet = new TaxonLabelSet();
    attachTreeBaseID(xmlOTUs,labelSet,TaxonLabelSet.class);
    labelSet.setStudy(getStudy());
    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.TaxonLabelSet

   * @return
   */
  public Matrix fromXmlToTreeBase(org.nexml.model.Matrix<?> xmlMatrix) {
    OTUs xmlOTUs = xmlMatrix.getOTUs();
    Matrix tbMatrix = null;
    TaxonLabelSet tbTaxa = null;
    Long tbTaxonLabelSetID = readTreeBaseID((Annotatable) xmlOTUs);
    if ( null != tbTaxonLabelSetID ) {
      tbTaxa = getTaxonLabelHome()
        .findPersistedObjectByID(TaxonLabelSet.class, tbTaxonLabelSetID);
    }   
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.