Commit f2adb015 authored by Yan's avatar Yan
Browse files

timsTOF: logging, speedup

* DRL seems broken (wrong peaks picking)
* checks to be made
parent 09c75608
......@@ -284,9 +284,11 @@ def main():
drl_logger = logging.getLogger('drlLogger')
zce_logger = logging.getLogger('zcelogger')
rxn_logger = logging.getLogger('reactivityLogger')
ds_logger = logging.getLogger('dsLogger')
logging.basicConfig()
# p_logger.setLevel("WARN")
p_logger.setLevel("DEBUG")
ds_logger.setLevel("DEBUG")
rxn_logger.setLevel("DEBUG")
# drl_logger.setLevel("INFO")
drl_logger.setLevel("DEBUG")
......
......@@ -7,13 +7,15 @@ try:
autoparams = True
except ImportError:
autoparams = False
import pathlib
import opentims_bruker_bridge
import numpy as np
import logging
import opentims_bruker_bridge
import os.path
import pathlib
import prasopes.config as cf
import prasopes.datatools as dt
import os.path
logger = logging.getLogger('dsLogger')
class Dataset():
def __init__(self, rawfile):
......@@ -26,6 +28,7 @@ class Dataset():
self.maxtime = np.inf
def get_chromargs(self, mint=None, maxt=None):
logger.info("finding correct scans")
mint = mint or self.mintime
maxt = maxt or self.maxtime
times = dt.argsubselect(np.concatenate(
......@@ -123,6 +126,7 @@ class BrukerTimsDataset(Dataset):
self.refresh()
def refresh(self):
logger.info("refreshing timsTOF dataset")
if(os.path.isdir(self.filename)):
self.dataset = OpenTIMS(pathlib.Path(self.filename))
else:
......@@ -132,6 +136,7 @@ class BrukerTimsDataset(Dataset):
for i in (0,-1)]
def get_chromatograms(self):
logger.info("getting timsTOF chromatogram")
keys = ('retention_time', 'intensity')
times = self.dataset.retention_times / 60
#devNote - summing is fast, asarray is fast, iterating is slow.
......@@ -141,6 +146,7 @@ class BrukerTimsDataset(Dataset):
return [[times,intensities]]
def get_spectra(self, mint=None, maxt=None):
logger.info("getting timsTOF spectra")
mint = mint or self.mintime
maxt = maxt or self.maxtime
#TODO: set in config
......@@ -160,6 +166,7 @@ class BrukerTimsDataset(Dataset):
return [[masses, ints]]
def get_peakchrom(self, startm, endm):
logger.info("getting peak ion chromatogram")
intensity = np.divide([
np.sum(i['intensity'][dt.argsubselect(i['mz'], startm, endm)])
for i in self.dataset.query_iter(
......
......@@ -448,7 +448,7 @@ def populate(augCanvas):
[pints.extend([np.nan, 0, i]) for i in crudeints]
augCanvas.spectplot.plot(pmasses, pints, linewidth=1)
chromxy = augCanvas.ds.get_chromatograms()
chromxy = augCanvas.ds.chromatograms
msxy = augCanvas.ds.get_spectra()
for i in range(len(msxy)):
if len(augCanvas.ds.headers) == len(augCanvas.ds.chromatograms):
......
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