Пример #1
0
  @Override
  public boolean isBetaGTMspI(Sample s) {
    String enzymeString;
    try {
      if (s.getParentId() != null) {
        // if it has a parent sample, which means it's a facility library, use its parent sample to
        // check for library type
        s = sampleService.getSampleById(s.getParentId());
      }
      if (!s.getSampleType().getIName().equalsIgnoreCase("dna")) { // not dna, so must be library
        enzymeString =
            (String)
                MetaHelper.getMetaValue(
                    HELPTAG_LIB_AREA, RESTRICTION_ENZYME_META_KEY, s.getSampleMeta());
      } else { // genomic DNA
        enzymeString =
            (String)
                MetaHelper.getMetaValue(
                    HELPTAG_DNA_AREA, TYPE_OF_HELP_LIBRARY_REQUESTED_META_KEY, s.getSampleMeta());
      }

      if (enzymeString.equals("beta-GT-MspI")) {
        return true;
      }
    } catch (MetadataException e) {
      // not found
      logger.debug(
          "Restriction Enzyme Meta (and libraryToCreate meta) not found for Sample id = "
              + s.getId());
    }
    return false;
  }
Пример #2
0
  public static GridPanel getSamplePairsByAnalysisPanel(
      List<FileGroup> analysisFileGroupList,
      Map<FileGroup, Sample> fileGroupHpa2SampleMap,
      Map<FileGroup, Sample> fileGroupMsp1SampleMap) {
    GridPanel panel = new GridPanel();
    panel.setTitle("Sample Pairs");
    panel.setResizable(true);
    panel.setMaximizable(true);
    panel.setOrder(1);

    GridContent content = new GridContent();
    content.addDataFields(new GridDataField("Analysis", "String")); // dataIndex, datatype
    content.addDataFields(
        new GridDataField("Hpa2/Beta-GT Sample", "String")); // dataIndex, datatype
    content.addDataFields(new GridDataField("Msp1 Sample", "String")); // dataIndex, datatype

    content.addColumn(
        new GridColumn("Analysis", "Analysis", 500, 0)); // header,dataIndex	     width=250; flex=0
    content.addColumn(
        new GridColumn(
            "Hpa2/Beta-GT Sample",
            "Hpa2/Beta-GT Sample",
            250,
            0)); // header,dataIndex width=250; flex=0
    content.addColumn(
        new GridColumn("Msp1 Sample", "Msp1 Sample", 1)); // header,dataIndex width=250; flex=0

    // create rows with  information
    for (FileGroup fileGroup : analysisFileGroupList) {

      if (fileGroupHpa2SampleMap.isEmpty()) {
        logger.debug("fileGroupHpa2SampleMap is empty ");
      }
      List<String> row = new ArrayList<String>();
      row.add(fileGroup.getDescription());
      Sample hpa2Sample = fileGroupHpa2SampleMap.get(fileGroup);
      String hpa2SampleName = "Unexpected Error";
      if (hpa2Sample != null) {
        hpa2SampleName = hpa2Sample.getName();

      } else {
        logger.debug("hpa2Sample is null");
      }
      Sample msp1Sample = fileGroupMsp1SampleMap.get(fileGroup);
      String msp1SampleName = "Standard Reference";
      if (msp1Sample != null && msp1Sample.getId().intValue() > 0) {
        msp1SampleName = msp1Sample.getName();
      }
      logger.debug("hpa2SampleName = " + hpa2SampleName);
      logger.debug("msp1SampleName = " + msp1SampleName);
      row.add(hpa2SampleName);
      row.add(msp1SampleName);
      content.addDataRow(row);
    }

    panel.setContent(content);
    return panel;
  }