def __init__(self, dProject, parent=None): QtGui.QWidget.__init__(self, parent) ## Region of Interest self.fromSpinBox = QtGui.QSpinBox() self.fromSpinBox.setRange(0, len(dProject['dData']['RX'])) self.fromSpinBox.setValue(0) self.fromSpinBox.setSingleStep(1) self.toSpinBox = QtGui.QSpinBox() self.toSpinBox.setRange(0, len(dProject['dData']['RX'])) self.toSpinBox.setValue(len(dProject['dData']['RX'])) self.toSpinBox.setSingleStep(1) fromLabel = QtGui.QLabel('From') toLabel = QtGui.QLabel('To') self.groupBox = QtGui.QGroupBox(self.tr('Region of Interest')) self.groupBox.setCheckable(True) self.groupBox.setChecked(False) layoutRoi = myHBoxLayout() layoutRoi.addWidget(fromLabel) layoutRoi.addWidget(self.fromSpinBox) layoutRoi.addWidget(toLabel) layoutRoi.addWidget(self.toSpinBox) self.groupBox.setLayout(layoutRoi)
def __init__(self, label, fileType, path=QtCore.QDir.homePath(), parent=None): QtGui.QWidget.__init__(self, parent) self.label = label self.fileType = fileType self.path = path self.label0 = QtGui.QLabel(label) self.label0.setFixedWidth(80) self.lineEdit0 = QtGui.QLineEdit() self.lineEdit0.setReadOnly(True) self.pushButton0 = QtGui.QPushButton('Browse') self.layout0 = QtGui.QHBoxLayout() self.layout0.addWidget(self.label0) self.layout0.addWidget(self.lineEdit0) self.layout0.addWidget(self.pushButton0) self.layout0.setContentsMargins(0, 0, 0, 0) self.layout0.setSpacing(1) self.setLayout(self.layout0) self.connect(self.pushButton0, QtCore.SIGNAL("clicked()"), self.fileBrowse)
def __init__(self, dProject,parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel(self.tr("<center><b>SMOOTHING</b></center>")) self.name="Smooth" self.toolID=2 self.dProject=dProject self.dProjOut=deepcopy(dProject) self.isToolApplied=False #Saturation Correction: Analysis of saturated data points by creating a synthetic peak based upon the peak shape before and after saturation. self.checkBoxSatd=QtGui.QCheckBox('Saturation Correction') self.checkBoxSatd.setChecked(True) #### Group Box Radio self.radioButton0 = QtGui.QRadioButton(self.tr("Triangular Moving Aver.")) self.radioButton1 = QtGui.QRadioButton(self.tr("Rectangular Moving Aver.")) self.radioButton2 = QtGui.QRadioButton(self.tr("Gaussian")) self.radioButton0.setChecked(True) #### Window Size windowSizeLabel = QtGui.QLabel("Window Size:") self.spinBox1 = QtGui.QSpinBox() self.spinBox1.setRange(1, 10) self.spinBox1.setValue(1) self.spinBox1.setSingleStep(1) layout1 = myGridLayout() layout1.addWidget(self.radioButton0,0,0,1,2) layout1.addWidget(self.radioButton1,1,0,1,2) layout1.addWidget(self.radioButton2,2,0,1,2) layout1.addWidget(windowSizeLabel,3,0) layout1.addWidget(self.spinBox1,3,1) self.groupBox0 = QtGui.QGroupBox(self.tr("Smoothing")) self.groupBox0.setCheckable(True) self.groupBox0.setLayout(layout1) ### Button Box self.buttonBox =ToolButton() self.groupBoxROI=GroupBoxROI(self.dProject) self.applyChannel=ApplyChannel(self.dProject) mainLayout=QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(self.checkBoxSatd) mainLayout.addWidget(self.groupBox0) mainLayout.addWidget(self.groupBoxROI.groupBox) mainLayout.addWidget(self.applyChannel.groupBox) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout)
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) # self.cancelButton = QtGui.QPushButton(self.tr("Cancel")) self.applyButton = QtGui.QPushButton(self.tr("Apply")) self.skipButton = QtGui.QPushButton(self.tr("Skip")) self.doneButton = QtGui.QPushButton(self.tr("Done")) self.doneButton.setEnabled(False) buttonLayout = QtGui.QHBoxLayout() buttonLayout.addWidget(self.skipButton) buttonLayout.addStretch(1) buttonLayout.addWidget(self.applyButton) buttonLayout.addWidget(self.doneButton) self.setLayout(buttonLayout)
def __init__(self, dProject, parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel( self.tr("<center><b>REPORT</b></center>")) self.name = "Report" self.toolID = 1 self.dProject = dProject self.dReport = createDReport(dProject) for key in self.dReport.keys(): self.dReport[key] = self.dReport[key][::-1] self.saveTextButton = QtGui.QPushButton("Save as Text") self.connect(self.saveTextButton, QtCore.SIGNAL('clicked()'), self.saveTextReport) self.layout0 = QtGui.QHBoxLayout() self.layout0.addWidget(self.saveTextButton) self.layout0.addStretch() N = len(self.dReport['seqNum']) self.table = QtGui.QTableWidget() self.table.setRowCount(N) self.table.setColumnCount(len(reportKeys)) self.table.setHorizontalHeaderLabels(reportKeys) self.table.setSelectionBehavior(QtGui.QTableWidget.SelectRows) self.table.setSelectionMode(QtGui.QTableWidget.SingleSelection) self.font = QtGui.QFont() self.font.setPointSize(9) self.table.setFont(self.font) for i in range(N): for key in reportKeys: if key == 'seqRNA': item = QtGui.QTableWidgetItem(self.dReport[key][i]) elif key in ['seqNum', 'posSeq', 'posRX', 'posBG']: item = QtGui.QTableWidgetItem("%d" % self.dReport[key][i]) else: item = QtGui.QTableWidgetItem("%.2f" % self.dReport[key][i]) col = reportKeys.index(key) self.table.setItem(int(i), int(col), item) self.table.resizeColumnsToContents() self.table.resizeRowsToContents() mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(self.table) mainLayout.addLayout(self.layout0) self.setLayout(mainLayout)
def __init__(self, dProject, parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel( self.tr("<center><b>CHANNEL SWAP</b></center>")) self.name = "Swap" self.toolID = 1 self.dProject = dProject self.dProjOut = dProject.copy() self.label0 = {} self.comboBox0 = {} for key in self.dProject['chKeyRS']: self.label0[key] = QtGui.QLabel(key) self.comboBox0[key] = QtGui.QComboBox() self.comboBox0[key].addItems(self.dProject['chKeyRS']) self.comboBox0[key].setCurrentIndex( self.dProject['chKeyRS'].index(key)) vbox = myGridLayout() vbox.addWidget(self.label0['RX'], 0, 0) vbox.addWidget(self.comboBox0['RX'], 0, 1) vbox.addWidget(self.label0['BG'], 1, 0) vbox.addWidget(self.comboBox0['BG'], 1, 1) vbox.addWidget(self.label0['RXS1'], 2, 0) vbox.addWidget(self.comboBox0['RXS1'], 2, 1) vbox.addWidget(self.label0['BGS1'], 3, 0) vbox.addWidget(self.comboBox0['BGS1'], 3, 1) if self.dProject['isSeq2']: vbox.addWidget(self.label0['RXS2'], 4, 0) vbox.addWidget(self.comboBox0['RXS2'], 4, 1) vbox.addWidget(self.label0['BGS2'], 5, 0) vbox.addWidget(self.comboBox0['BGS2'], 5, 1) self.groupBox0 = QtGui.QGroupBox() self.groupBox0.setLayout(vbox) ### Button Box self.buttonBox = ToolButton() ## Main Layout mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(self.groupBox0) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.isToolApplied = False
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel( self.tr("<p> <center><b>NO TOOL SELECTED </b></center></p>" "<p> <center>Select a tool from Menu</center> </p> ")) self.name = "No Tool" self.buttonBox = ToolButton() mainLayout = QtGui.QVBoxLayout() mainLayout.addStretch() mainLayout.addWidget(self.labelTitle) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout)
def __init__(self, text, parent=None): QtGui.QGroupBox.__init__(self, parent) label0 = QtGui.QLabel('Scale Factor') self.doubleSpinBox0 = QtGui.QDoubleSpinBox() self.doubleSpinBox0.setRange(0, 100.0) self.doubleSpinBox0.setValue(1.00) self.doubleSpinBox0.setSingleStep(0.01) self.checkBoxScale0 = QtGui.QCheckBox('Scale by windowing') self.checkBoxScale0.setWhatsThis( "This option is especially useful for long traces." " Scaling is applied locally not globally.") layout0 = myGridLayout() layout0.addWidget(self.checkBoxScale0, 0, 0, 1, 2) layout0.addWidget(label0, 1, 0) layout0.addWidget(self.doubleSpinBox0, 1, 1) self.setTitle(self.tr(text)) self.setLayout(layout0)
def __init__(self, dProject,parent=None): QtGui.QDialog.__init__(self, parent) self.dProject=dProject self.isApplied=False self.title = QtGui.QLabel(self.tr("<center><b>CREATE NEW PROJECT - STEP 1 OF 3</b></center>")) self.name='New Project' label0=QtGui.QLabel('Project Name') self.lineEdit0=QtGui.QLineEdit() self.lineEdit0.setText(self.dProject['name']) self.selectDir0=DlgSelectDir('Directory') self.selectDir0.lineEdit0.setText(self.dProject['dir']) self.radioButton0=QtGui.QRadioButton('One Sequencing Channel') self.radioButton1=QtGui.QRadioButton('Two Sequencing Channels ') if self.dProject['isSeq2']: self.radioButton1.setChecked(True) else: self.radioButton0.setChecked(True) self.groupBox = QtGui.QGroupBox(self.tr("Choose the Project Type")) layout0=QtGui.QVBoxLayout() layout0.addWidget(self.radioButton0) layout0.addWidget(self.radioButton1) self.groupBox.setLayout(layout0) layout0=QtGui.QGridLayout() layout0.addWidget(label0,1,0) layout0.addWidget(self.lineEdit0,1,1) layout0.addWidget(self.selectDir0,2,0,1,2) layout0.addWidget(self.groupBox,3,0,1,2) self.buttonBox=ButtonWizard() self.buttonBox.backButton.setEnabled(False) self.buttonBox.doneButton.setEnabled(False) self.buttonBox.nextButton.setDefault(True) self.connect(self.buttonBox.nextButton,QtCore.SIGNAL("clicked()"),self.clickNext0) mainLayout=QtGui.QVBoxLayout() mainLayout.addWidget(self.title) mainLayout.addLayout(layout0) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout)
def __init__(self, label, parent=None): QtGui.QWidget.__init__(self, parent) type = 'file' # dir, save, label0 = QtGui.QLabel(label) self.lineEdit0 = QtGui.QLineEdit() self.lineEdit0.setReadOnly(True) self.pushButton0 = QtGui.QPushButton('Browse') self.connect(self.pushButton0, QtCore.SIGNAL("clicked()"), self.dirBrowse0) layout0 = myGridLayout() layout0.addWidget(label0, 1, 0) layout0.addWidget(self.lineEdit0, 1, 1) layout0.addWidget(self.pushButton0, 1, 2) self.setLayout(layout0)
def __init__(self, dProject, parent=None): QtGui.QWidget.__init__(self, parent) self.title = QtGui.QLabel(self.tr("<center><b>SCALE</b></center>")) self.name = "Scale" self.toolID = 1 self.dProject = dProject self.dOutput = dProject['dData'].copy() self.label0 = {} self.doubleSpinBox0 = {} for key in self.dProject['chKeyRS']: self.label0[key] = QtGui.QLabel(key) self.doubleSpinBox0[key] = QtGui.QDoubleSpinBox() self.doubleSpinBox0[key].setRange(0.01, 100.00) self.doubleSpinBox0[key].setValue(1.00) self.doubleSpinBox0[key].setSingleStep(0.01) self.groupBox1 = QtGui.QGroupBox(self.tr('Enter Scale Factor')) vbox = QtGui.QGridLayout() vbox.addWidget(self.label0['RX'], 0, 0) vbox.addWidget(self.doubleSpinBox0['RX'], 0, 1) vbox.addWidget(self.label0['BG'], 1, 0) vbox.addWidget(self.doubleSpinBox0['BG'], 1, 1) vbox.addWidget(self.label0['RXS1'], 2, 0) vbox.addWidget(self.doubleSpinBox0['RXS1'], 2, 1) vbox.addWidget(self.label0['BGS1'], 3, 0) vbox.addWidget(self.doubleSpinBox0['BGS1'], 3, 1) if self.dProject['isSeq2']: vbox.addWidget(self.label0['RXS2'], 4, 0) vbox.addWidget(self.doubleSpinBox0['RXS2'], 4, 1) vbox.addWidget(self.label0['BGS2'], 5, 0) vbox.addWidget(self.doubleSpinBox0['BGS2'], 5, 1) vbox.setContentsMargins(0, 0, 0, 0) self.groupBox1.setLayout(vbox) self.pushButton0 = QtGui.QPushButton('Scale All to BG') self.connect(self.pushButton0, QtCore.SIGNAL("clicked()"), self.autoScale) ### Button Box self.buttonBox = ToolButton() ## Main Layout self.groupBoxROI = GroupBoxROI(self.dProject) mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.title) mainLayout.addWidget(self.groupBox1) mainLayout.addWidget(self.pushButton0) mainLayout.addWidget(self.groupBoxROI.groupBox) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.isToolApplied = False
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.title = QtGui.QLabel( self.tr("<center><b>OPEN ABIF FILE</b></center>")) self.name = "Open ABIF File" self.toolID = 1 self.fileRead0 = DlgSelectFile( 'ABIF File', "ABIF or Text File (*.ab1 *.fsa *.txt)") self.listWidget0 = myListWidget() self.buttonBox = ToolButton() mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.title) mainLayout.addWidget(self.fileRead0) mainLayout.addWidget(self.listWidget0) mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.isToolApplied = False
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) # self.cancelButton = QtGui.QPushButton(self.tr("Cancel")) self.backButton = QtGui.QPushButton(self.tr("< &Back")) self.nextButton = QtGui.QPushButton(self.tr("Next >")) self.doneButton = QtGui.QPushButton(self.tr("&Done")) buttonLayout = QtGui.QHBoxLayout() buttonLayout.addStretch(1) # buttonLayout.addWidget(self.cancelButton) buttonLayout.addWidget(self.backButton) buttonLayout.addWidget(self.nextButton) buttonLayout.addWidget(self.doneButton) self.mainLayout = QtGui.QVBoxLayout() self.mainLayout.addLayout(buttonLayout) self.setLayout(self.mainLayout)
def __init__(self, dProject, parent=None): QtGui.QWidget.__init__(self, parent) self.checkBox0 = {} self.groupBox = QtGui.QGroupBox(self.tr('Apply to Channels')) for key in dProject['chKeyRS']: self.checkBox0[key] = QtGui.QCheckBox(key) self.checkBox0[key].setChecked(True) hbox0 = myGridLayout() hbox0.addWidget(self.checkBox0['RX'], 0, 0) hbox0.addWidget(self.checkBox0['RXS1'], 0, 1) if dProject['isSeq2']: hbox0.addWidget(self.checkBox0['RXS2'], 0, 2) hbox0.addWidget(self.checkBox0['BG'], 1, 0) hbox0.addWidget(self.checkBox0['BGS1'], 1, 1) if dProject['isSeq2']: hbox0.addWidget(self.checkBox0['BGS2'], 1, 2) self.groupBox.setLayout(hbox0)
def __init__(self, dProject,parent=None): QtGui.QDialog.__init__(self, parent) self.name='New Project' self.title = QtGui.QLabel(self.tr("<center><b>CREATE NEW PROJECT - STEP 2 OF 3</b></center>")) self.dProject=dProject self.isApplied=False self.fileRead0=DlgSelectFile('(+) Reaction',"ABIF or Text File (*.ab1 *.fsa *.txt)",self.dProject['dir']) self.fileRead1=DlgSelectFile('(-) Reaction',"ABIF or Text File (*.ab1 *.fsa *.txt)",self.dProject['dir']) self.fileRead2=DlgSelectFile('Sequence',"Base Files (*.txt *.fasta *.gbk *.seq )",self.dProject['dir']) self.fileRead3=DlgSelectFile('Ref. Proj.',"Reference Project (*.pyshape *.qushape)",self.dProject['dir']) self.fileRead0.lineEdit0.setText(self.dProject['fNameRX']) self.fileRead1.lineEdit0.setText(self.dProject['fNameBG']) self.fileRead2.lineEdit0.setText(self.dProject['fNameSeq']) self.fileRead3.lineEdit0.setText(self.dProject['fNameRef']) text="HINT: Select either Sequence or Reference Project" self.hint = hintLabel(text) layout0 = QtGui.QVBoxLayout() layout0.addWidget(self.fileRead0) layout0.addWidget(self.fileRead1) layout0.addWidget(self.fileRead2) layout0.addWidget(self.fileRead3) layout0.addWidget(self.hint) self.buttonBox=ButtonWizard() self.buttonBox.doneButton.setEnabled(False) self.buttonBox.nextButton.setDefault(True) self.connect(self.buttonBox.backButton,QtCore.SIGNAL("clicked()"),self.clickBack1) self.connect(self.buttonBox.nextButton,QtCore.SIGNAL("clicked()"),self.clickNext1) mainLayout=QtGui.QVBoxLayout() mainLayout.addWidget(self.title) mainLayout.addLayout(layout0) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout)
def __init__(self, dProject, parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel( self.tr("<center><b>MANUAL SIGNAL ALGINMENT</b></center>")) self.name = "Manual Signal Alignment" self.toolID = 1 self.dProject = dProject self.dProjOut = deepcopy(dProject) self.linkXR, self.linkXS = np.array([]), np.array([]) self.dataR, self.dataS = np.array([]), np.array([]) self.isToolApplied = False label0 = QtGui.QLabel('Reference Channel') self.comboBox0 = QtGui.QComboBox() self.comboBox0.addItems(dProject['chKeyRS']) label1 = QtGui.QLabel('Sample Channel') self.comboBox1 = QtGui.QComboBox() self.comboBox1.addItems(dProject['chKeyRS']) self.comboBox1.setCurrentIndex(1) layout0 = myGridLayout() layout0.addWidget(label0, 0, 0) layout0.addWidget(self.comboBox0, 0, 1) layout0.addWidget(label1, 1, 0) layout0.addWidget(self.comboBox1, 1, 1) self.groupBox0 = QtGui.QGroupBox("Select Channels") self.groupBox0.setLayout(layout0) self.groupBox0.setCheckable(True) self.button0 = QtGui.QPushButton('Modify Matched Peaks') self.button0.setEnabled(False) self.buttonBox = ToolButton() self.applyChannel = ApplyChannel(self.dProject) mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(self.groupBox0) mainLayout.addWidget(self.button0) mainLayout.addStretch() mainLayout.addWidget(self.applyChannel.groupBox) mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.refKey = 'RXS1' self.sampleKey = 'BGS1'
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel( self.tr("<center><b>OPEN SHAPEFINDER FILES</b></center>")) self.name = "Read ShapeFinder File" self.toolID = 1 self.fileRead0 = DlgSelectFile('Data File', "Text File (*.txt)") self.fileRead1 = DlgSelectFile('Report File', "Text File (*.txt)") ### Button Box self.buttonBox = ToolButton() mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(self.fileRead0) mainLayout.addWidget(self.fileRead1) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.isToolApplied = False
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel( self.tr("<center><b>OPEN SEQUENCE FILE</b></center>")) self.name = "Read Sequence File" self.toolID = 1 self.fileRead0 = DlgSelectFile( 'Seq. File', "Base Files (*.txt *.fasta *.gbk *.seq )") self.listWidget0 = QtGui.QListWidget() ### Button Box self.buttonBox = ToolButton() mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(self.fileRead0) mainLayout.addWidget(self.listWidget0) mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.isToolApplied = False
def __init__(self, dProject,parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel(self.tr("<center><b>PROJECT INFORMATION</b></center>")) self.name="ProjInfo" self.toolID=1 self.dProject=dProject self.projInfo='' self.projInfo+='<h3 align=center>QUSHAPE PROJECT INFORMATION</h3>' self.projInfo+='<p><b> Project Name : </b>'+str(dProject['name']) self.projInfo+='<p><b> Working Directory : </b>'+str(dProject['dir']) self.projInfo+='<p><b> RX File: </b>'+ str(self.dProject['fNameRX'])+'</p>' self.projInfo+='<p><b> BG File: </b>'+ str(self.dProject['fNameBG'])+'</p>' self.projInfo+='<p><b> RNA File: </b>'+ str(self.dProject['fNameSeq'])+'</p>' self.projInfo+='<p><b> Reference File: </b>'+ str(self.dProject['fNameRef'])+'</p>' self.projInfo+='<p><b> ddNTP: </b>'+str(self.dProject['ddNTP1']) self.projInfo+='<p><b> Used Dyes: RX: </b>'+str(self.dProject['dyeN']['RX']) self.projInfo+='<b> BG: </b>'+str(self.dProject['dyeN']['BG']) self.projInfo+='<b> RXS1: </b>'+str(self.dProject['dyeN']['RXS1']) self.projInfo+='<b> BGS1: </b>'+str(self.dProject['dyeN']['BGS1']) self.projInfo+='<p><b> Channel Index: RX: </b>'+str(self.dProject['chIndex']['RX']+1) self.projInfo+='<b> BG: </b>'+str(self.dProject['chIndex']['BG']+1) self.projInfo+='<b> RXS1: </b>'+str(self.dProject['chIndex']['RXS1']+1) self.projInfo+='<b> BGS1: </b>'+str(self.dProject['chIndex']['BGS1']+1) self.textBrowser = QtGui.QTextBrowser() self.textBrowser.setHtml(self.projInfo) mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.textBrowser) self.setLayout(mainLayout)
def DVar(chKeyRS): colors = [ QtGui.QColor('red').name(), QtGui.QColor('blue').name(), QtGui.QColor('green').name(), QtGui.QColor('magenta').name(), QtGui.QColor('orange').name(), QtGui.QColor('cyan').name() ] dVar = {} dVar dVar['lineVisible'] = {} dVar['lineColor'] = {} dVar['lineStyle'] = {} dVar['lineMarker'] = {} dVar['lineWidth'] = {} for i in range(len(chKeyRS)): key = chKeyRS[i] dVar['lineColor'][key] = colors[i] dVar['lineVisible'][key] = True dVar['lineStyle'][key] = '-' dVar['lineMarker'][key] = '' dVar['lineWidth'][key] = 1 dVar['widthP'] = 100 dVar['heightP'] = 100 dVar['zoomP'] = 100 dVar['left'] = 0.01 dVar['right'] = 0.99 dVar['top'] = 0.99 dVar['bottom'] = 0.05 dVar['maxLength'] = 0 # dVar['isDoneSeqAlign'] = False dVar['isDoneSeqAlignRef'] = False dVar['isDoneReactivity'] = False ## CONTROL FLAGS dVar['flag'] = {} dVar['flag']['isDrawStad'] = False dVar['flag']['isSeqAlign'] = False dVar['flag']['isDrawLine'] = False dVar['flag']['isDrawGauss'] = False dVar['flag']['isSatd'] = False dVar['flag']['isScale'] = False dVar['flag']['isPeakMatchModify'] = False dVar['flag']['isPeakLinkRefModify'] = False dVar['flag']['isDrawRef'] = False return dVar
def __init__(self, dProject,parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel(self.tr("<center><b>SIGNAL DECAY CORRECTION</b></center>")) self.name="Signal Decay Correction" self.toolID=4 self.dProject=dProject self.dOutput=dProject['dData'].copy() self.dProjOut=deepcopy(dProject) self.isToolApplied=False self.spinBox0=QtGui.QDoubleSpinBox() self.spinBox0.setRange(0,2.0) self.spinBox0.setValue(0.2) self.spinBox0.setSingleStep(0.1) #### Group Box Radio self.radioButton0 = QtGui.QRadioButton(self.tr(" Automatic Summation ")) self.radioButton1 = QtGui.QRadioButton(self.tr("Exponential")) self.radioButton2 = QtGui.QRadioButton(self.tr("Summation - Factor")) self.radioButton0.setChecked(True) layout0 = myGridLayout() layout0.addWidget(self.radioButton0,0,0) layout0.addWidget(self.radioButton1,1,0) layout0.addWidget(self.radioButton2,2,0) layout0.addWidget(self.spinBox0,2,1) groupBox0 = QtGui.QGroupBox(self.tr("Select a method")) groupBox0.setLayout(layout0) ### Button Box self.buttonBox = ToolButton() self.groupBoxROI=GroupBoxROI(self.dProject) self.applyChannel=ApplyChannel(self.dProject) ### Main Layout mainLayout=QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(groupBox0) mainLayout.addWidget(self.groupBoxROI.groupBox) mainLayout.addWidget(self.applyChannel.groupBox) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout)
def __init__(self, dProject, dProjRef, parent=None): QtGui.QWidget.__init__(self, parent) self.title = QtGui.QLabel( self.tr("<center><b>AUTOMATED ANALYSIS BY REFERENCE</b></center>")) self.name = "Automated by Reference" self.toolID = 1 self.dProject = dProject self.dProjOut = deepcopy(dProject) self.dProjRef = dProjRef self.isToolApplied = False self.checkBox0 = QtGui.QCheckBox("Tools") self.checkBox1 = QtGui.QCheckBox("Sequence Alignment") self.checkBox0.setChecked(True) self.checkBox1.setChecked(True) self.pushButton0 = QtGui.QPushButton('Reactivity') self.pushButton1 = QtGui.QPushButton('Peak Area') self.pushButton2 = QtGui.QPushButton('Data') layout3 = myGridLayout() layout3.addWidget(self.checkBox0, 1, 0, 1, 3) layout3.addWidget(self.checkBox1, 2, 0, 1, 3) layout3.addWidget(self.pushButton0, 3, 0) layout3.addWidget(self.pushButton1, 3, 1) layout3.addWidget(self.pushButton2, 3, 3) self.groupBox3 = QtGui.QGroupBox(self.tr('Select Plot Type')) self.groupBox3.setLayout(layout3) ### BUTTON BOX self.buttonBox = ToolButton() ## MAIN LAYOUT mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.title) mainLayout.addWidget(self.groupBox3) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout)
def __init__(self, dProject, dProjRef, parent=None): QtGui.QWidget.__init__(self, parent) self.title = QtGui.QLabel( self.tr("<center><b>REACTIVITY BY REFERENCE</b></center>")) self.name = "Reactivity by Reference" self.toolID = 1 self.dProject = dProject self.dProjOut = deepcopy(dProject) self.dProjRef = dProjRef self.isToolApplied = False ### SCALE RX self.groupBox0 = scaleGroupBox("Scale RX") ### SCALE BG self.groupBox1 = scaleGroupBox("Scale BG") ### SCALE REACTIVITY self.groupBox2 = scaleGroupBox("Scale Reactivity") self.pushButton0 = QtGui.QPushButton('Reactivity') self.pushButton1 = QtGui.QPushButton('Peak Area') self.pushButton2 = QtGui.QPushButton('Data') layout3 = myGridLayout() layout3.addWidget(self.pushButton0, 1, 0) layout3.addWidget(self.pushButton1, 1, 1) layout3.addWidget(self.pushButton2, 1, 3) self.groupBox3 = QtGui.QGroupBox(self.tr('Select Plot Type')) self.groupBox3.setLayout(layout3) ### BUTTON BOX self.buttonBox = ToolButton() ## MAIN LAYOUT mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.title) mainLayout.addWidget(self.groupBox0) mainLayout.addWidget(self.groupBox1) mainLayout.addWidget(self.groupBox2) mainLayout.addWidget(self.groupBox3) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.isClickedApply = False
def __init__(self, dProject, parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel( self.tr("<center><b>SOME FUNCTIONS</b></center>")) self.name = "Various Tools" self.toolID = 1 self.dProject = dProject self.isToolApplied = False #### Group Box Radio groupBoxRadio = QtGui.QGroupBox(self.tr("Select a Tool")) self.radioButton0 = QtGui.QRadioButton( self.tr("Resolution Enhancement")) self.radioButton1 = QtGui.QRadioButton(self.tr("First Derivative")) self.radioButton2 = QtGui.QRadioButton(self.tr("Stat Normalization")) self.radioButton3 = QtGui.QRadioButton(self.tr("Fourier Transform")) self.radioButton0.setChecked(True) vbox = myVBoxLayout() vbox.addWidget(self.radioButton0) vbox.addWidget(self.radioButton1) vbox.addWidget(self.radioButton2) vbox.addWidget(self.radioButton3) groupBoxRadio.setLayout(vbox) ### Button Box self.buttonBox = ToolButton() self.groupBoxROI = GroupBoxROI(self.dProject) self.applyChannel = ApplyChannel(self.dProject) mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(groupBoxRadio) mainLayout.addWidget(self.groupBoxROI.groupBox) mainLayout.addWidget(self.applyChannel.groupBox) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout)
def __init__(self, dProject,parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel(self.tr("<center><b>BASELINE ADJUSTMENT</b></center>")) self.name="Baseline Adjustment" self.toolID=3 self.dProject=dProject self.isToolApplied=False #### Window Size windowLabel = QtGui.QLabel("Baseline Window:") self.spinBox0 = QtGui.QSpinBox() self.spinBox0.setRange(0,200) self.spinBox0.setValue(60) self.spinBox0.setSingleStep(1) self.smoothCheckBox = QtGui.QCheckBox("Smooth the Baseline Drift") #self.smoothCheckBox.setChecked(True) layout2=myGridLayout() layout2.addWidget(windowLabel,0,0) layout2.addWidget(self.spinBox0,0,1) layout2.addWidget(self.smoothCheckBox,1,0) groupBoxParameter = QtGui.QGroupBox() groupBoxParameter.setLayout(layout2) ### Button Box self.buttonBox = ToolButton() self.groupBoxROI=GroupBoxROI(self.dProject) self.applyChannel=ApplyChannel(self.dProject) mainLayout=QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(groupBoxParameter) mainLayout.addWidget(self.groupBoxROI.groupBox) mainLayout.addWidget(self.applyChannel.groupBox) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout)
def __init__(self, dVar, chKeyRS, parent=None): super(DlgLineProps, self).__init__(parent) self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.setModal(False) self.labelTitle = QtGui.QLabel( self.tr("<center><b>CHANNEL ATTRIBUTES</b></center>")) self.name = "Channel Attributes" self.toolID = 3 self.dVar = dVar.copy() self.chKeyRS = chKeyRS labels = ["Channel", "Color", "Line", "Marker", "Width"] self.label = {} self.checkBox0 = {} self.pushButton0 = {} self.comboBoxLineStyle = {} lineStyles = ["solid", "dashed", "dash_dot", "dotted"] self.lineStyles = ['-', '--', '-.', ':'] self.comboBoxMarkerStyle = {} markerStyles = [ "none", "point", "circle", "star", "square", "plus", "X", "diamond" ] self.markerStyles1 = ['', '.', 'o', '*', 's', '+', 'x', 'D'] self.doubleSpinBoxLW = {} for key in chKeyRS: self.checkBox0[key] = QtGui.QCheckBox(key) self.checkBox0[key].setChecked(self.dVar['lineVisible'][key]) self.pushButton0[key] = QtGui.QPushButton() self.pushButton0[key].setStyleSheet( "QWidget { background-color: %s }" % self.dVar['lineColor'][key]) self.comboBoxLineStyle[key] = QtGui.QComboBox() self.comboBoxLineStyle[key].addItems(lineStyles) self.comboBoxMarkerStyle[key] = QtGui.QComboBox() self.comboBoxMarkerStyle[key].addItems(markerStyles) self.doubleSpinBoxLW[key] = QtGui.QDoubleSpinBox() self.doubleSpinBoxLW[key].setValue(1.0) self.doubleSpinBoxLW[key].setSingleStep(0.1) layout0 = myGridLayout() for i in range(len(labels)): self.label[i] = QtGui.QLabel(labels[i]) layout0.addWidget(self.label[i], 0, i) for key in chKeyRS: #self.dChKeys['RS']: index = chKeyRS.index(key) + 1 layout0.addWidget(self.checkBox0[key], index, 0) layout0.addWidget(self.pushButton0[key], index, 1) layout0.addWidget(self.comboBoxLineStyle[key], index, 2) layout0.addWidget(self.comboBoxMarkerStyle[key], index, 3) layout0.addWidget(self.doubleSpinBoxLW[key], index, 4) self.buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Apply | QtGui.QDialogButtonBox.Close) self.connect(self.pushButton0['RX'], QtCore.SIGNAL("clicked()"), self.changeColorRX) self.connect(self.pushButton0['RXS1'], QtCore.SIGNAL("clicked()"), self.changeColorRXS1) self.connect(self.pushButton0['BG'], QtCore.SIGNAL("clicked()"), self.changeColorBG) self.connect(self.pushButton0['BGS1'], QtCore.SIGNAL("clicked()"), self.changeColorBGS1) if 'RXS2' in chKeyRS: self.connect(self.pushButton0['RXS2'], QtCore.SIGNAL("clicked()"), self.changeColorRXS2) if 'BGS2' in chKeyRS: self.connect(self.pushButton0['BGS2'], QtCore.SIGNAL("clicked()"), self.changeColorBGS2) self.connect(self.buttonBox.button(QtGui.QDialogButtonBox.Apply), QtCore.SIGNAL("clicked()"), self.apply) self.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.reject) mainLayout = QtGui.QVBoxLayout() mainLayout.addLayout(layout0) mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.title = "Channel Attributes" self.setWindowTitle(self.title)
def __init__(self, dVar, chKeyRS, parent=None): super(DlgFigureSet, self).__init__(parent) self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.setModal(False) self.labelTitle = QtGui.QLabel( self.tr("<center><b>FIGURE SETTING</b></center>")) self.name = "Figure Setting" self.toolID = 3 self.dVar = dVar.copy() self.chKeyRS = chKeyRS # Size, width, height, resolution, labelT = QtGui.QLabel('Size style') self.comboBox0 = QtGui.QComboBox() self.comboBox0.addItems(['Percentage', 'Inches']) labelW = QtGui.QLabel("Width") self.spinBoxWidth = QtGui.QSpinBox() self.spinBoxWidth.setRange(10, 200) self.spinBoxWidth.setValue(100) self.spinBoxWidth.setSingleStep(10) self.spinBoxWidth.setSuffix(" %") labelH = QtGui.QLabel("Height") self.spinBoxHeight = QtGui.QSpinBox() self.spinBoxHeight.setRange(10, 200) self.spinBoxHeight.setValue(100) self.spinBoxHeight.setSingleStep(10) self.spinBoxHeight.setSuffix(" %") self.checkBoxFitWindow = QtGui.QCheckBox("Fit into Window") labelR = QtGui.QLabel("Zoom") self.spinBoxR = QtGui.QSpinBox() self.spinBoxR.setRange(10, 1000) self.spinBoxR.setValue(100) self.spinBoxR.setSingleStep(50) layout0 = myGridLayout() layout0.addWidget(self.checkBoxFitWindow, 0, 0, 1, 2) layout0.addWidget(labelT, 1, 0) layout0.addWidget(self.comboBox0, 1, 1) layout0.addWidget(labelW, 2, 0) layout0.addWidget(self.spinBoxWidth, 2, 1) layout0.addWidget(labelH, 3, 0) layout0.addWidget(self.spinBoxHeight, 3, 1) layout0.addWidget(labelR, 4, 0) layout0.addWidget(self.spinBoxR, 4, 1) groupBox0 = QtGui.QGroupBox(self.tr('Figure Options')) groupBox0.setLayout(layout0) labelSubs = {} self.spinBoxSubs = {} self.keySubs = ['top', 'bottom', 'left', 'right'] #,'wspace','hspace'] for key in self.keySubs: labelSubs[key] = QtGui.QLabel(key) self.spinBoxSubs[key] = QtGui.QDoubleSpinBox() self.spinBoxSubs[key].setRange(0, 1) self.spinBoxSubs[key].setValue(self.dVar[key]) self.spinBoxSubs[key].setSingleStep(0.01) layout1 = myGridLayout() i = 0 while i < len(self.keySubs): key = self.keySubs[i] layout1.addWidget(labelSubs[key], i, 0) layout1.addWidget(self.spinBoxSubs[key], i, 1) i += 1 key = self.keySubs[i] layout1.addWidget(labelSubs[key], i - 1, 2) layout1.addWidget(self.spinBoxSubs[key], i - 1, 3) i += 1 groupBox1 = QtGui.QGroupBox(self.tr('Subplot Configuration')) groupBox1.setLayout(layout1) self.checkBoxSatd = QtGui.QCheckBox('Draw Saturated Points') self.lanelXLim = QtGui.QLabel('Set Xlim') self.fromSpinBox = QtGui.QSpinBox() self.toSpinBox = QtGui.QSpinBox() fromLabel = QtGui.QLabel('From') toLabel = QtGui.QLabel('To') self.buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Apply | QtGui.QDialogButtonBox.Close) mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(groupBox0) mainLayout.addWidget(groupBox1) mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.title = "Channel Attributes" self.setWindowTitle(self.title)
self.dVar['heightP'] = self.spinBoxHeight.value() self.dVar['zoomP'] = self.spinBoxR.value() self.dVar['isDrawSatd'] = self.checkBoxSatd.isChecked() for key in self.keySubs: self.dVar[key] = self.spinBoxSubs[key].value() if __name__ == "__main__": import sys dLineVisible = { 'RX': True, 'BG': True, 'RXS1': True, 'BGS1': True, 'RXS2': False, 'BGS2': False } dLineColor = { 'RX': (QtGui.QColor('red').name()), 'BG': (QtGui.QColor('blue').name()), 'RXS1': str(QtGui.QColor('green').name()), 'BGS1': str(QtGui.QColor('magenta').name()), 'RXS2': str(QtGui.QColor('yellow').name()), 'BGS2': str(QtGui.QColor('cyan').name()) } app = QtGui.QApplication(sys.argv) from Functions import DVar form = DlgFigureSet(DVar(dLineVisible.keys()), dLineVisible.keys()) form.show() app.exec_()
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.setFixedSize(350, 450) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.label = QtWidgets.QLabel(self.centralwidget) self.label.setGeometry(QtCore.QRect(0, 0, 350, 41)) font = QtGui.QFont() font.setPointSize(20) font.setBold(True) font.setUnderline(False) font.setWeight(75) self.label.setFont(font) self.label.setScaledContents(False) self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") self.label_2 = QtWidgets.QLabel(self.centralwidget) self.label_2.setEnabled(True) self.label_2.setGeometry(QtCore.QRect(25, 330, 300, 61)) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(12) sizePolicy.setVerticalStretch(12) sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) self.label_2.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setStrikeOut(False) font.setKerning(True) self.label_2.setFont(font) self.label_2.setAutoFillBackground(False) self.label_2.setStyleSheet("color: rgb(130, 142, 155);") self.label_2.setLocale(QtCore.QLocale(QtCore.QLocale.Ukrainian, QtCore.QLocale.Ukraine)) self.label_2.setFrameShape(QtWidgets.QFrame.NoFrame) self.label_2.setFrameShadow(QtWidgets.QFrame.Plain) self.label_2.setLineWidth(0) self.label_2.setMidLineWidth(0) self.label_2.setScaledContents(True) self.label_2.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop) self.label_2.setWordWrap(True) self.label_2.setIndent(-1) self.label_2.setTextInteractionFlags(QtCore.Qt.NoTextInteraction) self.label_2.setObjectName("label_2") self.pushButton = QtWidgets.QPushButton(self.centralwidget) self.pushButton.setGeometry(QtCore.QRect(115, 290, 120, 32)) self.pushButton.setObjectName("pushButton") self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_2.setGeometry(QtCore.QRect(115, 400, 120, 32)) self.pushButton_2.setObjectName("pushButton_2") self.frame = QtWidgets.QFrame(self.centralwidget) self.frame.setGeometry(QtCore.QRect(0, 42, 351, 241)) self.frame.setAcceptDrops(False) self.frame.setStyleSheet("image: url(:/logo/color.png);") self.frame.setFrameShape(QtWidgets.QFrame.NoFrame) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") MainWindow.setCentralWidget(self.centralwidget) self.pushButton_2.hide() self.retranslateUi(MainWindow) self.app_functions(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def __init__(self,dProject,dProjRef,parent=None): QtGui.QWidget.__init__(self, parent) self.labelTitle = QtGui.QLabel(self.tr("<center><b>APPLY ALL TOOLS</b></center>")) self.name="Apply All Tools" self.toolID=1 self.dProject=dProject self.dProjOut=deepcopy(dProject) self.dProjRef=deepcopy(dProjRef) label0 = QtGui.QLabel("Start Point") label1 = QtGui.QLabel("End Point") start,end=0,len(self.dProject['dData']['RX']) # findRoi(self.dCurData['RXS']) self.spinBox0 = QtGui.QSpinBox() self.spinBox0.setRange(0, len(self.dProject['dData']['RX'])) self.spinBox0.setValue(start) self.spinBox0.setSingleStep(1) self.spinBox1 = QtGui.QSpinBox() self.spinBox1.setRange(0, len(self.dProject['dData']['RX'])) self.spinBox1.setValue(end) self.spinBox1.setSingleStep(1) layout0=QtGui.QHBoxLayout() layout0.addWidget(label0) layout0.addWidget(self.spinBox0) layout0.addWidget(label1) layout0.addWidget(self.spinBox1) groupBox0=QtGui.QGroupBox('Select Region of Interest') groupBox0.setLayout(layout0) self.checkBox01=QtGui.QCheckBox("Saturation Correction") self.checkBox0=QtGui.QCheckBox("Smoothing Windows Size") self.checkBox1=QtGui.QCheckBox("Mobility Shift") self.checkBox2=QtGui.QCheckBox("Baseline Adjustment Window") self.checkBox3=QtGui.QCheckBox("Signal Decay Correction") self.checkBox4=QtGui.QCheckBox("Signal Alignment") self.checkBox01.setChecked(True) self.checkBox0.setChecked(True) self.checkBox1.setChecked(True) self.checkBox2.setChecked(True) self.checkBox3.setChecked(True) self.checkBox4.setChecked(True) self.spinBox2 = QtGui.QSpinBox() self.spinBox2.setRange(0, 10) self.spinBox2.setValue(1) self.spinBox2.setSingleStep(1) self.spinBox4 = QtGui.QSpinBox() self.spinBox4.setRange(0, 500) self.spinBox4.setValue(60) self.spinBox4.setSingleStep(1) layout1=QtGui.QGridLayout() layout1.addWidget(self.checkBox01,0,0) layout1.addWidget(self.checkBox0,1,0) layout1.addWidget(self.spinBox2,1,1) layout1.addWidget(self.checkBox1,2,0) layout1.addWidget(self.checkBox2,3,0) layout1.addWidget(self.spinBox4,3,1) layout1.addWidget(self.checkBox3,4,0) layout1.addWidget(self.checkBox4,5,0) groupBox1=QtGui.QGroupBox('Select Tools') groupBox1.setLayout(layout1) ### Button Box self.buttonBox = ToolButton() mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(self.labelTitle) mainLayout.addWidget(groupBox0) mainLayout.addWidget(groupBox1) mainLayout.addStretch() mainLayout.addWidget(self.buttonBox) self.setLayout(mainLayout) self.isToolApplied=False