Commit 7d370789 authored by Yan's avatar Yan
Browse files

TimsTof - chromatogram - user selection

* user can select between precise and fast chromatogram routines.
parent 699288f5
......@@ -14,7 +14,7 @@ from . import zcetools_help
from . import reactivitytools
__version__ = "0.0.47"
__version__ = "0.0.48"
__all__ = ['config', 'datatools', 'docks', 'drltools', 'datasets',
......
......@@ -45,6 +45,7 @@ def settings():
("timstof/ms_sampling", 500),
("timstof/ms_bins", 0.001),
("timstof/mob_sampling", 5000),
("timstof/fastchrom", True),
("timstof/mob_bins", 0.0001)}
[settings.setValue(*i)
for i in defvals if not settings.contains(i[0])]
......@@ -154,6 +155,9 @@ def dial(parent):
config))
timstoflayout.addLayout(posvarconf(
"Bins - mobility", "timstof/mob_bins", config, "nonint"))
timstoflayout.addWidget(checkboxconf(
"Fast chromatogram (slightly less precise, much faster)",
"timstof/fastchrom", config))
tabs.addTab(timstoftab, "TimsTOF")
viewtab = QtWidgets.QWidget()
......
......@@ -157,9 +157,16 @@ class BrukerTimsDataset(Dataset):
def get_chromatograms(self):
logger.info("getting timsTOF chromatogram")
times = self.dataset.retention_times / 60
# Thx to Michał Startek, slight deviation, but much faster
intensities = (self.dataset.frames['SummedIntensities'] *
self.dataset.frames['AccumulationTime']) / 100.0
if cf.settings().value("timstof/fastchrom", type=bool):
# Thx to Michał Startek, slight deviation, but much faster
intensities = (self.dataset.frames['SummedIntensities'] *
self.dataset.frames['AccumulationTime']) / 100.0
else:
# devNote - summing is fast, asarray is fast, iterating is slow.
intensities = np.asarray([
np.sum(i['intensity']) for i in self.dataset.query_iter(
self.dataset.ms1_frames, columns=('intensity',))])
logger.info("DONE: getting timsTOF chromatogram")
return [[times, intensities]]
def get_spectra(self, mint=None, maxt=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment