def getChipDisplayedNameSecondaryPrefix(chipDisplayedName): """ Returns all the second portion of the chip displayed name for UI to display e.g., for chip name "318 Select", return "Select" """ isVersionInfoFound, prefixes = Chip.getChipDisplayedNameParts(chipDisplayedName) return prefixes[-1] if len(prefixes) > 1 else ""
def getChipDisplayedNamePrimaryPrefix(chipDisplayedName): """ Returns all the primary chip displayed name for UI to display e.g., for chip name "318 Select", return 318 """ isVersionInfoFound, prefixes = Chip.getChipDisplayedNameParts(chipDisplayedName) return prefixes[0]
def __init__(self, sh_type): super(KitsStepData, self).__init__(sh_type) self.resourcePath = "rundb/plan/page_plan/page_plan_kits.html" self.prev_step_url = reverse("page_plan_application") self.next_step_url = reverse("page_plan_plugins") # 20130827-test # self._dependsOn.append(StepNames.IONREPORTER) self._dependsOn.append(StepNames.APPLICATION) self._dependsOn.append(StepNames.BARCODE_BY_SAMPLE) self.savedFields[KitsFieldNames.SAMPLE_PREPARATION_KIT] = None self.prepopulatedFields[ KitsFieldNames.SAMPLE_PREP_KITS] = KitInfo.objects.filter( kitType="SamplePrepKit", isActive=True).order_by("description") self.savedFields[KitsFieldNames.LIBRARY_KIT_NAME] = None self.prepopulatedFields[ KitsFieldNames.LIB_KITS] = KitInfo.objects.filter( kitType__in=["LibraryKit", "LibraryPrepKit"], isActive=True).order_by("description") self.savedFields[KitsFieldNames.LIBRARY_KEY] = None self.prepopulatedFields[ KitsFieldNames.FORWARD_LIB_KEYS] = LibraryKey.objects.filter( direction="Forward", runMode="single").order_by("-isDefault", "name") self.savedFields[KitsFieldNames.LIBRARY_KEY] = self.prepopulatedFields[ KitsFieldNames.FORWARD_LIB_KEYS][0].sequence self.savedFields[KitsFieldNames.TF_KEY] = GlobalConfig.get( ).default_test_fragment_key self.savedFields[KitsFieldNames.FORWARD_3_PRIME_ADAPTER] = None self.prepopulatedFields[ KitsFieldNames. FORWARD_3_ADAPTERS] = ThreePrimeadapter.objects.filter( direction="Forward", runMode="single").order_by("-isDefault", "chemistryType", "name") self.savedFields[ KitsFieldNames.FORWARD_3_PRIME_ADAPTER] = self.prepopulatedFields[ KitsFieldNames.FORWARD_3_ADAPTERS][0].sequence self.savedFields[KitsFieldNames.FLOW_ORDER] = None self.prepopulatedFields[ KitsFieldNames.FLOW_ORDERS] = FlowOrder.objects.filter( isActive=True).order_by("-isDefault", "description") self.savedFields[KitsFieldNames.FLOW_ORDER] = None self.savedFields[KitsFieldNames.TEMPLATE_KIT_NAME] = None # no longer default to OneTouch # self.savedFields[KitsFieldNames.TEMPLATE_KIT_TYPE] = KitsFieldNames.ONE_TOUCH self.savedFields[KitsFieldNames.TEMPLATE_KIT_TYPE] = None oneTouchDict = { KitsFieldNames.KIT_VALUES: KitInfo.objects.filter( kitType__in=["TemplatingKit", "AvalancheTemplateKit"], isActive=True).exclude( samplePrep_instrumentType="IA").order_by("description"), KitsFieldNames.APPLICATION_DEFAULT: None, } isoAmpDict = { KitsFieldNames.KIT_VALUES: KitInfo.objects.filter( kitType__in=["TemplatingKit"], isActive=True, samplePrep_instrumentType="IA", ).order_by("description"), KitsFieldNames.APPLICATION_DEFAULT: None, } ionChefDict = { KitsFieldNames.KIT_VALUES: KitInfo.objects.filter(kitType="IonChefPrepKit", isActive=True).order_by("description"), KitsFieldNames.APPLICATION_DEFAULT: None, } self.prepopulatedFields[ KitsFieldNames.TEMPLATE_KIT_TYPES] = OrderedDict([ (KitsFieldNames.ONE_TOUCH, oneTouchDict), (KitsFieldNames.ION_CHEF, ionChefDict), (KitsFieldNames.ISO_AMP, isoAmpDict), ]) self.ModelsSamplePrepInstrumentToLabelsSamplePrepInstrumentAsDict = { KitsFieldNames.ONE_TOUCH: SamplePrepInstrument.OT, KitsFieldNames.ION_CHEF: SamplePrepInstrument.IC, KitsFieldNames.ISO_AMP: SamplePrepInstrument.IA, } self.savedFields[KitsFieldNames.SEQUENCE_KIT_NAME] = None self.prepopulatedFields[ KitsFieldNames.SEQ_KITS] = KitInfo.objects.filter( kitType="SequencingKit", isActive=True).order_by("description") self.savedFields[KitsFieldNames.TEMPLATE_KIT_NAME] = None self.prepopulatedFields[ KitsFieldNames.TEMPLATE_KITS] = KitInfo.objects.filter( kitType__in=[ "TemplatingKit", "AvalancheTemplateKit", "IonChefPrepKit" ], isActive=True, ).order_by("description") self.savedFields[KitsFieldNames.CONTROL_SEQUENCE] = None self.prepopulatedFields[ KitsFieldNames.CONTROL_SEQ_KITS] = KitInfo.objects.filter( kitType="ControlSequenceKit", isActive=True).order_by("description") self.savedFields[KitsFieldNames.CHIP_TYPE] = None self.prepopulatedFields[ KitsFieldNames. INSTRUMENT_TYPES] = Chip.getInstrumentTypesForActiveChips( include_undefined=False) self.prepopulatedFields[KitsFieldNames.CHIP_TYPES] = list( Chip.objects.filter(isActive=True).order_by( "description", "name").distinct("description")) self.savedFields[KitsFieldNames.BARCODE_ID] = None self.prepopulatedFields[KitsFieldNames.BARCODES] = list( dnaBarcode.objects.filter( active=True).values("name").distinct().order_by("name")) gc = GlobalConfig.get() self.savedFields[ KitsFieldNames.IS_DUPLICATED_READS] = gc.mark_duplicates self.savedFields[ KitsFieldNames.BASE_RECALIBRATE] = gc.base_recalibration_mode self.prepopulatedFields[ KitsFieldNames.BASE_RECALIBRATION_MODES] = OrderedDict() self.prepopulatedFields[ KitsFieldNames.BASE_RECALIBRATION_MODES]["standard_recal"] = { "text": _("workflow.step.kits.base_recalibration_modes.standard_recal" ), "title": _("workflow.step.kits.base_recalibration_modes.standard_recal.title" ), } # "Default Calibration" self.prepopulatedFields[ KitsFieldNames.BASE_RECALIBRATION_MODES]["panel_recal"] = { "text": _("workflow.step.kits.base_recalibration_modes.panel_recal"), "title": _("workflow.step.kits.base_recalibration_modes.panel_recal.title" ), } # "Enable Calibration Standard" self.prepopulatedFields[ KitsFieldNames.BASE_RECALIBRATION_MODES]["blind_recal"] = { "text": _("workflow.step.kits.base_recalibration_modes.blind_recal"), "title": _("workflow.step.kits.base_recalibration_modes.blind_recal.title" ), } # "Blind Calibration" self.prepopulatedFields[ KitsFieldNames.BASE_RECALIBRATION_MODES]["no_recal"] = { "text": _("workflow.step.kits.base_recalibration_modes.no_recal"), "title": _("workflow.step.kits.base_recalibration_modes.no_recal.title" ), } # "No Calibration" self.savedFields[KitsFieldNames.REALIGN] = gc.realign self.savedFields[KitsFieldNames.FLOWS] = 0 self.savedFields[KitsFieldNames.LIBRARY_READ_LENGTH] = 0 self.savedFields[KitsFieldNames.READ_LENGTH] = 0 self.prepopulatedFields[ KitsFieldNames.IS_BARCODE_KIT_SELECTION_REQUIRED] = False self.prepopulatedFields[KitsFieldNames.TEMPLATING_SIZE_CHOICES] = [ "200", "400" ] self.savedFields[KitsFieldNames.TEMPLATING_SIZE] = "" # For raptor templating kits, templating size cannot be used to drive UI behavior or db persistence. Use read length instead. self.prepopulatedFields[KitsFieldNames.READ_LENGTH_CHOICES] = [ "200", "400" ] self.prepopulatedFields[ KitsFieldNames.FLOWS_FROM_CATEGORY_RULES] = json.dumps( KitInfo._category_flowCount_rules) self.savedFields[KitsFieldNames.SAMPLE_PREP_PROTOCOL] = None self.prepopulatedFields[ KitsFieldNames.SAMPLE_PREP_PROTOCOLS] = common_CV.objects.filter( isActive=True, cv_type="samplePrepProtocol").order_by("uid") self.prepopulatedFields[KitsFieldNames.PLAN_CATEGORIES] = "" self.savedFields[KitsFieldNames.ADVANCED_SETTINGS_CHOICE] = "default" self.prepopulatedFields[KitsFieldNames.ADVANCED_SETTINGS] = "{}" self.sh_type = sh_type