@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; }
@Override public List<SampleDraft> getAllbetaGTMspISampleDraftsFromJobDraftId(Integer id) { JobDraft jobDraft = jobDraftService.getJobDraftById(id); List<SampleDraft> sampleDrafts = jobDraft.getSampleDraft(); List<SampleDraft> betaGTMspSampleDrafts = new ArrayList<SampleDraft>(); String enzymeString; for (SampleDraft sd : sampleDrafts) { try { if (sd.getSampleType().getIName().equalsIgnoreCase("library")) { enzymeString = (String) MetaHelper.getMetaValue( HELPTAG_LIB_AREA, RESTRICTION_ENZYME_META_KEY, sd.getSampleDraftMeta()); } else { // genomic DNA; 1-8-15; dubin enzymeString = (String) MetaHelper.getMetaValue( HELPTAG_DNA_AREA, TYPE_OF_HELP_LIBRARY_REQUESTED_META_KEY, sd.getSampleDraftMeta()); } if (enzymeString.equals("beta-GT-MspI")) betaGTMspSampleDrafts.add(sd); } catch (MetadataException e) { // not found logger.debug( "Restriction Enzyme Meta (and libraryToCreate meta) is not found for Sample Draft id = " + id); } } return betaGTMspSampleDrafts; }
@Override public String getTypeOfHelpLibrary(Sample sample) { try { return (String) MetaHelper.getMetaValue( HELPTAG_LIB_AREA, RESTRICTION_ENZYME_META_KEY, sample.getSampleMeta()); } catch (MetadataException e) { } // not found return null; }
@Override public String getTypeOfHelpLibraryRequestedForMacromolecule(Sample sample) { try { return (String) MetaHelper.getMetaValue( HELPTAG_DNA_AREA, TYPE_OF_HELP_LIBRARY_REQUESTED_META_KEY, sample.getSampleMeta()); } catch (MetadataException e) { } // not found return null; }