Package org.cipres.treebase.domain.study

Examples of org.cipres.treebase.domain.study.AnalyzedData


      theAnalysisStep.setAlgorithmInfo(theAlgorithm);
     
      { // handle INPUT_MATRIX and OUTPUT_TREE in each ANALYSIS section
        TreeBlock theTreeBlock = null;
        for (ValueSection ioSection : an.getIOSections()) {
          AnalyzedData theData;
          if (ioSection.label.equals("INPUT_MATRIX")) {
            AnalyzedMatrix theMatrix = new AnalyzedMatrix();
            theMatrix.setInput(true);
            String matrixID = ioSection.getsval("matrix_id");
           
            Matrix matrixData = matrices.get(matrixID);
                 
            if (matrixData == null) {
              warn("Matrix " + matrixID + "is used in analysis " + an.getString("analysis_id") + " but is not listed in any MATRIX section for its study");
              return new ValueNone();
            }

            matrixData.setStudy(theStudy);
            ContextManager.getTaxonLabelService().updateStudyForAllLabels(matrixData, theStudy);
            matrixData.setTB1MatrixID(matrixID);
            ContextManager.getMatrixService().save(matrixData);
            theSubmission.addMatrixIfNecessary(matrixData);
            ContextManager.getSubmissionService().save(theSubmission);
            theMatrix.setMatrix(matrixData);
            theData = theMatrix;
          } else if (ioSection.label.equals("OUTPUT_TREE")) {
         
            if (theTreeBlock == null) {
              theTreeBlock = new TreeBlock();
              ContextManager.getStudyService().save(theTreeBlock); // XXX should be some treeblock-specific service
              theSubmission.addPhyloTreeBlock(theTreeBlock);
              ContextManager.getSubmissionService().save(theSubmission);
            }     
           
            AnalyzedTree theTree = new AnalyzedTree();
            theTree.setInput(false);
            String treeID = ioSection.getsval("tree_id");
            PhyloTree treeData = trees.get(treeID);

            treeData.setStudy(theStudy);
            ContextManager.getTaxonLabelService().updateStudyForAllLabels(treeData, theStudy);
            treeData.setTB1TreeID(treeID);
            ContextManager.getPhyloTreeService().save(treeData);
            theTreeBlock.addPhyloTree(treeData);
            theSubmission.addPhyloTreeBlockIfNecessary(theTreeBlock);
            ContextManager.getSubmissionService().save(theSubmission);
            theTree.setTree(treeData);
            theData = theTree;
          } else {
            throw new Error("Unknown IO section '" + ioSection.label + "' in study " + aux.getString(null, "study_id"));
          }
          theData.setAnalysisStep(theAnalysisStep);
          ContextManager.getAnalyzedDataService().save(theData);
          theAnalysisStep.addAnalyzedData(theData);
          ContextManager.getAnalysisStepService().save(theAnalysisStep);
        }
      }
View Full Code Here


   * @param analyzedDataForData
   * @param nexAnnotatable
   * @throws URISyntaxException
   */
  private void attachAnalyzedDataMetadata(Map<String, AnalyzedData> analyzedDataForData, Annotatable nexAnnotatable) throws URISyntaxException {
    AnalyzedData tbData = analyzedDataForData.get(nexAnnotatable.getId());
    URI tbStepPurl = tbData.getAnalysisStep().getPhyloWSPath().getPurl().toURI();
    String predicate = tbData.isInputData() ? "tb:input.analysistep" : "tb:output.analysisstep";
    nexAnnotatable.addAnnotationValue(predicate, Constants.TBTermsURI, tbStepPurl);
    logger.info("attached analyzed data metadata");
  }
View Full Code Here

  }
  private List<AnalyzedDataCommand> createAnalyzedDataCommandList(AnalysisStep analysisStep) {
    Iterator<AnalyzedData> dataListIterator = analysisStep.getDataSetReadOnly().iterator();
    List<AnalyzedDataCommand> analyzedDataCommandList = new ArrayList<AnalyzedDataCommand>();
    while ( dataListIterator.hasNext() ) {
      AnalyzedData data = dataListIterator.next();
      AnalyzedDataCommand command = new AnalyzedDataCommand();
      command.setDataType(data.getDataType());
      command.setDisplayName(data.getDisplayName());
      command.setInput(data.isInputData());
      command.setInputOutputType(data.getInputOutput());
      command.setNotes(data.getNotes());
      command.setId(data.getId());
      List<EditFieldCommand> efcList = new ArrayList<EditFieldCommand>();
      EditFieldCommand efc = null;
      if ( data.getDataType().equals("tree") ) {
        command.setDataId(data.getTreeData().getId());
        efc = new EditFieldCommand(data.getTreeData(),data.getInputOutput());
      }
      else if ( data.getDataType().equals("matrix") ) {
        command.setDataId(data.getMatrixData().getId());
        efc = new EditFieldCommand(data.getMatrixData(),data.getInputOutput());
      }
      efcList.add(efc);
      analyzedDataCommandList.add(command);
    }
    return analyzedDataCommandList;
View Full Code Here

    }
   
    // remove an id
    else if ( action.equals("remove") ) {
      String deleteMe = request.getParameter("deleteMe");
      AnalyzedData datumToDelete = null;
      if ( dataType.equals("Matrices") ) {
        for ( AnalyzedData data : analysisStep.getDataSetReadOnly() ) {
          if ( data.isInputData() == input && data.getMatrixData() != null ) {
            if ( data.getId() == Long.parseLong(deleteMe) ) {
              datumToDelete = data;
View Full Code Here

TOP

Related Classes of org.cipres.treebase.domain.study.AnalyzedData

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.