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
Hi Feng, I observed the following bug when using AB to create multiplexed DIA libraries. It's technically not a bug but more of a incompatible behavior between functions which might confuse users. Let me know what you think, I'm happy to make a PR.
Describe the bug
When calling calc_precursor_mz on a spectral library, clip_by_precursor_mz_ is always invoked, which messes up the precursor fragment mapping.
To Reproduce
Create a library with a preecursor just below the upper mz limit:
recalculate the fragment masses: spec_lib.calc_fragment_mz_df()
File "/Users/georgwallmann/miniconda3/envs/alpha/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3378, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "/var/folders/lc/9594t94d5b5_gn0y04w1jh980000gn/T/ipykernel_6587/3999293303.py", line 1, in <module>
spec_lib.calc_fragment_mz_df()
File "/Users/georgwallmann/Documents/git/alphabase/alphabase/spectral_library/base.py", line 361, in calc_fragment_mz_df
)
File "/Users/georgwallmann/Documents/git/alphabase/alphabase/peptide/fragment.py", line 818, in create_fragment_mz_dataframe
File "/Users/georgwallmann/Documents/git/alphabase/alphabase/peptide/fragment.py", line 876, in create_fragment_mz_dataframe
'''
File "/Users/georgwallmann/Documents/git/alphabase/alphabase/peptide/fragment.py", line 435, in mask_fragments_for_charge_greater_than_precursor_charge
elif frag_type == 'y':
File "/Users/georgwallmann/miniconda3/envs/alpha/lib/python3.9/site-packages/pandas/core/indexing.py", line 815, in __setitem__
indexer = self._get_setitem_indexer(key)
File "/Users/georgwallmann/miniconda3/envs/alpha/lib/python3.9/site-packages/pandas/core/indexing.py", line 698, in _get_setitem_indexer
return self._convert_tuple(key)
File "/Users/georgwallmann/miniconda3/envs/alpha/lib/python3.9/site-packages/pandas/core/indexing.py", line 897, in _convert_tuple
keyidx = [self._convert_to_indexer(k, axis=i) for i, k in enumerate(key)]
File "/Users/georgwallmann/miniconda3/envs/alpha/lib/python3.9/site-packages/pandas/core/indexing.py", line 897, in <listcomp>
keyidx = [self._convert_to_indexer(k, axis=i) for i, k in enumerate(key)]
File "/Users/georgwallmann/miniconda3/envs/alpha/lib/python3.9/site-packages/pandas/core/indexing.py", line 1394, in _convert_to_indexer
key = check_bool_indexer(labels, key)
File "/Users/georgwallmann/miniconda3/envs/alpha/lib/python3.9/site-packages/pandas/core/indexing.py", line 2567, in check_bool_indexer
return check_array_indexer(index, result)
File "/Users/georgwallmann/miniconda3/envs/alpha/lib/python3.9/site-packages/pandas/core/indexers/utils.py", line 553, in check_array_indexer
raise IndexError(
IndexError: Boolean index has wrong length: 43 instead of 75
Expected behavior calc_fragment_mz_df requires a continous frag_start_idx, frag_stop_idx, which is not compatible with the way clip_by_precursor_mz_ works. It is also not immediatley clear thatclip_by_precursor_mz_ has been called and precursors were removed.
Possible Solutions
don't call clip_by_precursor_mz_ by default within calc_precursor_mz
issue a warning: n precursors were remove because they were outside the mz limits
call spec_lib.remove_unused_fragments() right after clip_by_precursor_mz_
The text was updated successfully, but these errors were encountered:
Hi Feng, I observed the following bug when using AB to create multiplexed DIA libraries. It's technically not a bug but more of a incompatible behavior between functions which might confuse users. Let me know what you think, I'm happy to make a PR.
Describe the bug
When calling
calc_precursor_mz
on a spectral library,clip_by_precursor_mz_
is always invoked, which messes up the precursor fragment mapping.To Reproduce
spec_lib.calc_fragment_mz_df()
Expected behavior
calc_fragment_mz_df
requires a continousfrag_start_idx, frag_stop_idx
, which is not compatible with the wayclip_by_precursor_mz_
works. It is also not immediatley clear thatclip_by_precursor_mz_
has been called and precursors were removed.Possible Solutions
clip_by_precursor_mz_
by default withincalc_precursor_mz
n precursors were remove because they were outside the mz limits
spec_lib.remove_unused_fragments()
right afterclip_by_precursor_mz_
The text was updated successfully, but these errors were encountered: