Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhsmit committed Jan 23, 2024
2 parents 79ee198 + 14ef19e commit 4524214
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 27 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

PyHDX is python project which can be used to derive Gibbs free energy from HDX-MS data.

[PyHDX web](http://pyhdx.jhsmit.org)


[PyHDX stable documentation](https://pyhdx.readthedocs.io/en/stable/)
[PyHDX latest documentation](https://pyhdx.readthedocs.io/en/latest/)

[PyHDX on YouTube](https://www.youtube.com/channel/UCTro6Iv1BhvjUPYZNu5TJWg)

Expand Down Expand Up @@ -60,8 +60,6 @@ A test file can be downloaded from [here](https://raw.githubusercontent.com/Jhsm
A beta version might be available at:
http://pyhdx-beta.jhsmit.org

The latest beta docs are found [here](https://pyhdx.readthedocs.io/en/latest/)


## Publication

Expand All @@ -73,7 +71,7 @@ Python code for analysis and generation the figures in the paper are here: https

## Other

HDX MS datasets repository and format (alpha):
HDX MS datasets repository and format:
https://github.com/Jhsmit/HDX-MS-datasets

HDXMS datasets python bindings:
Expand Down
4 changes: 2 additions & 2 deletions pyhdx/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def __init__(self, data: pd.DataFrame, **metadata: Any):
)

@classmethod
def from_dataset(cls, dataset: HDXDataSet, state: str | int, **metadata) -> HDXMeasurement:
def from_dataset(cls, dataset: HDXDataSet, state: str | int, drop_first=cfg.analysis.drop_first, **metadata) -> HDXMeasurement:
"""Create an HDXMeasurement object from a HDXDataSet object.
Args:
Expand Down Expand Up @@ -318,7 +318,7 @@ def from_dataset(cls, dataset: HDXDataSet, state: str | int, **metadata) -> HDXM
peptides = apply_control(peptides, fd_peptides, nd_peptides)
peptides = correct_d_uptake(
peptides,
drop_first=cfg.analysis.drop_first,
drop_first=drop_first,
d_percentage=metadata.get("d_percentage", 100.0),
)

Expand Down
35 changes: 18 additions & 17 deletions pyhdx/web/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,17 @@ class GlobalSettingsControl(ControlPanel):
doc="Select the number of N-terminal residues to ignore.",
)

weight_exponent = param.Number(
default=cfg.analysis.weight_exponent,
bounds=(0, None),
doc="Value of the exponent use for weighted averaging of RFU values",
)
# weight_exponent = param.Number(
# default=cfg.analysis.weight_exponent,
# bounds=(0, None),
# doc="Value of the exponent use for weighted averaging of RFU values",
# )

def make_dict(self):
widgets = self.generate_widgets()
widgets["config_download"] = pn.widgets.FileDownload(
label="Download config file", callback=self.config_download_callback
)
# widgets["config_download"] = pn.widgets.FileDownload(
# label="Download config file", callback=self.config_download_callback
# )

return widgets

Expand All @@ -258,13 +258,13 @@ def config_download_callback(self) -> StringIO:

return sio

@param.depends("drop_first", watch=True)
def _update_drop_first(self):
cfg.analysis.drop_first = self.drop_first
# @param.depends("drop_first", watch=True)
# def _update_drop_first(self):
# cfg.analysis.drop_first = self.drop_first

@param.depends("weight_exponent", watch=True)
def _update_weight_exponent(self):
cfg.analysis.weight_exponent = self.weight_exponent
# @param.depends("weight_exponent", watch=True)
# def _update_weight_exponent(self):
# cfg.analysis.weight_exponent = self.weight_exponent


class PeptideFileInputControl(PyHDXControlPanel):
Expand Down Expand Up @@ -857,13 +857,14 @@ def _action_load_datasets(self) -> None:
self.widgets["load_dataset_button"].disabled = True
try:
config_ctrl = self.parent.control_panels["GlobalSettingsControl"]
drop_first = config_ctrl.drop_first
config_ctrl.widgets["drop_first"].disabled = True
config_ctrl.widgets["weight_exponent"].disabled = True
# config_ctrl.widgets["weight_exponent"].disabled = True
except KeyError:
pass
drop_first = 2

for state in dataset.states:
hdxm = HDXMeasurement.from_dataset(dataset, state)
hdxm = HDXMeasurement.from_dataset(dataset, state, drop_first=drop_first)
self.src.add(hdxm, state)
self.parent.logger.info(
f"Loaded experiment peptides state {hdxm.state} "
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-macOS-latest-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ importlib-metadata==6.8.0
# via
# dask
# markdown
jinja2==3.1.2
jinja2==3.1.3
# via
# bokeh
# distributed
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-ubuntu-latest-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ importlib-metadata==6.8.0
# via
# dask
# markdown
jinja2==3.1.2
jinja2==3.1.3
# via
# bokeh
# distributed
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-windows-latest-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ importlib-metadata==6.8.0
# via
# dask
# markdown
jinja2==3.1.2
jinja2==3.1.3
# via
# bokeh
# distributed
Expand Down

0 comments on commit 4524214

Please sign in to comment.