Examples of OTUs


Examples of org.nexml.model.OTUs

   * @param xmlOTUs
   * @param stateSet
   */
  private void populateDiscreteNexmlMatrix(org.nexml.model.Matrix<CharacterState> xmlMatrix, DiscreteMatrix tbMatrix) { 
   
    OTUs xmlOTUs = xmlMatrix.getOTUs();
    List<org.nexml.model.Character> xmlCharacters = xmlMatrix.getCharacters();
   
    // iterates over all matrix rows, i.e. ntax times
    for ( MatrixRow tbRow : tbMatrix.getRowsReadOnly() ) {
      Set<RowSegment> tbSegments = tbRow.getSegmentsReadOnly();
      OTU xmlOTU = getOTUById(xmlOTUs, tbRow.getTaxonLabel().getId());
      if ( xmlCharacters.size() <= MAX_GRANULAR_NCHAR && xmlOTUs.getAllOTUs().size() <= MAX_GRANULAR_NTAX ) {
        populateDiscreteVerboseNexmlMatrix(xmlMatrix,tbMatrix,xmlCharacters,tbRow,tbSegments,xmlOTU);
      }
      else {
        String seq = tbRow.getNormalizedSymbolString();
       
View Full Code Here

Examples of org.nexml.model.OTUs

   * @param tbMatrix
   */
  private void populateContinuousNexmlMatrix(org.nexml.model.ContinuousMatrix xmlMatrix,
      ContinuousMatrix tbMatrix) {
    List<org.nexml.model.Character> characterList = xmlMatrix.getCharacters();
    OTUs xmlOTUs = xmlMatrix.getOTUs();
    for ( MatrixRow tbRow : tbMatrix.getRowsReadOnly() ) {     
      List<MatrixElement> elements = tbRow.getElements();
      OTU xmlOTU = getOTUById(xmlOTUs, tbRow.getTaxonLabel().getId());
      if ( characterList.size() <= MAX_GRANULAR_NCHAR && xmlOTUs.getAllOTUs().size() <= MAX_GRANULAR_NTAX ) {
        for ( int elementIndex = 0; elementIndex < tbMatrix.getnChar(); elementIndex++ ) {
          ContinuousMatrixElement tbCell = (ContinuousMatrixElement)elements.get(elementIndex);
          MatrixCell<Double> xmlCell = xmlMatrix.getCell(xmlOTU, characterList.get(elementIndex));
          xmlCell.setValue(tbCell.getValue());
          attachTreeBaseID((Annotatable)xmlCell,tbCell,DiscreteMatrixElement.class);
View Full Code Here

Examples of org.nexml.model.OTUs

        String tbId = "M" + tbMatrix.getId();
        // if true, the matrices are equivalent
        System.out.println(tbId);
        int otuIndex = 0;
        for ( MatrixRow tbRow : ((CharacterMatrix) tbMatrix).getRowsReadOnly() ) {
          OTUs xmlOTUs = nexMatrix.getOTUs();
         
          //need to make an OTU list because getOTUByID cannot be is private
          List<OTU> xmlOTUList = xmlOTUs.getAllOTUs();//getOTUById(xmlOTUs, tbRow.getTaxonLabel().getId());
          OTU xmlOTU = xmlOTUList.get(otuIndex); //get xmlOTUs
          List<org.nexml.model.Character> characterList = nexMatrix.getCharacters();
       
          int charIndex = 0;
          if ( characterList.size() <= MAX_GRANULAR_NCHAR && xmlOTUs.getAllOTUs().size() <= MAX_GRANULAR_NTAX ) {
         
            //tbColumn is not used, but is in the actual NexmlMatrixConverter class.
            //it is necessary so the for loop does not crash
            for ( MatrixColumn tbColumn : ((CharacterMatrix)tbMatrix).getColumns() ) {
             
View Full Code Here

Examples of org.nexml.model.OTUs

   * @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.nexml.model.OTUs

   *
   * @param taxonLabelSet
   * @return
   */
  public OTUs fromTreeBaseToXml(TaxonLabelSet taxonLabelSet) {
    OTUs xmlOTUs = getDocument().createOTUs();
    attachTreeBaseID(xmlOTUs,taxonLabelSet,TaxonLabelSet.class);
   
    xmlOTUs.setBaseURI(mTaxonBaseURI);
    xmlOTUs.addAnnotationValue("skos:historyNote", Constants.SKOSURI, "Mapped from TreeBASE schema using "+this.toString()+" $Rev: 1040 $");   
    xmlOTUs.setLabel(taxonLabelSet.getTitle());
   
    for ( TaxonLabel taxonLabel : taxonLabelSet.getTaxonLabelsReadOnly() ) {
      fromTreeBaseToXml(taxonLabel,xmlOTUs);
    }
    return xmlOTUs;
View Full Code Here

Examples of org.nexml.model.OTUs

   *
   * @param taxonLabelSet
   * @return
   */
  protected OTUs fromTreeBaseToXml(Set<TaxonLabel> taxonLabelSet) {
    OTUs xmlOTUs = getDocument().createOTUs();
   
    // attach base uri and skos:historyNote
    xmlOTUs.setBaseURI(mTaxonBaseURI);
    xmlOTUs.addAnnotationValue("skos:historyNote", Constants.SKOSURI, "Mapped from TreeBASE schema using "+this.toString()+" $Rev: 1040 $");
   
    for ( TaxonLabel taxonLabel : taxonLabelSet ) {
      fromTreeBaseToXml(taxonLabel,xmlOTUs);
    }
    return xmlOTUs;
View Full Code Here

Examples of org.nexml.model.OTUs

   *
   * @param xmlMatrix
   * @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()
View Full Code Here

Examples of org.nexml.model.OTUs

      mergedLabels.addAll(labelsInTree);
    }
   
    // convert merged set of taxon labels to XML OTUs   
    NexmlOTUWriter noc = new NexmlOTUWriter(null,getTaxonLabelHome(),getDocument());
    OTUs xmlOTUs = noc.fromTreeBaseToXml(mergedLabels);
   
    // convert matrices to XML trees
    NexmlMatrixWriter nmc = new NexmlMatrixWriter(null,getTaxonLabelHome(),getDocument());
    for (Matrix m : searchResults.getResults()) {
      nmc.fromTreeBaseToXml((CharacterMatrix)m,xmlOTUs);
View Full Code Here

Examples of org.nexml.model.OTUs

      mergedLabels.addAll(labelsInTree);
    }
   
    // convert merged set of taxon labels to XML OTUs   
    NexmlOTUWriter noc = new NexmlOTUWriter(null,getTaxonLabelHome(),getDocument());
    OTUs xmlOTUs = noc.fromTreeBaseToXml(mergedLabels);
   
    // convert phylotrees to XML trees
    NexmlTreeBlockWriter ntc = new NexmlTreeBlockWriter(null,getTaxonLabelHome(),getDocument());
    TreeBlock xmlTreeBlock = getDocument().createTreeBlock(xmlOTUs);
    for (PhyloTree t : searchResults.getResults()) {
View Full Code Here

Examples of org.nexml.model.OTUs

    return getDocument();
 
 
  public Document fromTreeBaseToXml(TaxonSearchResults searchResults) {
    NexmlOTUWriter noc = new NexmlOTUWriter(null,getTaxonLabelHome(),getDocument());
    OTUs xmlOTUs = getDocument().createOTUs();
    for (Taxon t : searchResults.getResults()) {
      noc.fromTreeBaseToXml(t, xmlOTUs);
    }
    return getDocument();
 
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.