Skip to content

Commit d5f4d42

Browse files
committed
ruff auto fix
1 parent 7f4c4f9 commit d5f4d42

File tree

8 files changed

+24
-16
lines changed

8 files changed

+24
-16
lines changed

pyhdx/fileIO.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
import narwhals as nw
2626
import pyhdx
27-
from pyhdx.datasets import adapt_for_pyhdx
2827

2928
if TYPE_CHECKING:
3029
from pyhdx.fitting_torch import TorchFitResult, TorchFitResultSet

pyhdx/models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from pyhdx.alignment import align_dataframes
2222
from pyhdx.config import cfg
2323
from pyhdx.fileIO import dataframe_to_file
24-
from pyhdx.process import apply_control, correct_d_uptake, parse_temperature, verify_sequence
24+
from pyhdx.process import correct_d_uptake, parse_temperature, verify_sequence
2525
from pyhdx.support import dataframe_intersection, reduce_inter
2626
from pyhdx.datasets import (
2727
adapt_for_pyhdx,
@@ -31,7 +31,6 @@
3131
peptides_kwargs,
3232
)
3333
from hdxms_datasets.process import merge_peptide_tables, compute_uptake_metrics
34-
from hdxms_datasets.utils import get_peptides_by_type
3534

3635

3736
class Coverage:

pyhdx/web/controller_only.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
# %autoreload 2
44

55
# %%
6-
from pyhdx.web.apps import main_app
76
from pyhdx.web.controllers import PeptideFileInputControl
8-
from pyhdx.web.main_controllers import MainController, PyHDXController
9-
import panel as pn
7+
from pyhdx.web.main_controllers import PyHDXController
108
import logging
119
import sys
1210

pyhdx/web/controllers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from dataclasses import dataclass
99
from io import BytesIO, StringIO
1010
from pathlib import Path
11-
from typing import Any
1211

1312
import colorcet
1413
import matplotlib
@@ -20,7 +19,7 @@
2019
import panel as pn
2120
import param
2221
from distributed import Client
23-
from hdxms_datasets import HDXDataSet, apply_filters, compute_uptake_metrics, load_dataset
22+
from hdxms_datasets import apply_filters, compute_uptake_metrics, load_dataset
2423
from hdxms_datasets.database import DataBase
2524
from hdxms_datasets.process import merge_peptide_tables
2625
from hdxms_datasets.convert import cast_exposure

templates/02_load_from_dataset.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from hdxms_datasets import load_dataset
88

9+
from pyhdx.fitting import fit_d_uptake
910
from pyhdx.models import HDXMeasurement, HDXMeasurementSet
1011

1112
# %%
@@ -20,17 +21,30 @@
2021
dataset.states
2122

2223

23-
zip_pth = Path(r"C:\Users\jhsmi\repos\mine\hdxms-datasets\tests\datasets\HDX_3BAE2080.zip")
24-
dataset = load_dataset(zip_pth)
25-
dataset
24+
# %%
25+
26+
# zip_pth = Path(r"C:\Users\jhsmi\repos\mine\hdxms-datasets\tests\datasets\HDX_3BAE2080.zip")
27+
# dataset = load_dataset(zip_pth)
28+
# dataset
2629

2730
# %%
2831
# Load an HDX measurement by state name
2932
hdxm = HDXMeasurement.from_dataset(dataset.get_state(0))
33+
hdxm = HDXMeasurement.from_dataset(dataset.get_state("Tetramer"), d_percentage=100.0, drop_first=1)
3034
print(hdxm)
3135
print(hdxm.timepoints)
3236

3337

38+
# %%
39+
40+
fr = fit_d_uptake(hdxm, r1=0.5, repeats=3, verbose=False)
41+
fr.output
42+
43+
# %%
44+
from pyhdx.fileIO import dataframe_to_file
45+
46+
dataframe_to_file(output_dir / "hdxm_data.csv", fr.output)
47+
3448
# %%
3549
# Load an HDX measurement set from all states in the dataset
3650
hdxm_set = HDXMeasurementSet.from_dataset(dataset.states)

tests/generate_test_fit_results.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
fit_d_uptake,
2222
)
2323
from pyhdx.models import HDXMeasurementSet
24-
from pyhdx.process import apply_control, correct_d_uptake, filter_peptides
24+
from pyhdx.process import apply_control, correct_d_uptake
25+
from pyhdx.legacy import filter_peptides
2526

2627
"""Run this file to renew the fit results which is used to test against"""
2728

@@ -81,8 +82,8 @@
8182
guess_output = csv_to_dataframe(output_dir / "ecSecB_guess.csv")
8283

8384
# Export protein sequence and intrinsic rate of exchange
84-
hdxm_apo.coverage.protein.to_file(output_dir / "ecSecB_info.csv")
85-
hdxm_apo.coverage.protein.to_file(output_dir / "ecSecB_info.txt", fmt="pprint")
85+
dataframe_to_file(output_dir / "ecSecB_info.csv", hdxm_apo.coverage.protein)
86+
dataframe_to_file(output_dir / "ecSecB_info.txt", hdxm_apo.coverage.protein, fmt="pprint")
8687

8788
# Save RFU values
8889
rfu_df = hdxm_apo.rfu_residues

tests/test_fileIO.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
from pyhdx.models import HDXMeasurement, HDXMeasurementSet
1818
from pyhdx.fitting import fit_gibbs_global
19-
from hdxms_datasets.formats import identify_format
2019
from pyhdx.process import apply_control, correct_d_uptake
2120
from pyhdx.legacy import filter_peptides
2221
from pyhdx.fileIO import read_dynamx

tests/test_fitting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import pandas as pd
66
import pytest
77
import torch
8-
import yaml
98
from hdxms_datasets import HDXDataSet, load_dataset
109
from pandas.testing import assert_frame_equal, assert_series_equal
1110

0 commit comments

Comments
 (0)