Examples of DiscreteCharState


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

          for (int j = 0; j <= lastState; j++) {
            String stateName = categoricalData.getStateName(i, j);
            String stateNote = categoricalData.getStateNote(i, j);
            char stateSymbol = categoricalData.getSymbol(j);

            DiscreteCharState tbCharState = new DiscreteCharState();
            tbCharState.setDescription(stateName);
            tbCharState.setSymbol(stateSymbol);

            if (!TreebaseUtil.isEmpty(stateNote)) {
              tbCharState.setNotes(stateNote);
            }

            tbChar.addCharState(tbCharState);
          }
        }
View Full Code Here

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

    for (int j = 0; j <= lastSymbol; j++) {
      // String stateSymbolStr = categoricalData.getStateSymbol(i, j);
      String stateNote = pCategoricalData.getStateNote(pColIndex, j);
      char stateSymbol = pCategoricalData.getSymbol(j);

      DiscreteCharState tbCharState = new DiscreteCharState();
      // tbCharState.setDescription(stateSymbolStr);
      tbCharState.setSymbol(stateSymbol);

      if (!TreebaseUtil.isEmpty(stateNote)) {
        tbCharState.setNotes(stateNote);
      }

      tbChar.addCharState(tbCharState);
    }
View Full Code Here

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

    DiscreteChar pColumnChar,
    String pStateName,
    int pStateIndex,
    CharacterMatrix pMatrix) {

    DiscreteCharState tbState = null;

    DiscreteMatrixElement element = new DiscreteMatrixElement();
    element.setGap(false);

    if (pStateName != null) {
View Full Code Here

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

    // 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);
View Full Code Here

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

    Map<Character,DiscreteCharState> stateForSymbol = new HashMap<Character,DiscreteCharState>();
    CharacterStateSet xmlStateSet = xmlMatrix.createCharacterStateSet();
    for ( int i = 0; i < tbStateLabels.size(); i++ ) {
      for ( int j = 0; j < tbStateLabels.get(i).size(); j++ ) {
        Character symbol = tbStateLabels.get(i).get(j).getSymbol();
        DiscreteCharState state = tbStateLabels.get(i).get(j);
        stateForSymbol.put(symbol, state);     
      }
    }
   
    // then create the single state set out of the map, assigning all non-missing characters to missing
    Set<CharacterState> xmlMissingStates = new HashSet<CharacterState>();
    for ( Character symbol : stateForSymbol.keySet() ) {
      char sym = symbol.charValue();     
      if ( sym != '-' && sym != '?' ) {
        String symString = symbol.toString();
        CharacterState xmlState = xmlStateSet.createCharacterState(symString);
        xmlMissingStates.add(xmlState);
        DiscreteCharState tbState = stateForSymbol.get(symbol);
        xmlState.setLabel(symString);
        attachTreeBaseID((Annotatable)xmlState,tbState,DiscreteCharState.class);       
      }       
    }
   
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.