Examples of AnalysisCommand


Examples of org.cipres.treebase.web.model.AnalysisCommand

        LOGGER.debug(errBuilder.toString()); //$NON-NLS-1$
      }
     
      //
      // Analysis
      AnalysisCommand analysisCommand = new AnalysisCommand();
      BeanUtils.copyProperties(analysisCommand, analysis);

      // Analysis Steps for Analysis and add algorithm type
      List<AnalysisStep> analysisStepList = analysis.getAnalysisStepsReadOnly();
      List<AnalysisStepCommand> analysisStepCommandList = new ArrayList<AnalysisStepCommand>();

      for (AnalysisStep analysisStep : analysisStepList) {
        AnalysisStepCommand analysisStepCommand = new AnalysisStepCommand();
        BeanUtils.copyProperties(analysisStepCommand, analysisStep);
        // analysisStepCommand.setId(analysisStep.getId());
        // analysisStepCommand.setSoftwareInfo(analysisStep.getSoftwareInfo());
        Algorithm algorithm = analysisStep.getAlgorithmInfo();
        String algorithmType = new String();
        if (algorithm instanceof LikelihoodAlgorithm) {
          algorithmType = Constants.ALGORITHM_LIKELIHOOD;
        } else if (algorithm instanceof ParsimonyAlgorithm) {
          algorithmType = Constants.ALGORITHM_PARSIMONY;
        else if (algorithm instanceof OtherAlgorithm) {
          algorithmType = Constants.ALGORITHM_OTHER;
        }else if (algorithm instanceof BayesianAlgorithm) {
          algorithmType = Constants.ALGORITHM_Bayesian;
        } else if (algorithm instanceof EvolutionAlgorithm) {
          algorithmType = Constants.ALGORITHM_Evolution;
        } else if (algorithm instanceof JoiningAlgorithm) {
          algorithmType = Constants.ALGORITHM_Joining;
      } else if (algorithm instanceof UPGMAAlgorithm) {
        algorithmType = Constants.ALGORITHM_UPGMA; 
      }
        // add algorithm type for analysisStepCommand
        analysisStepCommand.setAlgorithmType(algorithmType);

        // analyzed data for each analysis step
        List<AnalyzedData> analyzedDataSet = analysisStep.getDataSetReadOnly();
        List<AnalyzedDataCommand> analyzedDataCommandList = new ArrayList<AnalyzedDataCommand>();

        // Matrix or Tree?
        for (AnalyzedData analyzedData : analyzedDataSet) {

          AnalyzedDataCommand analyzedDataCommand = new AnalyzedDataCommand();
          BeanUtils.copyProperties(analyzedDataCommand, analyzedData);
          String inputOutput = (analyzedData.isInputData()) ? ("Input") : ("Output");
          analyzedDataCommand.setInputOutputType(inputOutput);

          if (analyzedData instanceof AnalyzedMatrix) {
            AnalyzedMatrix analyzedMatrix = (AnalyzedMatrix) analyzedData;
            analyzedDataCommand.setDataType(Constants.MATRIX_KEY);
            analyzedDataCommand.setDisplayName(analyzedMatrix.getMatrix().getTitle());
            analyzedDataCommand.setId(analyzedMatrix.getId());
            analyzedDataCommand.setDataId(analyzedMatrix.getMatrix().getId());
          } else if (analyzedData instanceof AnalyzedTree) {
            AnalyzedTree analyzedTree = (AnalyzedTree) analyzedData;
            analyzedDataCommand.setDataType(Constants.TREE_KEY);
            analyzedDataCommand.setDisplayName(analyzedTree.getTree().getLabel());
            analyzedDataCommand.setId(analyzedTree.getId());
            analyzedDataCommand.setDataId(analyzedTree.getTree().getId());
          }

          analyzedDataCommandList.add(analyzedDataCommand);
        } // end for
        // add analyzedData for analysisStepCommand

        Collections.sort(analyzedDataCommandList, new AnalyzedDataComparator());

        analysisStepCommand.setAnalyzedDataCommandList(analyzedDataCommandList);
        analysisStepCommandList.add(analysisStepCommand);
      }
      analysisCommand.setAnalysisStepCommandList(analysisStepCommandList);
      analysisCommandList.add(analysisCommand);
    }

    getStudyService().updateCollection(changedAnalyses);
View Full Code Here

Examples of org.cipres.treebase.web.model.AnalysisCommand

    List<AnalysisCommand> analysisCommandList = new ArrayList<AnalysisCommand>();

    for (Analysis analysis : analysisList) {

      // Analysis
      AnalysisCommand analysisCommand = new AnalysisCommand();
      BeanUtils.copyProperties(analysisCommand, analysis);

      // Analysis Steps for Analysis and add algorithm type
      List<AnalysisStep> analysisStepList = analysis.getAnalysisStepsReadOnly();
      List<AnalysisStepCommand> analysisStepCommandList = new ArrayList<AnalysisStepCommand>();

      for (AnalysisStep analysisStep : analysisStepList) {
        AnalysisStepCommand analysisStepCommand = new AnalysisStepCommand();
        BeanUtils.copyProperties(analysisStepCommand, analysisStep);
        // analysisStepCommand.setId(analysisStep.getId());
        // analysisStepCommand.setSoftwareInfo(analysisStep.getSoftwareInfo());
        Algorithm algorithm = analysisStep.getAlgorithmInfo();
        String algorithmType = new String();
        if (algorithm instanceof LikelihoodAlgorithm) {
          algorithmType = Constants.ALGORITHM_LIKELIHOOD;
        } else if (algorithm instanceof ParsimonyAlgorithm) {
          algorithmType = Constants.ALGORITHM_PARSIMONY;
        } else if (algorithm instanceof OtherAlgorithm) {
          algorithmType = Constants.ALGORITHM_OTHER;
        }else if (algorithm instanceof BayesianAlgorithm) {
          algorithmType = Constants.ALGORITHM_Bayesian;
        } else if (algorithm instanceof EvolutionAlgorithm) {
          algorithmType = Constants.ALGORITHM_Evolution;
        } else if (algorithm instanceof JoiningAlgorithm) {
          algorithmType = Constants.ALGORITHM_Joining;
        } else if (algorithm instanceof UPGMAAlgorithm) {
          algorithmType = Constants.ALGORITHM_UPGMA; 
        }
       
        // add algorithm type for analysisStepCommand
        analysisStepCommand.setAlgorithmType(algorithmType);

        // analyzed data for each analysis step
        List<AnalyzedData> analyzedDataSet = analysisStep.getDataSetReadOnly();
        List<AnalyzedDataCommand> analyzedDataCommandList = new ArrayList<AnalyzedDataCommand>();

        // Matrix or Tree?
        for (AnalyzedData analyzedData : analyzedDataSet) {
          AnalyzedDataCommand analyzedDataCommand = new AnalyzedDataCommand();
          BeanUtils.copyProperties(analyzedDataCommand, analyzedData);
          String inputOutput = (analyzedData.isInputData()) ? ("Input") : ("Output");
          analyzedDataCommand.setInputOutputType(inputOutput);
          if (analyzedData instanceof AnalyzedMatrix) {
            AnalyzedMatrix analyzedMatrix = (AnalyzedMatrix) analyzedData;
            analyzedDataCommand.setDataType(Constants.MATRIX_KEY);
            analyzedDataCommand.setDisplayName(analyzedMatrix.getMatrix().getTitle());
            analyzedDataCommand.setId(analyzedMatrix.getId());
            analyzedDataCommand.setDataId(analyzedMatrix.getMatrix().getId());
          } else if (analyzedData instanceof AnalyzedTree) {
            AnalyzedTree analyzedTree = (AnalyzedTree) analyzedData;
            analyzedDataCommand.setDataType(Constants.TREE_KEY);
            analyzedDataCommand.setDisplayName(analyzedTree.getTree().getLabel());
            analyzedDataCommand.setId(analyzedTree.getId());
            analyzedDataCommand.setDataId(analyzedTree.getTree().getId());
          }
          analyzedDataCommandList.add(analyzedDataCommand);
        } // end for
        // add analyzedData for analysisStepCommand

        Collections.sort(analyzedDataCommandList, new AnalyzedDataComparator());

        analysisStepCommand.setAnalyzedDataCommandList(analyzedDataCommandList);
        analysisStepCommandList.add(analysisStepCommand);
      }
      analysisCommand.setAnalysisStepCommandList(analysisStepCommandList);
      analysisCommandList.add(analysisCommand);
    }
    studyCommand.setAnalysisCommandList(analysisCommandList);
    //
    resultMap.put(Constants.STUDY_COMMAND_KEY, studyCommand);
View Full Code Here

Examples of org.cipres.treebase.web.model.AnalysisCommand

    List<AnalysisCommand> analysisCommandList = new ArrayList<AnalysisCommand>();

    for (Analysis analysis : analysisList) {

      // Analysis
      AnalysisCommand analysisCommand = new AnalysisCommand();
      BeanUtils.copyProperties(analysisCommand, analysis);

      // Analysis Steps for Analysis and add algorithm type
      List<AnalysisStep> analysisStepList = analysis.getAnalysisStepsReadOnly();
      List<AnalysisStepCommand> analysisStepCommandList = new ArrayList<AnalysisStepCommand>();

      for (AnalysisStep analysisStep : analysisStepList) {
        AnalysisStepCommand analysisStepCommand = new AnalysisStepCommand();
        BeanUtils.copyProperties(analysisStepCommand, analysisStep);
        // analysisStepCommand.setId(analysisStep.getId());
        // analysisStepCommand.setSoftwareInfo(analysisStep.getSoftwareInfo());
        Algorithm algorithm = analysisStep.getAlgorithmInfo();
        String algorithmType = new String();
        if (algorithm instanceof LikelihoodAlgorithm) {
          algorithmType = Constants.ALGORITHM_LIKELIHOOD;
        } else if (algorithm instanceof ParsimonyAlgorithm) {
          algorithmType = Constants.ALGORITHM_PARSIMONY;
        }else if (algorithm instanceof OtherAlgorithm) {
          algorithmType = Constants.ALGORITHM_OTHER;
        }else if (algorithm instanceof BayesianAlgorithm) {
          algorithmType = Constants.ALGORITHM_Bayesian;
        } else if (algorithm instanceof EvolutionAlgorithm) {
          algorithmType = Constants.ALGORITHM_Evolution;
        } else if (algorithm instanceof JoiningAlgorithm) {
          algorithmType = Constants.ALGORITHM_Joining;
        } else if (algorithm instanceof UPGMAAlgorithm) {
          algorithmType = Constants.ALGORITHM_UPGMA; 
        }
       
       
        // add algorithm type for analysisStepCommand
        analysisStepCommand.setAlgorithmType(algorithmType);

        // analyzed data for each analysis step
        List<AnalyzedData> analyzedDataSet = analysisStep.getDataSetReadOnly();
        List<AnalyzedDataCommand> analyzedDataCommandList = new ArrayList<AnalyzedDataCommand>();

        // Matrix or Tree?
        for (AnalyzedData analyzedData : analyzedDataSet) {
          AnalyzedDataCommand analyzedDataCommand = new AnalyzedDataCommand();
          BeanUtils.copyProperties(analyzedDataCommand, analyzedData);
          String inputOutput = (analyzedData.isInputData()) ? ("Input") : ("Output");
          analyzedDataCommand.setInputOutputType(inputOutput);
          if (analyzedData instanceof AnalyzedMatrix) {
            AnalyzedMatrix analyzedMatrix = (AnalyzedMatrix) analyzedData;
            analyzedDataCommand.setDataType(Constants.MATRIX_KEY);
            analyzedDataCommand.setDisplayName(analyzedMatrix.getMatrix().getTitle());
            analyzedDataCommand.setId(analyzedMatrix.getId());
            analyzedDataCommand.setDataId(analyzedMatrix.getMatrix().getId());
          } else if (analyzedData instanceof AnalyzedTree) {
            AnalyzedTree analyzedTree = (AnalyzedTree) analyzedData;
            analyzedDataCommand.setDataType(Constants.TREE_KEY);
            analyzedDataCommand.setDisplayName(analyzedTree.getTree().getLabel());
            analyzedDataCommand.setId(analyzedTree.getId());
            analyzedDataCommand.setDataId(analyzedTree.getTree().getId());
          }
          analyzedDataCommandList.add(analyzedDataCommand);
        } // end for
        // add analyzedData for analysisStepCommand

        Collections.sort(analyzedDataCommandList, new AnalyzedDataComparator());

        analysisStepCommand.setAnalyzedDataCommandList(analyzedDataCommandList);
        analysisStepCommandList.add(analysisStepCommand);
      }
      analysisCommand.setAnalysisStepCommandList(analysisStepCommandList);
      analysisCommandList.add(analysisCommand);
    }
    studyCommand.setAnalysisCommandList(analysisCommandList);
    //
    resultMap.put(Constants.STUDY_COMMAND_KEY, studyCommand);
View Full Code Here

Examples of org.cipres.treebase.web.model.AnalysisCommand

    List<Analysis> analysisList = theStudy.getAnalyses();
    List<AnalysisCommand> analysisCommandList = new ArrayList<AnalysisCommand>();
    for (Analysis analysis : analysisList) {

      // Analysis
      AnalysisCommand analysisCommand = new AnalysisCommand();
      BeanUtils.copyProperties(analysisCommand, analysis);

      // Analysis Steps for Analysis and add algorithm type
      List<AnalysisStep> analysisStepList = analysis.getAnalysisStepsReadOnly();
      List<AnalysisStepCommand> analysisStepCommandList = new ArrayList<AnalysisStepCommand>();

      for (AnalysisStep analysisStep : analysisStepList) {
        AnalysisStepCommand analysisStepCommand = new AnalysisStepCommand();
        BeanUtils.copyProperties(analysisStepCommand, analysisStep);
        // analysisStepCommand.setId(analysisStep.getId());
        // analysisStepCommand.setSoftwareInfo(analysisStep.getSoftwareInfo());
        Algorithm algorithm = analysisStep.getAlgorithmInfo();
        String algorithmType = new String();
        if (algorithm instanceof LikelihoodAlgorithm) {
          algorithmType = Constants.ALGORITHM_LIKELIHOOD;
        } else if (algorithm instanceof ParsimonyAlgorithm) {
          algorithmType = Constants.ALGORITHM_PARSIMONY;
        }else if (algorithm instanceof OtherAlgorithm) {
          algorithmType = Constants.ALGORITHM_OTHER;
        }else if (algorithm instanceof BayesianAlgorithm) {
          algorithmType = Constants.ALGORITHM_Bayesian;
        }else if (algorithm instanceof EvolutionAlgorithm) {
          algorithmType = Constants.ALGORITHM_Evolution;
        }else if (algorithm instanceof JoiningAlgorithm) {
          algorithmType = Constants.ALGORITHM_Joining;
        }else if (algorithm instanceof UPGMAAlgorithm) {
          algorithmType = Constants.ALGORITHM_UPGMA; 
        }
       
        // add algorithm type for analysisStepCommand
        analysisStepCommand.setAlgorithmType(algorithmType);

        // analyzed data for each analysis step
        List<AnalyzedData> analyzedDataSet = analysisStep.getDataSetReadOnly();
        List<AnalyzedDataCommand> analyzedDataCommandList = new ArrayList<AnalyzedDataCommand>();

        // Matrix or Tree?
        for (AnalyzedData analyzedData : analyzedDataSet) {
          AnalyzedDataCommand analyzedDataCommand = new AnalyzedDataCommand();
          BeanUtils.copyProperties(analyzedDataCommand, analyzedData);
          String inputOutput = (analyzedData.isInputData()) ? ("Input") : ("Output");
          analyzedDataCommand.setInputOutputType(inputOutput);
          if (analyzedData instanceof AnalyzedMatrix) {
            AnalyzedMatrix analyzedMatrix = (AnalyzedMatrix) analyzedData;
            analyzedDataCommand.setDataType(Constants.MATRIX_KEY);
            analyzedDataCommand.setDisplayName(analyzedMatrix.getMatrix().getTitle());
            analyzedDataCommand.setId(analyzedMatrix.getId());
            analyzedDataCommand.setDataId(analyzedMatrix.getMatrix().getId());
          } else if (analyzedData instanceof AnalyzedTree) {
            AnalyzedTree analyzedTree = (AnalyzedTree) analyzedData;
            analyzedDataCommand.setDataType(Constants.TREE_KEY);
            analyzedDataCommand.setDisplayName(analyzedTree.getTree().getLabel());
            analyzedDataCommand.setId(analyzedTree.getId());
            analyzedDataCommand.setDataId(analyzedTree.getTree().getId());
          }
          analyzedDataCommandList.add(analyzedDataCommand);
        } // end for
        // add analyzedData for analysisStepCommand

        Collections.sort(analyzedDataCommandList, new AnalyzedDataComparator());

        analysisStepCommand.setAnalyzedDataCommandList(analyzedDataCommandList);
        analysisStepCommandList.add(analysisStepCommand);
      }
      analysisCommand.setAnalysisStepCommandList(analysisStepCommandList);
      analysisCommandList.add(analysisCommand);
    }
    studyCommand.setAnalysisCommandList(analysisCommandList);
    newModel.put(Constants.STUDY_COMMAND_KEY, studyCommand);
   
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.