Package org.cipres.treebase.domain.matrix

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


  public Collection<Matrix> findByStudy(Study pStudy) {
    Collection<Matrix> matrices = new HashSet<Matrix>();
    for (Analysis an : pStudy.getAnalysesReadOnly()) {
      for (AnalysisStep step : an.getAnalysisStepsReadOnly()) {
        for (AnalyzedData data : step.getDataSetReadOnly()) {
          Matrix matrixData = data.getMatrixData();
          if (matrixData != null) {
            matrices.add(matrixData);
          }
        }
      }
View Full Code Here


        tl.setStudy(s);
    }

    // Now replace the taxon labels in each tree and matrix with their canonical replacements
    for (AnalyzedData d : s.getAnalyzedData()) {
      Matrix m = d.getMatrixData();
      if (m != null) remapMatrixTaxonLabels(m, canonical);
     
      PhyloTree t = d.getTreeData();
      if (t != null) remapPhyloTreeTaxonLabels(t, canonical);
    }
View Full Code Here

        if ( data.getDataType().equals("tree") ) {
          PhyloTree tree = data.getTreeData();
          labelSet.addAll(tree.getAllTaxonLabels());
        }
        if ( data.getDataType().equals("matrix") ) {
          Matrix matrix = data.getMatrixData();
          labelSet.addAll(matrix.getTaxa().getTaxonLabelsReadOnly());
        }                 
      }
    }
    for ( TaxonLabel label : labelSet ) {
      outputLabelSet.addPhyloTaxonLabel(label);
View Full Code Here

        if ( data.getDataType().equals("tree") ) {
          PhyloTree tree = data.getTreeData();
          labelSet.addAll(tree.getAllTaxonLabels());
        }
        if ( data.getDataType().equals("matrix") ) {
          Matrix matrix = data.getMatrixData();
          labelSet.addAll(matrix.getTaxa().getTaxonLabelsReadOnly());
        }                 
      }
    }
    for ( TaxonLabel label : labelSet ) {
      inputLabelSet.addPhyloTaxonLabel(label);
View Full Code Here

          Collection<AnalyzedData> analyzedDataCollection = analysisStep.getDataSetReadOnly();
          boolean matrixIsInput = false;
           
          // then we need to see if the focal matrix is an input matrix
          for ( AnalyzedData analyzedData : analyzedDataCollection ) {
            Matrix analyzedMatrix = analyzedData.getMatrixData();
            String inputOutput = analyzedData.getInputOutput();
             
            // if the focal datum is an input, and it's a matrix, and it's THIS matrix...
            if ( inputOutput.equals("input") && analyzedMatrix != null && analyzedMatrix.getId() == matrix.getId() ) {           
              matrixIsInput = true;
            }           
          }
          // ...then collect all output trees
          if ( matrixIsInput ) {
View Full Code Here

    // force commit immediately, important:
    //setComplete();
    //endTransaction();
 
    Matrix m = (Matrix)loadObject(Matrix.class, matrixID);
    TaxonLabel tl = (TaxonLabel)loadObject(TaxonLabel.class, taxonID);
      //String sqlStr = "select count(*) from matrix where matrix_id=" + matrixID;
    //int count = jdbcTemplate.queryForInt(sqlStr);
    //assertTrue(count == 1);
    assertTrue( m!=null );
View Full Code Here

    // Build the all taxon labels sets:
    for (AnalysisStep step : getAnalysisSteps()) {

      for (AnalyzedData analyzedData : step.getDataSetReadOnly()) {
        Matrix m = analyzedData.getMatrixData();
        PhyloTree tree = analyzedData.getTreeData();

        if (m != null) {
          if (matrixTaxonLabels.isEmpty()) {
            matrixTaxonLabels.addAll(m.getAllTaxonLabels());
          } else if (!matrixTaxonLabels.containsAll(m.getAllTaxonLabels())) {
            // all matrices must have the same set of taxon labels.
            result.addErrorMessage("Error: matrix(id " + m.getId()
              + "): all matrices must have the same set of taxon labels");
          }
        }

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

   */
  @Transient
  public Set<Matrix> getMatrices() {
    Set<Matrix> matrices = new HashSet<Matrix> ();
    for (AnalyzedData ad : getAnalyzedData()) {
      Matrix m = ad.getMatrixData();
      if (m != null) {
        matrices.add(m);
      }
    }
    return matrices;
View Full Code Here

          for (AnalyzedData ad : as.getDataSetReadOnly()) {
            if (tr == null) {
              tr = rt.beginTransaction();
            }
            Matrix m = ad.getMatrixData();
            PhyloTree t = ad.getTreeData();
            if (m != null) {
              System.err.println("  Repatriating matrix " + m.getId()
                  + " to study " + s.getId() + " submission " + sub.getId());
             
              if (m.getStudy() != s) {
                String nexusFileName = m.getNexusFileName();
                Map<String,String> nexusMap = m.getStudy().getNexusFiles();
                String nexusFile = nexusMap.remove(nexusFileName);
                s.getNexusFiles().put(nexusFileName, nexusFile);
                m.setStudy(s);
              }
             
              if (! ms.contains(m)) {
                Submission oldSub = sh.findByMatrix(m);
                if (oldSub != null) {
View Full Code Here

   *
   * @see org.cipres.treebase.domain.matrix.MatrixHome#loadMatrixEagerFetch(java.lang.Long)
   */
  public Matrix loadMatrixEagerFetch(Long pMatrixID) {

    Matrix matrix = super.findPersistedObjectByID(Matrix.class, pMatrixID);

    // FIXME: loadMatrixEagerFetch
    // Criteria c = getSession().createCriteria(Matrix.class);
    // c.add(Expression.eq("id", pMatrixID)).setFetchMode("rows", FetchMode.JOIN).setFetchMode(
    // "columns",
View Full Code Here

TOP

Related Classes of org.cipres.treebase.domain.matrix.Matrix

Copyright © 2018 www.massapicom. 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.