Exemple #1
0
    def build_protocol_middle_frame(self):

        n_tot_sequences = len(self.protocol.a3m_content) - 1

        # Sub-frame created to select the number of sequences to import.
        range_label = "Import the first n. sequences (tot: {})".format(
            n_tot_sequences)
        self.range_subframe = PyMod_hbox_option_qt(label_text=range_label)

        # Spinbox to select the number of sequences to import.
        self.seqs_to_import_spinbox = QtWidgets.QSpinBox()
        self.seqs_to_import_spinbox.setRange(1, n_tot_sequences)
        self.seqs_to_import_spinbox.setValue(min((100, n_tot_sequences)))
        self.range_subframe.hbox.addWidget(self.seqs_to_import_spinbox)
        self.range_subframe.set_auto_input_widget_width()
        self.middle_formlayout.add_widget_to_align(self.range_subframe)
Exemple #2
0
    def __init__(self,
                 label_text="Input",
                 value=1,
                 spinbox_min=1,
                 spinbox_max=100):
        PyMod_form_item.__init__(self)

        # Label.
        self.label = QtWidgets.QLabel(label_text)

        # Spinbox.
        self.spinbox = QtWidgets.QSpinBox()
        self.spinbox_min = spinbox_min
        self.spinbox_max = spinbox_max
        self.spinbox.setRange(self.spinbox_min, self.spinbox_max)
        self.spinbox.setStyleSheet(active_entry_style)

        self.input = self.spinbox
Exemple #3
0
    def add_middle_frame_widgets(self):

        # Units combobox.
        self.unit_combobox = PyMod_combobox_qt(label_text="Unit Selection",
                                               items=self.protocol.units_list)
        self.unit_combobox.combobox.setCurrentIndex(0)
        self.middle_formlayout.add_widget_to_align(self.unit_combobox)

        # Color combobox.
        self.color_combobox = PyMod_combobox_qt(label_text="Color Scheme Selection",
                                                items=self.protocol.colorscheme_list)
        self.color_combobox.combobox.setCurrentIndex(5)
        self.middle_formlayout.add_widget_to_align(self.color_combobox)

        # Sub-frame created to display entries for Logo Range option.
        self.range_subframe = PyMod_hbox_option_qt(label_text="Logo Range")

        # Logo start position spinbox.
        self.logo_start = QtWidgets.QSpinBox()
        self.logo_start.setRange(1, self.protocol.ali_length)
        self.range_subframe.hbox.addWidget(self.logo_start)
        # Separator dash.
        self.logo_range_dash = QtWidgets.QLabel(" - ")
        self.range_subframe.hbox.addWidget(self.logo_range_dash)
        # Logo end position spinbox.
        self.logo_end = QtWidgets.QSpinBox()
        self.logo_end.setRange(1, self.protocol.ali_length)
        self.logo_end.setValue(self.protocol.ali_length)
        self.range_subframe.hbox.addWidget(self.logo_end)
        self.range_subframe.set_auto_input_widget_width()
        self.middle_formlayout.add_widget_to_align(self.range_subframe)


        # ADVANCED OPTIONS.
        self.show_advanced_button()

        # Logo format combobox.
        self.format_combobox = PyMod_combobox_qt(label_text='Logo Format',
                                                 items=self.protocol.format_list)
        self.format_combobox.combobox.setCurrentIndex(0)
        self.middle_formlayout.add_widget_to_align(self.format_combobox, advanced_option=True)

        # LOGO title entry.
        self.logo_title_enf = PyMod_entryfield_qt(label_text="Logo Title",
                                                  value='')
        self.middle_formlayout.add_widget_to_align(self.logo_title_enf, advanced_option=True)

        # Stacks per line entry.
        self.logo_stacks_enf = PyMod_entryfield_qt(label_text="Stacks per line",
                                                   value='80',
                                                   validate={'validator': 'integer',
                                                             'min': 0, 'max': 100})
        self.middle_formlayout.add_widget_to_align(self.logo_stacks_enf, advanced_option=True)

        # Scale stacks width.
        self.scale_width_rds = PyMod_radioselect_qt(label_text="Scale stacks width",
                                                    buttons=('Yes', 'No'))
        self.scale_width_rds.setvalue("No")
        self.middle_formlayout.add_widget_to_align(self.scale_width_rds, advanced_option=True)

        # Show error bars.
        self.show_error_rds = PyMod_radioselect_qt(label_text="Show error bars",
                                                    buttons=('Yes', 'No'))
        self.show_error_rds.setvalue("No")
        self.middle_formlayout.add_widget_to_align(self.show_error_rds, advanced_option=True)

        self.middle_formlayout.set_input_widgets_width(175)
Exemple #4
0
    def __init__(self, parent=None):
        super(SurfStampFrame, self).__init__(parent)

        self.layout = QtWidgets.QVBoxLayout()
        self.setLayout(self.layout)

        glayout1 = QtWidgets.QGridLayout()
        self.label_message = QtWidgets.QLabel(self)
        self.label_message.setText("SurfStamp PyMOL plugin")
        self.layout.addWidget(self.label_message)

        self.combo_model = QtWidgets.QComboBox()
        self.combo_model.addItems([])
        self.layout.addWidget(self.combo_model)

        self.label_reso = QtWidgets.QLabel(self)
        self.label_reso.setText("Surface Resolution")
        glayout1.addWidget(self.label_reso, 1, 0)
        self.spin_reso = QtWidgets.QDoubleSpinBox(self)
        self.spin_reso.setRange(0.1, 1.0)
        self.spin_reso.setSingleStep(0.05)
        self.spin_reso.setValue(0.7)
        glayout1.addWidget(self.spin_reso, 1, 1)

        self.label_imagesize = QtWidgets.QLabel(self)
        self.label_imagesize.setText("Image Size")
        glayout1.addWidget(self.label_imagesize, 2, 0)
        self.spin_imagesize = QtWidgets.QSpinBox(self)
        self.spin_imagesize.setRange(1000, 10000)
        #PILLOW?は 13000 くらいが Max っぽい
        self.spin_imagesize.setSingleStep(100)
        self.spin_imagesize.setValue(4000)
        glayout1.addWidget(self.spin_imagesize, 2, 1)

        self.label_fontsize = QtWidgets.QLabel(self)
        self.label_fontsize.setText("Font Size")
        glayout1.addWidget(self.label_fontsize, 3, 0)
        self.spin_fontsize = QtWidgets.QSpinBox(self)
        self.spin_fontsize.setRange(3, 100)
        self.spin_fontsize.setSingleStep(1)
        self.spin_fontsize.setValue(20)
        glayout1.addWidget(self.spin_fontsize, 3, 1)

        glayout2 = QtWidgets.QGridLayout()
        self.check_outline = QtWidgets.QCheckBox('Outline')
        self.check_outline.setChecked(True)
        glayout2.addWidget(self.check_outline, 0, 0)

        self.check_nowater = QtWidgets.QCheckBox('Remove Waters')
        self.check_nowater.setChecked(True)
        glayout2.addWidget(self.check_nowater, 0, 1)

        self.check_colorall = QtWidgets.QCheckBox('Color All')
        self.check_colorall.setChecked(False)
        glayout2.addWidget(self.check_colorall, 1, 0)

        self.check_tile = QtWidgets.QCheckBox('Repeating Tile')

        self.check_tile.clicked.connect(self.checkTileOn)
        self.check_tile.setChecked(False)
        glayout2.addWidget(self.check_tile, 1, 1)

        self.check_oneletter = QtWidgets.QCheckBox('One Letter')
        glayout2.addWidget(self.check_oneletter, 2, 0)

        self.check_nochainname = QtWidgets.QCheckBox('No Chain Name')
        glayout2.addWidget(self.check_nochainname, 2, 1)

        self.check_ignore_occupancy = QtWidgets.QCheckBox('Ignore Occupancy')
        glayout2.addWidget(self.check_ignore_occupancy, 3, 0)
        self.check_cartoon = QtWidgets.QCheckBox('Cartoon')
        self.check_cartoon.clicked.connect(self.checkCartoonOn)
        glayout2.addWidget(self.check_cartoon, 3, 1)

        self.check_mmcif = QtWidgets.QCheckBox('Use MMCIF')
        glayout2.addWidget(self.check_mmcif, 4, 0)

        self.check_builtin = QtWidgets.QCheckBox('Built-in Surface Generator')
        glayout2.addWidget(self.check_builtin, 4, 1)
        self.check_builtin.clicked.connect(self.checkBuiltinOn)

        #MMCIF は AUTH が不完全だ!
        #self.check_label = QtWidgets.QCheckBox('ID Label');
        #self.layout.addWidget(self.check_label);

        # Text field for output file
        glayout4 = QtWidgets.QVBoxLayout()

        self.label_outprefix = QtWidgets.QLabel(
            'Output Prefix (Prefix+<something> will be overwritten.)')
        glayout4.addWidget(self.label_outprefix)

        glayout4b = QtWidgets.QGridLayout()
        self.text_outprefix = QtWidgets.QLineEdit(self)
        self.text_outprefix.setReadOnly(True)
        glayout4b.addWidget(self.text_outprefix, 0, 0)

        self.button_outprefix = QtWidgets.QPushButton(self)
        self.button_outprefix.setText("Save As")

        self.button_outprefix.clicked.connect(self.getFile)
        self.text_outprefix.setStyleSheet("background-color: lightgray;")

        glayout4b.addWidget(self.button_outprefix, 0, 1)
        glayout4.addLayout(glayout4b)

        glayout3 = QtWidgets.QGridLayout()
        self.button_ok = QtWidgets.QPushButton('Create')
        self.button_ok.clicked.connect(self.runSurfStamp)
        glayout3.addWidget(self.button_ok, 0, 0)

        self.button_close = QtWidgets.QPushButton('Close')
        self.button_close.clicked.connect(self.hide)
        glayout3.addWidget(self.button_close, 0, 1)

        self.layout.addLayout(glayout1)
        self.layout.addLayout(glayout2)
        self.layout.addLayout(glayout4)
        self.layout.addLayout(glayout3)

        screengeom = QtWidgets.qApp.desktop().screenGeometry()

        wwidth = 300
        hheight = 200
        self.setGeometry(screengeom.width() / 2 - wwidth / 2,
                         screengeom.height() / 2 - hheight / 2, wwidth,
                         hheight)
        self.setWindowTitle('SurfStamp')
        self.checkTileOn()
        self.checkBuiltinOn()
        self.checkCartoonOn()
        self.show()