Example #1
0
  private ISPYGPIntegrationQueryDTO createGPIntegrationQueryDTO(
      GpIntegrationForm gpQueryForm, HttpSession session) {

    ISPYGPIntegrationQueryDTO gpQueryDTO =
        (ISPYGPIntegrationQueryDTO)
            ApplicationFactory.newQueryDTO(QueryType.PROBESET_CLONEID_QUERY_FOR_HOA);
    gpQueryDTO.setQueryName(gpQueryForm.getAnalysisResultName());

    HashMap<String, UserList> patientLists = new HashMap<String, UserList>();
    HashMap<String, Set<TimepointType>> timepointLists = new HashMap<String, Set<TimepointType>>();
    UserListBeanHelper listHelper = new UserListBeanHelper(session);
    String groupTimepoint = null;
    String groupName = null;
    String timePointName = null;
    if (gpQueryForm.getSelectedGroups() != null && gpQueryForm.getSelectedGroups().length > 0) {
      for (int i = 0; i < gpQueryForm.getSelectedGroups().length; i++) {
        groupTimepoint = gpQueryForm.getSelectedGroups()[i];
        int index = groupTimepoint.lastIndexOf("---");
        groupName = groupTimepoint.substring(0, index);
        timePointName = groupTimepoint.substring(index + 3);
        UserList userList = listHelper.getUserList(groupName);
        patientLists.put(groupTimepoint, userList);
        String[] times = timePointName.split("-");
        String fixedTimepointString = null;
        Set<TimepointType> set = new HashSet<TimepointType>();
        for (String time : times) {
          TimepointType fixedTimepointBase; // timepoint for both queryDTOs
          fixedTimepointString = EnumHelper.getEnumTypeName(time, TimepointType.values());
          if (fixedTimepointString != null) {
            fixedTimepointBase = TimepointType.valueOf(fixedTimepointString);
            set.add(fixedTimepointBase);
          }
        }
        timepointLists.put(groupTimepoint, set);
      }
    }
    gpQueryDTO.setPatientLists(patientLists);
    gpQueryDTO.setTimepointLists(timepointLists);

    // UserListBeanHelper listHelper = new UserListBeanHelper(session);
    if (gpQueryForm.getGeneSetName() != null
        && (!gpQueryForm.getGeneSetName().equals("")
            && !gpQueryForm.getGeneSetName().equals("none"))) {
      geneIdentifierDECollection = listHelper.getGeneDEforList(gpQueryForm.getGeneSetName());
      if (geneIdentifierDECollection != null && !geneIdentifierDECollection.isEmpty()) {
        logger.debug("geneIdentifierDECollection was found");
        gpQueryDTO.setGeneIdentifierDEs(geneIdentifierDECollection);
        gpQueryDTO.setReportersName(gpQueryForm.getGeneSetName());
      } else {
        logger.debug("geneIdentifierDECollection could not be found");
      }
    }
    // Create arrayPlatfrom DEs
    if (gpQueryForm.getArrayPlatform() != "" || gpQueryForm.getArrayPlatform().length() != 0) {
      ArrayPlatformDE arrayPlatformDE = new ArrayPlatformDE(gpQueryForm.getArrayPlatform());
      gpQueryDTO.setArrayPlatformDE(arrayPlatformDE);
    }

    return gpQueryDTO;
  }
Example #2
0
  public ActionForward setup(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    GpIntegrationForm gpForm = (GpIntegrationForm) form;
    /*setup the defined Disease query names and the list of samples selected from a Resultset*/
    ClinicalGroupRetriever clinicalGroupRetriever =
        new ClinicalGroupRetriever(request.getSession());
    gpForm.setExistingGroupsList(clinicalGroupRetriever.getClinicalGroupsCollection());

    UserListBeanHelper listHelper = new UserListBeanHelper(request.getSession());
    // fetch the users gene groups populate the dropdown
    List<String> names = (List<String>) listHelper.getGenericListNames(ListType.Gene);
    List<LabelValueBean> gsNameList = new ArrayList<LabelValueBean>();
    for (String listName : names) {
      gsNameList.add(new LabelValueBean(listName, listName));
    }
    gpForm.setGeneSetNameList(gsNameList);
    return mapping.findForward("success");
  }