Skip to content

Commit

Permalink
Merge pull request #36 from MannLabs/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
jalew188 authored Dec 19, 2023
2 parents 820ce5d + 70cdeb1 commit 660cca2
Show file tree
Hide file tree
Showing 26 changed files with 407,950 additions and 76 deletions.
30 changes: 30 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[bumpversion]
current_version = 1.2.0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}
{major}.{minor}.{patch}

[bumpversion:part:release]

[bumpversion:part:build]

[bumpversion:file:./alphaviz/__init__.py]

[bumpversion:file:./release/one_click_linux_gui/control]

[bumpversion:file:./release/one_click_linux_gui/create_installer_linux.sh]

[bumpversion:file:./release/one_click_macos_gui/distribution.xml]

[bumpversion:file:./release/one_click_macos_gui/Info.plist]

[bumpversion:file:./release/one_click_macos_gui/create_installer_macos.sh]

[bumpversion:file:./release/one_click_windows_gui/create_installer_windows.sh]

[bumpversion:file:./release/one_click_windows_gui/alphaviz_innoinstaller.iss]
search = {current_version}
replace = {new_version}
2 changes: 1 addition & 1 deletion alphaviz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!python

__project__ = "alphaviz"
__version__ = "1.1.15"
__version__ = "1.2.0"
__license__ = "Apache"
__description__ = "A interactive Dashboard to explore mass spectrometry data."
__author__ = "Eugenia Voytik"
Expand Down
17 changes: 8 additions & 9 deletions alphaviz/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,9 @@ def load_data(self, *args):
self.psm_df['instrument'] = 'timsTOF'
# trained on more Lumos files therefore should work better
# than 'timsTOF'
self.psm_df['spec_idx'] += 1
self.model_mgr.psm_num_to_tune_rt_ccs = 500
self.model_mgr.fine_tune_rt_model(self.psm_df)
# self.model_mgr.fine_tune_ccs_model(self.psm_df)
self.model_mgr.psm_num_to_train_rt_ccs = 500
self.model_mgr.train_rt_model(self.psm_df)
# self.model_mgr.train_ccs_model(self.psm_df)

self.trigger_dependancy()
self.upload_progress.active = False
Expand Down Expand Up @@ -2036,7 +2035,7 @@ def __init__(self, data, options):
value=pd.DataFrame(
columns=['sequence', 'mods', 'mod_sites', 'charge']
),
hidden_columns=['frag_end_idx', 'frag_start_idx'],
hidden_columns=['frag_stop_idx', 'frag_start_idx'],
widths={'index': 70},
sizing_mode='stretch_width',
layout='fit_data_table',
Expand Down Expand Up @@ -2382,7 +2381,7 @@ def run_prediction(self, *args):
print(f'cannot convert the column {col}')
df.mod_sites = df.mod_sites.astype('str')
df.mod_sites.replace('0', '', inplace=True)
df['nce'] = 30
df['nce'] = 30.0
df['instrument'] = 'Lumos'
self.predicted_dict = self.data.model_mgr.predict_all(
df,
Expand All @@ -2408,11 +2407,11 @@ def visualize_elution_plots_prediction(self, *args):
self.targeted_peptides_table_pred.value.loc[
self.targeted_peptides_table_pred.selection[0],
['sequence', 'charge', 'precursor_mz',
'rt_pred', 'mobility_pred', 'frag_start_idx', 'frag_end_idx']
'rt_pred', 'mobility_pred', 'frag_start_idx', 'frag_stop_idx']
].to_dict()
index_range = range(
self.peptide_prediction['frag_start_idx'],
self.peptide_prediction['frag_end_idx']
self.peptide_prediction['frag_stop_idx']
)
self.peptide_prediction['mz'] = \
self.peptide_prediction.pop('precursor_mz')
Expand Down Expand Up @@ -2476,7 +2475,7 @@ def visualize_elution_plots_prediction(self, *args):
align='center',
margin=(0, 10, 10, 10)
)
except AttibuteError:
except AttributeError:
self.layout_target_mode_predicted[2] = None
self.layout_target_mode_predicted[3] = self.export_svg_prediction_button
self.targeted_peptides_table_pred.loading = False
Expand Down
34 changes: 21 additions & 13 deletions alphaviz/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ def plot_elution_profile_heatmap(
)
try:
return common_plot.cols(n_cols)
except AttibuteError:
except AttributeError:
return common_plot


Expand Down Expand Up @@ -1304,6 +1304,11 @@ def plot_elution_profile(
title: str = "",
# width: int = 900,
height: int = 400,
hovermode:str = 'x unified',
theme_template:str = 'plotly_white',
include_precursor:bool = True,
include_ms1:bool = True,
row:int=None, col:int=None,
):
"""Plot an elution profile plot for the specified precursor and all
his identified fragments.
Expand Down Expand Up @@ -1373,16 +1378,18 @@ def plot_elution_profile(
'raw'
]
fig = go.Figure()
fig.add_trace(
plot_elution_line(
raw_data,
precursor_indices,
remove_zeros=True,
# label=f"precursor ({round(peptide_info['mz'], 3)})",
label='precursor',
marker_color=dict(color=colors_set[0])
if include_precursor:
fig.add_trace(
plot_elution_line(
raw_data,
precursor_indices,
remove_zeros=True,
# label=f"precursor ({round(peptide_info['mz'], 3)})",
label='precursor',
marker_color=dict(color=colors_set[0])
),
row=row, col=col
)
)
# create elution profiles for all fragments
for ind, (frag, frag_mz) in enumerate(peptide_info['fragments'].items()):
fragment_data_indices = raw_data[
Expand All @@ -1400,7 +1407,8 @@ def plot_elution_profile(
remove_zeros=True,
label=f"{frag} ({round(frag_mz, 3)})",
marker_color=dict(color=colors_set[ind+1])
)
),
row=row, col=col
)

fig.update_layout(
Expand Down Expand Up @@ -1434,10 +1442,10 @@ def plot_elution_profile(
color='black'
),
),
template='plotly_white',
template=theme_template,
# width=width,
height=height,
hovermode='x unified',
hovermode=hovermode,
showlegend=True
)
return fig
Expand Down
Loading

0 comments on commit 660cca2

Please sign in to comment.