-
Notifications
You must be signed in to change notification settings - Fork 9
Description
I am able to read the data with TimsPyDF class
DIA_published_dir = <path with .d file >
data_published = TimsPyDF( DIA_published_dir)
But when I try reading it through TimsDIA class, I am getting below error. Following is the code used:
dia_data_pub = TimsDIA(DIA_published_dir)
KeyError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
2888 try:
-> 2889 return self._engine.get_loc(casted_key)
2890 except KeyError as err:
pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
KeyError: -1
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
in
1 DIA_published_dir = r'\VBOXSVR\UoH_DS\Summer 2020\Spectrometry lab internship\Project 2\Project2-RawData\DIAdata\20190710_HeLa_200ng_90min_diaPASEF_FastCE_py3_Slot1-1_1_46.d'
----> 2 dia_data_pub = TimsDIA(DIA_published_dir)
~\Anaconda3\lib\site-packages\timspy\timspy.py in init(self, analysis_directory, use_recalibrated_state)
672 W['left'] = np.searchsorted(self.grid, W.mz_left)
673 W['right'] = np.searchsorted(self.grid, W.mz_right)+1
--> 674 W['prev_left'] = [ W.left[-1] ]*2 + list(W.left[1:-1])
675 W['prev_right'] = [ W.right[-1] ]*2 + list(W.right[1:-1])
676 IM_windows = W[['scan_min','scan_max']].apply(lambda x: self.scanNumToOneOverK0(1,x))
~\Anaconda3\lib\site-packages\pandas\core\series.py in getitem(self, key)
880
881 elif key_is_scalar:
--> 882 return self._get_value(key)
883
884 if (
~\Anaconda3\lib\site-packages\pandas\core\series.py in _get_value(self, label, takeable)
989
990 # Similar to Index.get_value, but we do not fall back to positional
--> 991 loc = self.index.get_loc(label)
992 return self.index._get_values_for_loc(self, loc, label)
993
~\Anaconda3\lib\site-packages\pandas\core\indexes\multi.py in get_loc(self, key, method)
2698 if not isinstance(key, (tuple, list)):
2699 # not including list here breaks some indexing, xref #30892
-> 2700 loc = self._get_level_indexer(key, level=0)
2701 return _maybe_to_slice(loc)
2702
~\Anaconda3\lib\site-packages\pandas\core\indexes\multi.py in _get_level_indexer(self, key, level, indexer)
2963 else:
2964
-> 2965 code = self._get_loc_single_level_index(level_index, key)
2966
2967 if level > 0 or self.lexsort_depth == 0:
~\Anaconda3\lib\site-packages\pandas\core\indexes\multi.py in _get_loc_single_level_index(self, level_index, key)
2632 return -1
2633 else:
-> 2634 return level_index.get_loc(key)
2635
2636 def get_loc(self, key, method=None):
~\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
2889 return self._engine.get_loc(casted_key)
2890 except KeyError as err:
-> 2891 raise KeyError(key) from err
2892
2893 if tolerance is not None:
KeyError: -1