Examples of MatrixColumn


Examples of org.cipres.treebase.domain.matrix.MatrixColumn

    String missingSymbolStr = "" + matrix.getMissingSymbol();

    // add matrix row elements
    for (int colIndex = 0; colIndex < numChars; colIndex++) {
      // first find mesquite char and treebase char:
      MatrixColumn matrixColumn = columns.get(colIndex);
      DiscreteChar columnChar = (DiscreteChar) matrixColumn.getCharacter();

      // convert the mesquite character state to treebase state:
      long statesLong = categoricalData.getState(colIndex, pRowIndex);

      MatrixElement element = null;
View Full Code Here

Examples of org.cipres.treebase.domain.matrix.MatrixColumn

    String missingSymbolStr = "" + matrix.getMissingSymbol();

    // add matrix row elements
    for (int colIndex = 0; colIndex < numChars; colIndex++) {
      // first find mesquite char and treebase char:
      MatrixColumn matrixColumn = columns.get(colIndex);
      DiscreteChar columnChar = (DiscreteChar) matrixColumn.getCharacter();

      // convert the mesquite character state to treebase state:
      long statesLong = categoricalData.getState(colIndex, pRowIndex);

      MatrixElement element = null;
View Full Code Here

Examples of org.cipres.treebase.domain.matrix.MatrixColumn

    List<MatrixColumn> columns = pRow.getMatrix().getColumnsReadOnly();

    // add matrix row elements
    for (int colIndex = 0; colIndex < numChars; colIndex++) {
      // first find mesquite char and treebase char:
      MatrixColumn matrixColumn = columns.get(colIndex);
      //ContinuousChar columnChar = (ContinuousChar) matrixColumn.getCharacter();

      MatrixElement element = null;

      if (numItems > 1) {
View Full Code Here

Examples of org.cipres.treebase.domain.matrix.MatrixColumn

    // add two columns:
    DiscreteChar dnaChar = (DiscreteChar) dnaType.getDefaultCharacter();
    assertTrue("Failed to load dna character", dnaChar != null);

    MatrixColumn c1 = new MatrixColumn();
    c1.setCharacter(dnaChar);
    matrix.addColumn(c1);

    MatrixColumn c2 = new MatrixColumn();
    c2.setCharacter(dnaChar);
    matrix.addColumn(c2);

    // add two rows:
    TaxonLabel taxonLabel = new TaxonLabel();
    taxonLabel.setTaxonLabel(newName);

    // missing symbol is ?
    DiscreteCharState aState = dnaChar.getStateByDescription("" + DiscreteCharState.MISSING_SYMBOL);
    assertTrue("? is not a valid state", aState != null);

    // create one row with 2 elements:
    MatrixRow r1 = new MatrixRow();
    r1.setTaxonLabel(taxonLabel);

    DiscreteMatrixElement e1 = new DiscreteMatrixElement();
    e1.setColumn(c1);
    e1.setCharState(aState);
    r1.addElement(e1);

    DiscreteMatrixElement e2 = new DiscreteMatrixElement();
    e2.setColumn(c2);
    e2.setCharState(aState);
    r1.addElement(e2);

    // add two segments, each with one element:
    RowSegment seg1 = new RowSegment();

    seg1.setStartIndex(0);
    seg1.setEndIndex(0);
    r1.addSegment(seg1);

    RowSegment seg2 = new RowSegment();

    seg2.setStartIndex(1);
    seg2.setEndIndex(1);
    r1.addSegment(seg2);

    matrix.addRow(r1);

    // TODO: add a second row.
 
    //getMatrixHome().store(taxonLabel);
    getMatrixHome().store(c1);
    getMatrixHome().store(c2);
    getMatrixHome().store(e1);
    getMatrixHome().store(e2);
    getMatrixHome().store(matrix);
   
    // 2. verify
    Long matrixID = matrix.getId();
    Long c1ID = c1.getId();
    Long c2ID = c2.getId();
    Long r1ID = r1.getId();
    Long seg1ID = seg1.getId();
    Long seg2ID = seg2.getId();
    Long e1ID = e1.getId();
    Long e2ID = e2.getId();
View Full Code Here

Examples of org.cipres.treebase.domain.matrix.MatrixColumn

    missing.setLabel("?");
   
    // then create the XML characters, assigning them all the same state set
    List<MatrixColumn> tbColumns = tbMatrix.getColumnsReadOnly();
    for ( int i = 0; i < tbColumns.size(); i++ ) {
      MatrixColumn tbColumn = tbColumns.get(i);     
      org.nexml.model.Character xmlCharacter = xmlMatrix.createCharacter(xmlStateSet);
      copyCharacterAttributes(tbColumn, xmlCharacter);
    }   
    return xmlMatrix;
  }
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.