def standardSequenceChangedSlot(self, optionChosen): """ Connected to signalMapper to receive a signal whenever user selects a different sequence in the standard tab. """ sequenceName = str(self.buttons[optionChosen].text()) self.validatedSequenceToApply = sequences.get(sequenceName, None) self.chosenStandardSequence = optionChosen self.applyButton.setEnabled(True)
def userChoseSeq(self, optionChosen): optionChosen = str(optionChosen) seqToUse = "" knownSeqNamedByChosenOption = sequences.get(optionChosen, None) sequenceAfterExtractionOfBasePairChars = util.strToDna(optionChosen) if knownSeqNamedByChosenOption: seqToUse = knownSeqNamedByChosenOption elif len(sequenceAfterExtractionOfBasePairChars)==len(optionChosen): seqToUse = sequenceAfterExtractionOfBasePairChars vh, strandType, idx = self.vh, self.strandType, self.idx vh.applySequenceAt(strandType, idx, seqToUse)
def tabWidgetChangedSlot(self, index): applyEnabled = False if index == 1: # Custom Sequence self.validateCustomSequence() if self.customSequenceIsValid: applyEnabled = True else: # Standard Sequence self.useCustomSequence = False if self.chosenStandardSequence != None: # Overwrite sequence in case custom has been applied activeButton = self.buttons[self.chosenStandardSequence] sequenceName = str(activeButton.text()) self.validatedSequenceToApply = sequences.get(sequenceName, None) applyEnabled = True self.applyButton.setEnabled(applyEnabled)
def tabWidgetChangedSlot(self, index): applyEnabled = False if index == 1: # Custom Sequence self.validateCustomSequence() if self.customSequenceIsValid: applyEnabled = True else: # Standard Sequence self.useCustomSequence = False if self.chosenStandardSequence != None: # Overwrite sequence in case custom has been applied activeButton = self.buttons[self.chosenStandardSequence] sequenceName = str(activeButton.text()) self.validatedSequenceToApply = sequences.get( sequenceName, None) applyEnabled = True self.applyButton.setEnabled(applyEnabled)
def getTestSequences(self, designname, sequencesToApply): """ Called by a sequence-verification functional test to read in a file (designname), apply scaffold sequence(s) to that design, and return the set of staple sequences.""" # set up the document from model.io.decoder import decode inputfile = "tests/functionaltestinputs/%s" % designname document = self.documentController.document() with file(inputfile) as f: decode(document, f.read()) self.setWidget(self.documentController.win, False, None) part = document.selectedPart() # apply one or more sequences to the design for sequenceName, startVhNum, startIdx in sequencesToApply: sequence = sequences.get(sequenceName, None) for vh in part.getVirtualHelices(): if vh.number() == startVhNum: strand = vh.scaffoldStrandSet().getStrand(startIdx) strand.oligo().applySequence(sequence) generatedSequences = part.getStapleSequences() return set(generatedSequences.splitlines())