def _console_main(): mode = _mode_select() forward = _primer_select('f') reverse = _primer_select('r') Tm = _Tm_select() tag = _tag_select(mode) if tag != 'None': tagfr = _tag_fr_select() else: tagfr = 'f' if tagfr == 'f': ftag = tag rtag = 'None' else: rtag = tag ftag = 'None' print('Processing data...') data = fasta_reader(mode) processed = [] for item in data: processed.append(primer_builder('f', item, forward, ftag, Tm, mode)) processed.append(primer_builder('r', item, reverse, rtag, Tm, mode)) fasta_writer(processed, 99999999, False) print('Task finished.') input('Press any key to exit.') return
def buildNOW(self): mode = self.buttonGroup_2.checkedButton().text() forward = self._primer_select('f', self.text_re1.toPlainText()) reverse = self._primer_select('r', self.text_re2.toPlainText()) r_data = self._dna_select(self.text_DNA.toPlainText(), mode) r_tm = self._Tm_select(self.text_tm.text()) r_tag = self._tag_select(mode) for i in [forward,reverse,r_data,r_tm,r_tag]: if i == '': self.result_err_text += 'Please fill in the information. \n' break if self.tag_no.isChecked(): if self.sense_yes.isChecked() == False and self.sense_anti.isChecked() == False: self.result_err_text += 'Please check sense or antisense' if i == 'err': self.result_err_text += 'Error: Forward or backward primer does not exist in dictionary "enzset". \n' else: if self.sense_yes.isChecked(): ftag = r_tag if self.sense_anti.isChecked(): rtag = r_tag processed = [] for item in r_data: processed.append(primer_builder('f', item, forward, ftag, r_tm, mode)) processed.append(primer_builder('r', item, reverse, rtag, r_tm, mode)) fasta_writer(processed, 999999999, False) print('Task finished.') f_ = open("./output.txt", 'r') with f_: text = f_.read() self.result_text.setText(text)