Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge im2deep into timsrescore branch #121

Merged
merged 47 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b45007f
im2deep
rodvrees Jan 9, 2024
0330096
Merge remote-tracking branch 'origin/timsRescore' into timsRescore
rodvrees Jan 10, 2024
f6c9564
models + debug
rodvrees Jan 10, 2024
7585d51
fix
rodvrees Jan 10, 2024
a0f792f
add models
rodvrees Jan 10, 2024
b4660fd
fixes in im2deep.py
rodvrees Jan 11, 2024
1a18a42
fixes in im2deep.py
rodvrees Jan 11, 2024
b93df98
im2deep implementation
rodvrees Jan 11, 2024
782c7a0
CCS shift calculation fix
rodvrees Jan 12, 2024
7604153
models + plot
rodvrees Jan 12, 2024
aa9cde0
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Jan 16, 2024
6ccb429
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Jan 17, 2024
00d6704
add unused argument
ArthurDeclercq Jan 17, 2024
2645378
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Jan 17, 2024
a99b492
IM2Deep plot correct labels
rodvrees Jan 22, 2024
1f6e973
calibrate per charge option
rodvrees Jan 26, 2024
301d632
Merge branch 'timsRescore' of github.com:rodvrees/ms2rescore into tim…
rodvrees Jan 26, 2024
dd8bd18
new models and reference
rodvrees Jan 29, 2024
ad0f3d7
correct format reference
rodvrees Jan 29, 2024
3a5b1ab
fix model name in IM2Deep
rodvrees Jan 29, 2024
3b4899a
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Jan 31, 2024
fd09f88
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Jan 31, 2024
012e9d0
change use of reference dataset
ArthurDeclercq Jan 31, 2024
d07c3b6
Merge branch 'timsRescore' of https://github.com/rodvrees/ms2rescore …
ArthurDeclercq Jan 31, 2024
13155e6
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Jan 31, 2024
aea9d9f
IM2Deep calibrate correctly
rodvrees Jan 31, 2024
52d0761
Merge branch 'timsRescore' of github.com:rodvrees/ms2rescore into tim…
rodvrees Jan 31, 2024
167deb7
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Jan 31, 2024
337d81a
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Jan 31, 2024
ff34fc2
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Feb 1, 2024
f5ec8e5
Merge branch 'compomics:timsRescore' into timsRescore
ArthurDeclercq Feb 1, 2024
65f134c
Implement IM2Deep package
rodvrees Feb 2, 2024
e1f0ddf
Merge branch 'timsRescore' of github.com:rodvrees/ms2rescore into tim…
rodvrees Feb 2, 2024
a9fc45f
GUI changes im2deep
ArthurDeclercq Feb 5, 2024
fa97517
add im2deep to pyproject
ArthurDeclercq Feb 5, 2024
a4fd01a
change dockerfile
ArthurDeclercq Feb 5, 2024
721cd08
optimise spectrum parsing
ArthurDeclercq Feb 5, 2024
ceed348
update toml file
ArthurDeclercq Feb 6, 2024
fcd393c
added debug logging
ArthurDeclercq Feb 6, 2024
3fc994f
requested changes
ArthurDeclercq Feb 15, 2024
42debd8
change numpy version upper limit
ArthurDeclercq Feb 15, 2024
c0713ed
fix bug
ArthurDeclercq Feb 15, 2024
fcf579d
Use newer setup-python action; revert numpy upper limit
RalfG Feb 15, 2024
48fae0e
Fix numpy version for py311
RalfG Feb 17, 2024
9063a84
Update pyproject.toml
RalfG Feb 18, 2024
7ede2f8
requested changes
ArthurDeclercq Feb 20, 2024
b2a126a
Update ms2rescore/feature_generators/im2deep.py
RalfG Feb 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source/config_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
- **One of**
- *string*
- *null*
- **`psm_id_rt_pattern`**: Regex pattern to extract index or scan number from spectrum file. Requires at least one capturing group. Default: `null`.
- **`psm_id_rt_pattern`**: Regex pattern to extract retention time from psm identifier. Requires at least one capturing group. Default: `null`.
- **One of**
- *string*
- *null*
- **`psm_id_im_pattern`**: Regex pattern to extract index or scan number from spectrum file. Requires at least one capturing group. Default: `null`.
- **`psm_id_im_pattern`**: Regex pattern to extract ion mobility from psm identifier. Requires at least one capturing group. Default: `null`.
- **One of**
- *string*
- *null*
Expand Down
44 changes: 29 additions & 15 deletions ms2rescore/feature_generators/im2deep.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
"""
Placeholder
IM2Deep ion mobility-based feature generator.

IM2Deep is a fully modification-aware peptide ion mobility predictor. It uses a deep convolutional
neural network to predict retention times based on the atomic composition of the (modified) amino
acid residues in the peptide. See
`github.com/compomics/deeplc <https://github.com/compomics/IM2Deep>`_ for more information.
RalfG marked this conversation as resolved.
Show resolved Hide resolved
RalfG marked this conversation as resolved.
Show resolved Hide resolved

"""

import contextlib
Expand Down Expand Up @@ -34,20 +40,22 @@ def __init__(
"""
Initialize the IM2DeepFeatureGenerator.

Parameters:
- `lower_score_is_better`: A boolean indicating whether lower scores are better for the generated features.
- `spectrum_path`: Optional path to the spectrum file used for IM2Deep predictions.
- `processes`: Number of parallel processes to use for IM2Deep predictions.
- `calibrate_per_charge`: A boolean indicating whether to calibrate CCS values per charge state.
- `**kwargs`: Additional keyword arguments.
Parameters
----------
lower_score_is_better : bool, optional
A boolean indicating whether lower scores are better for the generated features.
spectrum_path : str or None, optional
Optional path to the spectrum file used for IM2Deep predictions.
processes : int, optional
Number of parallel processes to use for IM2Deep predictions.
calibrate_per_charge : bool, optional
A boolean indicating whether to calibrate CCS values per charge state.
**kwargs : dict, optional
Additional keyword arguments.

Returns:
Returns
-------
None

Note:
The IM2DeepFeatureGenerator requires initialization with relevant parameters. It inherits from FeatureGeneratorBase.

```
"""
super().__init__(*args, **kwargs)
self.lower_score_is_better = lower_score_is_better
Expand Down Expand Up @@ -161,7 +169,7 @@ def add_features(self, psm_list: PSMList) -> None:

def im2ccs(self, reverse_im, mz, charge, mass_gas=28.013, temp=31.85, t_diff=273.15):
"""
Convert ion mobility to CCS. #TODO: Took this from ionmob. how to reference?
Convert ion mobility to CCS.

Parameters
----------
Expand All @@ -176,7 +184,13 @@ def im2ccs(self, reverse_im, mz, charge, mass_gas=28.013, temp=31.85, t_diff=273
temp : float, optional
Temperature in Celsius, by default 31.85
t_diff : float, optional
Factor to convert Celsius to Kelvin, by default 273.15"""
Factor to convert Celsius to Kelvin, by default 273.15

Notes
-----
Adapted from theGreatHerrLebert/ionmob (https://doi.org/10.1093/bioinformatics/btad486)

"""

SUMMARY_CONSTANT = 18509.8632163405
reduced_mass = (mz * charge * mass_gas) / (mz * charge + mass_gas)
Expand Down
Loading