def missed_cleavages(self): '''Sets the minimum missed cleavages during spectral searching''' label = widgets.Label("Missed Cleavage Range") self.layout.addWidget(label, 4, 0, 1, 5) storage = updating.Storage('minimum_missed_cleavages') minimum = updating.SpinBox( self, storage, minimum=0, maximum=5, tooltip="Minimum number of missed cleavages from " "proteolytic digestion", width=50) self.layout.addWidget(minimum, 4, 8, 1, 1) storage = updating.Storage('maximum_missed_cleavages') maximum = updating.SpinBox( self, storage, minimum=0, maximum=10, tooltip="Maximum number of missed cleavages from " "proteolytic digestion", width=50) self.layout.addWidget(maximum, 4, 9, 1, 1)
def peptide_length(self): '''Sets the minimum peptide length for spectral searching''' label = widgets.Label("Peptide Length Range") self.layout.addWidget(label, 3, 0, 1, 5) storage = updating.Storage('minimum_peptide_length') minimum = updating.SpinBox( self, storage, minimum=3, maximum=10, tooltip="Minimum peptide length included during spectral searches", width=50) self.layout.addWidget(minimum, 3, 8, 1, 1) storage = updating.Storage('maximum_peptide_length') maximum = updating.SpinBox( self, storage, minimum=20, maximum=70, tooltip="Maximum peptide length included during spectral searches", width=50) self.layout.addWidget(maximum, 3, 9, 1, 1)
def set_banner(self): '''Add a banner to the layout''' layout = self.add_layout(QtGui.QHBoxLayout, alignment='Center') banner = widgets.Label("Keyboard Shortcuts") banner.set_stylesheet('bannerwhite') layout.addWidget(banner)
def charge_range(self): '''Sets the charges to consider above the identified charge''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Charge Range") hlayout.addWidget(label) storage = updating.Storage('minus_charge_range') minus = updating.SpinBox(self, storage, minimum=0, maximum=5, tooltip="Number of charges below the identified charge to " "include during XIC extraction.", width=50, prefix='-') hlayout.addWidget(minus) storage = updating.Storage('plus_charge_charge') plus = updating.SpinBox(self, storage, minimum=0, maximum=5, tooltip="Number of charges above the identified charge to " "include during XIC extraction.", width=50, prefix='+') hlayout.addWidget(plus)
def set_text(self): '''Create QLabel with text and add to layout''' self.label = widgets.Label(self._text) self.label.setAlignment(qt.ALIGNMENT['HCenter']) self.layout.addWidget(self.label) self.layout.addSpacing(1)
def __init__(self, shortcut): super(ShortCutWidget, self).__init__() self.set_layout(QtGui.QGridLayout, alignment='Left') icon = IconLabel(KEYICONS[shortcut.key]) self.layout.addWidget(icon, 0, 0, 4, 4) label = widgets.Label(shortcut.sequence) label.set_stylesheet('keywhite') self.layout.addWidget(label, 0, 4, 2, 6) label = widgets.Label(shortcut.description) label.set_stylesheet('descriptionwhite') self.layout.addWidget(label, 2, 4, 2, 6) self.setMaximumSize(self.size, self.size)
def __init__(self, parent): super(BaseSection, self).__init__(parent) layout = getattr(self, "_layout", QtGui.QVBoxLayout) self.set_layout(layout, alignment='Top') header = widgets.Label(self._title, font=qt.BOLD_FONT) self.layout.addWidget(header)
def constant_modifications(self): '''Creates a QListWidget to select constant modifications''' header = widgets.Label("Constant", font=qt.BOLD_FONT) self.layout.addWidget(header) storage = updating.Storage('constant_modifications') self.constant = ModificationView(self, storage, self.engine) self.layout.addWidget(self.constant)
def variable_modifications(self): '''Creates a QListWidget to select variable modifications''' header = widgets.Label("Variable", font=qt.BOLD_FONT) self.layout.addWidget(header) storage = updating.Storage('variable_modifications') self.variable = ModificationView(self, storage, self.engine) self.layout.addWidget(self.variable)
def current(self): '''Sets the currently active report ions''' hlayout = self.add_layout(QtGui.QHBoxLayout) self.reporterlabel = widgets.Label("Current Reporter Ions") hlayout.addWidget(self.reporterlabel) self.reporterions = CurrentReporterIonBox(self) hlayout.addWidget(self.reporterions)
def set_filtering(self): '''Adds a line edit for a search query filter from the taxonomy''' label = widgets.Label("Filter Query: ") self.layout.addWidget(label, 2, 0, 1, 3) storage = updating.Storage('taxonomy_filter') searchquery = updating.LineEdit( self, storage, tooltip="String filter for download queries.") self.layout.addWidget(searchquery, 2, 3, 1, 7)
def set_widgets(self, text="Don't ask me again"): ''' Make label above a labelled QCheckbox preventing user from accidentally quitting while running calculations. ''' label = widgets.Label(exception.CODES['007']) self.layout.addWidget(label) self.checkbox = widgets.ClickCheckBox(text, self.ignore, self.update) self.layout.addWidget(self.checkbox)
def __set_replace(self): '''Set replace bar and QLineEdit form''' label = widgets.Label("Replace With:") self.layout.addWidget(label, 12, 0, 6, 2) storage = updating.Storage('replace_form') self.replaceform = updating.LineEdit(self, storage, tooltip="Search query.") self.layout.addWidget(self.replaceform, 12, 2, 6, 4)
def __set_search(self): '''Set search bar and QLineEdit form''' label = widgets.Label("Search For:") self.layout.addWidget(label, 0, 0, 6, 2) storage = updating.Storage('search_form') self.searchform = updating.LineEdit(self, storage, tooltip="Search query.") self.layout.addWidget(self.searchform, 0, 2, 6, 4)
def set_taxon(self): '''Adds a line edit for the taxonomy download''' label = widgets.Label("Taxonomy: ") self.layout.addWidget(label, 0, 0, 1, 3) storage = updating.Storage('taxonomy') taxonomy = updating.LineEdit( self, storage, tooltip="Taxonomy ID for the UniProt KB database query.", validator=QtGui.QIntValidator()) self.layout.addWidget(taxonomy, 0, 3, 1, 7)
def default_label(self): '''Whether to add isotope labels to the crosslinker''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Default Isotope Label") hlayout.addWidget(label) storage = updating.Storage('default_isotopic_label') default = updating.LineEdit(self, storage, tooltip="Default isotope label for the crosslinker (if no " "isotope-labeled modifications exist on the peptide).") hlayout.addWidget(default)
def named_comparative_counts(self): '''Sets the default counts for the named comparative report''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Named Comparative") hlayout.addWidget(label) storage = updating.Storage('counts', self.named_comparative.other) values = ['Unique', 'Redundant'] order = updating.ComboBox(self, values, storage, tooltip="Counts format for the named comparative report.") hlayout.addWidget(order)
def comparative_order(self): '''Sets the default order for the comparative report''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Comparative") hlayout.addWidget(label) storage = updating.Storage('order', self.comparative.other) values = ['File', 'Crosslinker'] order = updating.ComboBox(self, values, storage, tooltip="Hierarchical header order for the comparative report.") hlayout.addWidget(order)
def image(self, regex=r"[0-9a-zA-Z]{2,4}"): '''Sets the default image extension for XL Discoverer''' label = widgets.Label("Image") self.layout.addWidget(label, 3, 0) storage = updating.Storage('image_extension', qt_config.TRANSITIONS) validator = QtGui.QRegExpValidator(QtCore.QRegExp(regex)) image = updating.LineEdit(self, storage, tooltip="Default extension for exported images.", validator=validator, width=75, attr='extension') self.layout.addWidget(image, 3, 1)
def non_specific(self): '''Sets the default non-specific cleavage sites for the experiment''' label = widgets.Label("Non-Specific") self.layout.addWidget(label, 2, 0, 1, 5) values = ['0', 'N', 'C', '1', '2'] storage = updating.Storage('nonspecific_cleavage') nonspecific = updating.ComboBox( self, values, storage, tooltip='Non-specific cleavage sites during proteolytic cleavage') self.layout.addWidget(nonspecific, 2, 5, 1, 5)
def enzyme(self): '''Sets the currently active proteolytic enzyme for peptide cleavage''' label = widgets.Label("Enzyme") self.layout.addWidget(label, 1, 0, 1, 5) values = sorted(proteins.ENZYMES) storage = updating.Storage('current_enzyme') enzyme = updating.ComboBox( self, values, storage, tooltip='Proteolytic enzyme used prior to mass spectrometry') self.layout.addWidget(enzyme, 1, 5, 1, 5)
def document(self, regex=r"[0-9a-zA-Z]{2,4}"): '''Sets the default document extension for XL Discoverer''' label = widgets.Label("Document") self.layout.addWidget(label, 2, 0) storage = updating.Storage('document_extension', qt_config.TRANSITIONS) validator = QtGui.QRegExpValidator(QtCore.QRegExp(regex)) document = updating.LineEdit(self, storage, tooltip="Default extension for the transitions docuyment.", validator=validator, width=75, attr='extension') self.layout.addWidget(document, 2, 1)
def __set_limiteddatabase(self): '''Sets the limited database status for the current proteins object''' layout = self.add_layout(QtGui.QHBoxLayout) self.add_spacer(layout) label = widgets.Label("Limited Database: ") layout.addWidget(label) self.limited = dbwidgets.LimitedDatabaseComboBox(self, self.proteins, tooltip="Select a limited or automatically generated database") layout.addWidget(self.limited) self.add_spacer(layout)
def comparative_integration(self): '''Sets the default inegration mode for the comparative report''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Comparative") hlayout.addWidget(label) storage = updating.Storage('ratio_quantitation') values = ['Area', 'Intensity'] order = updating.ComboBox(self, values, storage, tooltip="Integration ratios for the quantitative " "comparative report.") hlayout.addWidget(order)
def minimum_crosslinker(self): '''Sets the maximum modifications fragments per peptide''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Max Modifications") hlayout.addWidget(label) storage = updating.Storage('maximum_modifications') modifications = updating.SpinBox(self, storage, minimum=0, maximum=10, tooltip="Maximum number of modifications per peptide.", width=75) hlayout.addWidget(modifications)
def sorting(self): '''Sets the sorting key for transitions document''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Sorting") hlayout.addWidget(label) storage = updating.Storage('transition_sortkey') values = ['RT', 'Peptide', 'Score', 'EV', 'Mod Count'] sorting = updating.ComboBox(self, values, storage, tooltip="Default sorting while constructing the " "transitions document.", width=75) hlayout.addWidget(sorting)
def database(self): '''Sets the current spectral engine for the modification selection''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Database") hlayout.addWidget(label) storage = updating.Storage('modification_engine') values = ['Protein Prospector', 'Mascot', 'Proteome Discoverer'] self.engine = updating.ComboBox(self, values, storage, tooltip='Current modification database for modification selection') self.engine.currentIndexChanged.connect(self.reset_database) hlayout.addWidget(self.engine)
def maximum_crosslinkers(self): '''Sets the maximum crosslinker fragments per peptide''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Max Crosslinkers") hlayout.addWidget(label) storage = updating.Storage('maximum_crosslinkers') crosslinkers = updating.SpinBox(self, storage, minimum=0, maximum=10, tooltip="Maximum number of crosslinker fragments per peptide.", width=75) hlayout.addWidget(crosslinkers)
def normalization(self): '''Sets the normalization mode for XIC areas and intensities''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Normalize To") hlayout.addWidget(label) storage = updating.Storage('xic_normalization') values = ["Light", "Medium", "Heavy", "Min", "Max"] normalization = updating.ComboBox(self, values, storage, tooltip="How to normalization XICs areas and intensities " "during ratio reporting.", width=75) hlayout.addWidget(normalization)
def filtering_score(self): '''Sets the minimum scoring threshold for transition exportation''' hlayout = self.add_layout(QtGui.QHBoxLayout) label = widgets.Label("Minimum Peptide Score") hlayout.addWidget(label) storage = updating.Storage('transition_score_threshold') score = updating.DoubleSpinBox(self, storage, minimum=0.1, maximum=100, tooltip="Minimum peptide score for quantified " "crosslink exportation.", width=100) hlayout.addWidget(score)