Exemplo n.º 1
0
    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
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
    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 
Exemplo n.º 4
0
    def __init__(self, dProject,parent=None):
        QtGui.QWidget.__init__(self, parent)
        
        self.title = QtGui.QLabel(self.tr("<center><b>SIGNAL ALIGNMENT</b></center>"))
        self.name="Signal Alignment"
        self.toolID=4
        
        self.dProject=dProject
        self.dOutput=dProject['dData'].copy()    
        self.dProjOut=deepcopy(dProject)
        self.linkXR,self.linkXS=np.array([]),np.array([])
        self.dataR,self.dataS=np.array([]),np.array([])
        self.isToolApplied=False
### Group of ComboBoxes
        label1=QtGui.QLabel("Seq. Channels")
        
        self.comboBox0=QtGui.QComboBox() 
        self.comboBox0.setCurrentIndex(0)
        if self.dProject['isSeq2']: 
            choices0= ['RXS1 - BGS1','RXS2 - BGS2']
        else:
            choices0= ['RXS1 - BGS1']
        self.comboBox0.addItems(choices0)
        
        gridLayout0 = QtGui.QGridLayout()
        gridLayout0.addWidget(label1, 0, 0)
        gridLayout0.addWidget(self.comboBox0, 0, 1)  
        
        groupBox1=QtGui.QGroupBox('Select Channels to be aligned')
        groupBox1.setLayout(gridLayout0)
      
        self.button0=peakMatchModifyButton()
        
        text=self.tr("HINT: When the matched peaks are modified; Key 'A'  to add a Peak. Key 'D'  to delete a Peak. Key 'Shift' to change position. ")                                     
        self.hint = hintLabel(text)
        
#        self.button0=QtGui.QPushButton('Modify Matched Peaks')
#        self.button0.setEnabled(False)
#        
#        self.hint = QtGui.QLabel(self.tr("HINT: When the matched peaks are modified,"
#                                         "Press Key 'A' button and click both plots to add a Peak. "
#                                         "Press Key 'D' button and click to delete a Peak. "
#                                         "Press Key 'Shift' button and select a peak in BGS to change position. "
#                                                                ))
        
#        self.font = QtGui.QFont() 
#        self.font.setPointSize(9)
#        self.hint.setFont(self.font)
#        self.hint.setWordWrap(True)
        
### Button Box
        self.buttonBox = ToolButton()
## Main Layout  
        mainLayout = QtGui.QVBoxLayout()
        mainLayout.addWidget( self.title)
        mainLayout.addWidget(groupBox1)
        mainLayout.addWidget(self.button0)
        mainLayout.addWidget(self.hint)

        mainLayout.addStretch()  
        mainLayout.addWidget(self.buttonBox) 
        self.setLayout(mainLayout)
        
        self.isToolAppliedSigAlign=False
        self.connect(self.comboBox0,QtCore.SIGNAL('currentIndexChanged(int)'), self.comboChanged)
Exemplo n.º 5
0
 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 3 OF 3</b></center>"))
     self.dProject=dProject
     self.isApplied=False 
         
     self.label0={}
     self.comboBox0={}
     choices0=['Channel 1','Channel 2', 'Channel 3','Channel 4']
     for key in self.dProject['chKeyRS']:
         self.label0[key]=QtGui.QLabel(key)
         self.comboBox0[key]=QtGui.QComboBox()
         self.comboBox0[key].addItems(choices0)
         self.comboBox0[key].setCurrentIndex(self.dProject['chIndex'][key])
         
     choices2=['ddC','ddG', 'ddA', 'ddT']
     self.comboBox1={}
     self.comboBox1['RXS1']=QtGui.QComboBox()
     self.comboBox1['RXS1'].addItems(choices2)
     self.comboBox1['BGS1']=QtGui.QComboBox()
     self.comboBox1['BGS1'].addItems(choices2)
     
     if self.dProject['isSeq2']:
         self.comboBox1['RXS2']=QtGui.QComboBox()
         self.comboBox1['RXS2'].addItems(choices2) 
         self.comboBox1['BGS2']=QtGui.QComboBox()
         self.comboBox1['BGS2'].addItems(choices2) 
         self.comboBox1['RXS2'].setCurrentIndex(1)
         self.comboBox1['BGS2'].setCurrentIndex(1)
     
     layout1 = QtGui.QGridLayout()
     layout1.addWidget(self.label0['RX'], 0, 0)
     layout1.addWidget(self.comboBox0['RX'], 0, 1)
     layout1.addWidget(self.label0['RXS1'], 1, 0)
     layout1.addWidget(self.comboBox0['RXS1'], 1, 1)
     layout1.addWidget(self.comboBox1['RXS1'], 1, 2)
     if self.dProject['isSeq2']:
         layout1.addWidget(self.label0['RXS2'], 2, 0)
         layout1.addWidget(self.comboBox0['RXS2'], 2, 1)
         layout1.addWidget(self.comboBox1['RXS2'], 2, 2)
     
     groupBox1=QtGui.QGroupBox('Select (+) Reaction Channels')
     groupBox1.setLayout(layout1)
     
     layout2 = QtGui.QGridLayout()
     layout2.addWidget(self.label0['BG'], 0, 0)
     layout2.addWidget(self.comboBox0['BG'], 0, 1)
     layout2.addWidget(self.label0['BGS1'], 1, 0)
     layout2.addWidget(self.comboBox0['BGS1'], 1, 1)
     layout2.addWidget(self.comboBox1['BGS1'], 1, 2)
     if self.dProject['isSeq2']:
         layout2.addWidget(self.label0['BGS2'], 2, 0)
         layout2.addWidget(self.comboBox0['BGS2'], 2, 1)
         layout2.addWidget(self.comboBox1['BGS2'], 2, 2)
     
     groupBox2=QtGui.QGroupBox('Select (-) Reaction Channels')
     groupBox2.setLayout(layout2)
     
     self.buttonBox=ButtonWizard() 
     self.buttonBox.nextButton.setText('Apply')
     self.buttonBox.doneButton.setEnabled(False)
     self.buttonBox.nextButton.setDefault(True)
      
     self.connect(self.buttonBox.backButton,QtCore.SIGNAL("clicked()"),self.clickBack2)
     self.connect(self.buttonBox.nextButton,QtCore.SIGNAL("clicked()"),self.clickNext2)
     
     mainLayout=QtGui.QVBoxLayout()
     mainLayout.addWidget(self.title)
     mainLayout.addWidget(groupBox1)
     mainLayout.addWidget(groupBox2)
     mainLayout.addStretch()
     mainLayout.addWidget(self.buttonBox)
     
     self.setLayout(mainLayout)
     
     self.connect(self.comboBox0['RX'],QtCore.SIGNAL("currentIndexChanged(int)"),self.changeCombo00)
     self.connect(self.comboBox0['RXS1'],QtCore.SIGNAL("currentIndexChanged(int)"),self.changeCombo01)
     self.connect(self.comboBox1['RXS1'],QtCore.SIGNAL("currentIndexChanged(int)"),self.changeCombo10)
     if self.dProject['isSeq2']:
         self.connect(self.comboBox0['RXS2'],QtCore.SIGNAL("currentIndexChanged(int)"),self.changeCombo02)
         self.connect(self.comboBox1['RXS2'],QtCore.SIGNAL("currentIndexChanged(int)"),self.changeCombo11)