Пример #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;
  }