def setup_class(cls): cls.fpath = directory / 'test_data' / 'simulated_data_uptake.csv' cls.pmt = PeptideMasterTable(read_dynamx(cls.fpath)) cls.state = 'state1' cls.pmt.set_backexchange(0.) states = cls.pmt.groupby_state() cls.series = states[cls.state]
def setup_class(cls): cls.fpath = input_dir / 'ecSecB_apo.csv' cls.pmt = PeptideMasterTable(read_dynamx(cls.fpath)) cls.state = 'SecB WT apo' cls.control = ('Full deuteration control', 0.167*60) cls.pmt.set_control(cls.control) state_data = cls.pmt.get_state(cls.state) cls.temperature, cls.pH = 273.15 + 30, 8. cls.hdxm = HDXMeasurement(state_data, temperature=cls.temperature, pH=cls.pH) cfg = ConfigurationSettings() cfg.set('cluster', 'scheduler_address', f'127.0.0.1:{test_port}')
def setup_class(cls): cls.fpath = directory / 'test_data' / 'ecSecB_apo.csv' cls.pmt = PeptideMasterTable(read_dynamx(cls.fpath)) cls.state = 'SecB WT apo' cls.control = ('Full deuteration control', 0.167) cls.pmt.set_control(cls.control) state_data = cls.pmt.get_state(cls.state) cls.temperature, cls.pH = 273.15 + 30, 8. cls.series = HDXMeasurement(state_data, temperature=cls.temperature, pH=cls.pH) cls.prot_fit_result = csv_to_protein(directory / 'test_data' / 'ecSecB_torch_fit.txt') cfg = ConfigurationSettings() cfg.set('cluster', 'port', str(test_port))
def setup_class(cls): cls.fpath = directory / 'test_data' / 'ecSecB_apo.csv' cls.pmt = PeptideMasterTable(read_dynamx(cls.fpath)) cls.state = 'SecB WT apo' cls.control = ('Full deuteration control', 0.167) cls.pmt.set_control(cls.control) states = cls.pmt.groupby_state() cls.series = states[cls.state] cls.prot_fit_result = csv_to_protein(directory / 'test_data' / 'ecSecB_torch_fit.txt') cls.ds_fit = DataSource(cls.prot_fit_result, name='global_fit', x='r_number', tags=['mapping', 'pfact', 'deltaG'], renderer='circle', size=10)
from pyhdx import read_dynamx, PeptideMasterTable from pyhdx.support import get_reduced_blocks from pyhdx.plot import plot_peptides import matplotlib.pyplot as plt import os import numpy as np data_dir = '../../tests/test_data' filename = 'ecSecB_apo.csv' fpath = os.path.join(data_dir, filename) data = read_dynamx(fpath) master_table = PeptideMasterTable(data, drop_first=0, ignore_prolines=False) states = master_table.groupby_state() print(states.keys()) series = states['SecB WT apo'] split = series.split() key = list(split)[1] cov = split[key].cov def add_blocks(ax, positions, color): for pos in positions: ax.plot([pos, pos], [-40, 2], color=color, linewidth=2) # linestyle=(0, (1, 1)) text_x = positions[:-1] + np.diff(positions) / 2 for i, x in enumerate(text_x[text_x < 58]): ax.text(x,
from pathlib import Path import numpy as np from pyhdx import PeptideMasterTable, KineticsFitting, read_dynamx from pyhdx.fileIO import txt_to_protein guess = False epochs = 100000 root_dir = Path().resolve().parent test_data_dir = root_dir / 'tests' / 'test_data' input_file_path = test_data_dir / 'ecSecB_apo.csv' data = read_dynamx(test_data_dir / 'ecSecB_apo.csv', test_data_dir / 'ecSecB_dimer.csv') pmt = PeptideMasterTable(data, drop_first=1, ignore_prolines=True, remove_nan=False) pmt.set_control(('Full deuteration control', 0.167)) states = pmt.groupby_state() series = states['SecB WT apo'] temperature, pH = 273.15 + 30, 8. kf = KineticsFitting(series, bounds=(1e-2, 800), temperature=temperature, pH=pH) if guess: wt_avg_result = kf.weighted_avg_fit()
'stop_loss': 1e-6 } #%% current_dir = Path(__file__).parent #current_dir = Path().cwd() / 'templates' # pycharm scientific compat output_dir = current_dir / 'output' output_dir.mkdir(exist_ok=True) test_data_dir = current_dir.parent / 'tests' / 'test_data' input_dir = test_data_dir / 'input' #%% # Load the data of two Dynamx files, and combine the result to one table data = read_dynamx(input_dir / 'ecSecB_apo.csv', input_dir / 'ecSecB_dimer.csv') pmt = PeptideMasterTable(data, drop_first=1, ignore_prolines=True, remove_nan=False) pmt.set_control(('Full deuteration control', 0.167*60)) temperature, pH = 273.15 + 30, 8. hdxm = HDXMeasurement(pmt.get_state('SecB WT apo'), temperature=temperature, pH=pH) #%% if guess: client = default_client() wt_avg_result = fit_rates_weighted_average(hdxm, client=client) init_guess = wt_avg_result.output else: init_guess = csv_to_dataframe(test_data_dir / 'output' / 'ecSecB_guess.csv')