How to use the pyteomics.auxiliary.unitfloat function in pyteomics

To help you get started, we’ve selected a few pyteomics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mobiusklein / ms_deisotope / ms_deisotope / data_source / _thermo_helper.py View on Github external
if word == 'P':
                values['peak_mode'] = 'profile'
            else:
                values['peak_mode'] = 'centroid'
            word = words[i]
            i += 1

        ionization_info = ionization_pat.search(word)
        if ionization_info is not None:
            values['ionization'] = ionization_info.group(0)
            word = words[i]
            i += 1

        cv_info = compensation_voltage_pat.search(word)
        if cv_info is not None:
            values['compensation_voltage'] = unitfloat(cv_info.group(1), None)
            word = words[i]
            i += 1

        return values
    except IndexError:
        return values
github mobiusklein / ms_deisotope / ms_deisotope / data_source / thermo_raw.py View on Github external
def _acquisition_information(self, scan):
        fline = self._filter_string(scan)
        event = self._get_scan_event(scan)
        trailer_extras = self._trailer_values(scan)
        traits = {
            'preset scan configuration': event,
            'filter string': fline,
        }
        cv = fline.get("compensation_voltage")
        if cv is not None:
            traits[FAIMS_compensation_voltage] = cv
        event = ScanEventInformation(
            self._scan_time(scan),
            injection_time=unitfloat(trailer_extras.get(
                'Ion Injection Time (ms)', 0.0), 'millisecond'),
            window_list=[ScanWindow(
                fline.get("scan_window")[0], fline.get("scan_window")[1])],
            traits=traits)
        return ScanAcquisitionInformation("no combination", [event])
github mobiusklein / ms_deisotope / ms_deisotope / data_source / mzml.py View on Github external
combination = "no combination"
        elif "sum of spectra" in scan_list_struct:
            combination = "sum of spectra"
        elif "median of spectra" in scan_list_struct:
            combination = "median of spectra"
        elif "mean of spectra" in scan_list_struct:
            combination = "mean of spectra"
        scan_info['combination'] = combination
        scan_info_scan_list = []
        misplaced_FAIMS_value = scan.get(FAIMS_compensation_voltage.name, None)
        for i, scan_ in enumerate(scan_list_struct.get("scan", [])):
            scan_ = scan_.copy()
            if misplaced_FAIMS_value is not None and i == 0:
                scan[FAIMS_compensation_voltage.name] = misplaced_FAIMS_value
            struct = {}
            struct['start_time'] = scan_.pop('scan start time', unitfloat(0, 'minute'))
            struct['injection_time'] = scan_.pop("ion injection time", unitfloat(0, 'millisecond'))
            windows = []
            for window in scan_.pop("scanWindowList", {}).get("scanWindow", []):
                windows.append(ScanWindow(
                    window['scan window lower limit'],
                    window['scan window upper limit']))
            struct['window_list'] = windows
            scan_.pop("instrumentConfigurationRef", None)
            struct['traits'] = scan_
            scan_info_scan_list.append(ScanEventInformation(**struct))
        scan_info['scan_list'] = scan_info_scan_list
        return ScanAcquisitionInformation(**scan_info)
github mobiusklein / ms_deisotope / ms_deisotope / data_source / mzml.py View on Github external
elif "sum of spectra" in scan_list_struct:
            combination = "sum of spectra"
        elif "median of spectra" in scan_list_struct:
            combination = "median of spectra"
        elif "mean of spectra" in scan_list_struct:
            combination = "mean of spectra"
        scan_info['combination'] = combination
        scan_info_scan_list = []
        misplaced_FAIMS_value = scan.get(FAIMS_compensation_voltage.name, None)
        for i, scan_ in enumerate(scan_list_struct.get("scan", [])):
            scan_ = scan_.copy()
            if misplaced_FAIMS_value is not None and i == 0:
                scan[FAIMS_compensation_voltage.name] = misplaced_FAIMS_value
            struct = {}
            struct['start_time'] = scan_.pop('scan start time', unitfloat(0, 'minute'))
            struct['injection_time'] = scan_.pop("ion injection time", unitfloat(0, 'millisecond'))
            windows = []
            for window in scan_.pop("scanWindowList", {}).get("scanWindow", []):
                windows.append(ScanWindow(
                    window['scan window lower limit'],
                    window['scan window upper limit']))
            struct['window_list'] = windows
            scan_.pop("instrumentConfigurationRef", None)
            struct['traits'] = scan_
            scan_info_scan_list.append(ScanEventInformation(**struct))
        scan_info['scan_list'] = scan_info_scan_list
        return ScanAcquisitionInformation(**scan_info)
github mobiusklein / ms_deisotope / ms_deisotope / data_source / thermo_raw_net.py View on Github external
def _acquisition_information(self, scan):
        fline = self._filter_string(scan)
        event = self._get_scan_event(scan)
        trailer_extras = self._trailer_values(scan)
        traits = {
            'preset scan configuration': event,
            'filter string': fline,
        }
        cv = fline.get("compensation_voltage")
        if cv is not None:
            traits[FAIMS_compensation_voltage] = cv
        event = ScanEventInformation(
            self._scan_time(scan),
            injection_time=unitfloat(trailer_extras.get('Ion Injection Time (ms)', 0.0), 'millisecond'),
            window_list=[ScanWindow(
                fline.get("scan_window")[0], fline.get("scan_window")[1])], traits=traits)
        return ScanAcquisitionInformation("no combination", [event])