You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This could be resolved with a try/except TypeError or with another if conditional checking the spectrum["precursorList"]["precursor"][0]["selectedIonList"]["selectedIon"][0]["charge state"] is not None.
Traceback (most recent call last): File "/home/user/miniforge3/envs/dev/bin/massql", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/user/miniforge3/envs/dev/lib/python3.11/site-packages/massql/msql_cmd.py", line 58, in main results_df = msql_engine.process_query(query, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/miniforge3/envs/dev/lib/python3.11/site-packages/massql/msql_engine.py", line 64, in process_query return _evalute_variable_query(parsed_dict, input_filename, cache=cache, parallel=parallel, ms1_df=ms1_df, ms2_df=ms2_df) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/miniforge3/envs/dev/lib/python3.11/site-packages/massql/msql_engine.py", line 157, in _evalute_variable_query ms1_df, ms2_df = msql_fileloading.load_data(input_filename, cache=cache) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/miniforge3/envs/dev/lib/python3.11/site-packages/massql/msql_fileloading.py", line 45, in load_data ms1_df, ms2_df = _load_data_mzML_pyteomics(input_filename) # Faster version using pymzML ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/miniforge3/envs/dev/lib/python3.11/site-packages/massql/msql_fileloading.py", line 374, in _load_data_mzML_pyteomics msn_charge = int(spectrum["precursorList"]["precursor"][0]["selectedIonList"]["selectedIon"][0]["charge state"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Checking the dict with a breakpoint() using try:/except TypeError: breakpoint()
The text was updated successfully, but these errors were encountered:
ometa-evan
changed the title
[bug] TypeError when selectedIon "charge state" is None during integer coercion
[bug] TypeError when "selectedIon" "charge state" is None during integer coercion
Jul 31, 2024
A
TypeError
is raised if"charge state"
is present in the selected ion dictionary, but has a value ofNone
MassQueryLanguage/massql/msql_fileloading.py
Lines 437 to 438 in dc23b1f
This could be resolved with a
try
/except TypeError
or with anotherif
conditional checking thespectrum["precursorList"]["precursor"][0]["selectedIonList"]["selectedIon"][0]["charge state"]
is notNone
.Checking the
dict
with abreakpoint()
usingtry:
/except TypeError: breakpoint()
The text was updated successfully, but these errors were encountered: