Examples of AnalysisStep


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

   */
  public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
    throws Exception {

    String analysis_step_id = ServletRequestUtils.getStringParameter(request, "id", null);
    AnalysisStep analysisStep = mAnalysisStepService.findByID(Long.parseLong(analysis_step_id));
    List<AnalyzedData> dataset = analysisStep.getDataSetReadOnly();
    // map AnalyzedData -> AnalyzedDataCommand
    AnalyzedDataCommand analyzedDataCommand;

    List<AnalyzedDataCommand> list = new ArrayList<AnalyzedDataCommand>();
    for (AnalyzedData data : dataset) {
View Full Code Here

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

    BindException errors) throws Exception {
    String dataType = request.getParameter("dataType");
    String inputOutput = request.getParameter("inputOutput");
    Boolean input = inputOutput.equals("Input");
    String analysisStepId = request.getParameter("analysisStepId");
    AnalysisStep analysisStep = getAnalysisStepService().findByID(Long.parseLong(analysisStepId));
    String action = request.getParameter("action");
   
    // add a list of ids
    if ( action.equals("add") ) {
      String idString = request.getParameter("ids");
      String[] ids = idString.split(" +");     
      if ( dataType.equals("Matrices") ) {
        for ( int i = 0; i < ids.length; i++ ) {
          if ( ! TreebaseUtil.isEmpty(ids[i]) ) {
            Matrix matrix = getMatrixService().findByID(Long.parseLong(ids[i]));
            AnalyzedMatrix analyzedMatrix = new AnalyzedMatrix();
            analyzedMatrix.setInput(input);
            analyzedMatrix.setMatrix(matrix);
            analysisStep.addAnalyzedData(analyzedMatrix);
            getAnalysisStepService().update(analysisStep);         
          }
        }     
      }
      else if ( dataType.equals("Trees") ) {
        for ( int i = 0; i < ids.length; i++ ) {
          if ( ! TreebaseUtil.isEmpty(ids[i]) ) {
            PhyloTree phyloTree = getPhyloTreeService().findByID(Long.parseLong(ids[i]))
            AnalyzedTree analyzedTree = new AnalyzedTree();
            analyzedTree.setInput(input);
            analyzedTree.setTree(phyloTree);
            analysisStep.addAnalyzedData(analyzedTree);
            getAnalysisStepService().update(analysisStep);
          }       
        }     
      }
      else if ( dataType.equals("TreeBlocks") ) {
        for ( int i = 0; i < ids.length; i++ ) {
          if ( ! TreebaseUtil.isEmpty(ids[i]) ) {
            TreeBlock treeBlock = getPhyloTreeService().findTreeBlockByID(Long.parseLong(ids[i]));
            for ( PhyloTree phyloTree : treeBlock.getTreeList() ) {
              AnalyzedTree analyzedTree = new AnalyzedTree();
              analyzedTree.setInput(input);
              analyzedTree.setTree(phyloTree);
              analysisStep.addAnalyzedData(analyzedTree);
              getAnalysisStepService().update(analysisStep);           
            }
          }       
        }     
      }
    }
   
    // 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;
              break;
            }
          }
        }
      }
      else if ( dataType.equals("Trees") ) {
        for ( AnalyzedData data : analysisStep.getDataSetReadOnly() ) {
          if ( data.isInputData() == input && data.getTreeData() != null ) {
            if ( data.getId() == Long.parseLong(deleteMe) ) {
              datumToDelete = data;
              break;
            }
          }
        }     
      }
      analysisStep.removeAnalyzedData(datumToDelete);
      getAnalysisStepService().update(analysisStep);
    }
    return new ModelAndView(new RedirectView("analyses.html"));   
  }
View Full Code Here

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

    if (TreebaseUtil.isEmpty(analyzed_id)) {
      return new ModelAndView(new RedirectView(successView));
    }
    // TODO:
    // is there a better way to delete this with either matrix_id or analyzed_matrix_id?
    AnalysisStep analysisStep = mAnalysisStepService.findByID(Long.parseLong(analysis_step_id));
    Collection<AnalyzedData> analyzedSet = analysisStep.getDataSetReadOnly();

    for (AnalyzedData data : analyzedSet) {
      if (data.getId().equals(Long.parseLong(analyzed_id))) {
        mAnalyzedDataService.deleteAnalyzedData(data);
        break;
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.