Esempio n. 1
0
    def test_coverage(self):
        tmpl, ctrl = _main_app()
        ctrl.series = self.series

        cov_figure = ctrl.figure_panels['CoverageFigure']
        renderer = cov_figure.figure.renderers[0]

        assert renderer.data_source.name == f'coverage_{self.series.state}'
Esempio n. 2
0
    def test_global_fit(self):
        tmpl, ctrl = _main_app()
        ctrl.cluster = None
        ctrl.series = self.series

        initial_guess = ctrl.control_panels['InitialGuessControl']
        initial_guess._action_fit()

        fit = ctrl.control_panels['FitControl']
        fit.epochs = 20
        fit._do_fitting()
        assert 'global_fit' in ctrl.sources.keys()
Esempio n. 3
0
    def test_initial_guesses(self):
        tmpl, ctrl = _main_app()
        ctrl.cluster = None
        ctrl.series = self.series

        initial_guess = ctrl.control_panels['InitialGuessControl']
        initial_guess._action_fit()
        assert 'half-life' in ctrl.sources.keys()

        initial_guess.fitting_model = 'Association'
        initial_guess._action_fit()
        assert 'fit1' in ctrl.sources.keys()
Esempio n. 4
0
    def test_classification(self):
        tmpl, ctrl = _main_app()
        ctrl.cluster = None
        ctrl.series = self.series

        initial_guess = ctrl.control_panels['InitialGuessControl']
        initial_guess._action_fit()
        assert 'half-life' in ctrl.sources.keys()

        classification = ctrl.control_panels['ClassificationControl']
        classification.target = 'half-life'
        classification.quantity = 'rate'
        classification._action_otsu()
Esempio n. 5
0
    def test_initial_guesses_and_fit(self):
        tmpl, ctrl = _main_app()
        ctrl.series = self.series

        ctrl.control_panels['InitialGuessControl']._action_fit()
        assert 'half-life' in ctrl.sources.keys()

        fit_control = ctrl.control_panels['FitControl']
        fit_control.epochs = 10
        fit_control._do_fitting()

        deltaG_figure = ctrl.figure_panels['DeltaGFigure']
        renderer = deltaG_figure.figure.renderers[0]
        assert renderer.data_source.name == 'global_fit'
Esempio n. 6
0
    def test_file_download_output(self):
        tmpl, ctrl = _main_app()
        ctrl.series = self.series
        ctrl.publish_data('global_fit', self.ds_fit)

        f_export = ctrl.control_panels['FileExportControl']
        f_export.target = 'global_fit'
        pml = f_export._make_pml('sadf')

        assert pml == TEST_PML

        io = f_export.linear_export_callback()
        val = io.getvalue()

        assert val.count('\n') == 148
Esempio n. 7
0
    def test_load_files(self):
        with open(self.fpath, 'rb') as f:
            binary = f.read()

        tmpl, ctrl = _main_app()
        file_input_control = ctrl.control_panels['PeptideFileInputControl']

        file_input_control.file_selectors[0].value = binary
        file_input_control._action_load()
        file_input_control.norm_mode = 'Theory'
        file_input_control.be_percent = 0.

        file_input_control.exp_state = self.state
        assert file_input_control.exp_exposures == [
            0.167, 0.5, 1.0, 5.0, 10.0, 30., 100.
        ]
        file_input_control._action_parse()

        assert isinstance(ctrl.series, KineticsSeries)
        assert isinstance(ctrl.peptides, PeptideMasterTable)
Esempio n. 8
0
    def test_load_files(self):
        with open(self.fpath, 'rb') as f:
            binary = f.read()

        tmpl, ctrl = _main_app()
        file_input_control = ctrl.control_panels['PeptideFileInputControl']

        file_input_control.file_selectors[0].value = binary
        file_input_control._action_load()
        assert file_input_control.fd_state == 'Full deuteration control'
        assert file_input_control.fd_exposure == 0.0

        file_input_control.fd_state = self.control[0]
        file_input_control.fdexposure = self.control[1]

        file_input_control.exp_state = self.state
        assert file_input_control.exp_exposures == [
            0.0, 0.167, 0.5, 1.0, 5.0, 10.0, 100.000008
        ]
        file_input_control._action_parse()

        assert isinstance(ctrl.series, KineticsSeries)
        assert isinstance(ctrl.peptides, PeptideMasterTable)
Esempio n. 9
0
Reload SecB and fitted data and launch  GUI

"""

from pyhdx.fileIO import read_dynamx, txt_to_np, csv_to_dataframe
from pyhdx import PeptideMasterTable
import pickle
from pyhdx.panel.apps import _main_app
from pyhdx.panel.utils import reload_previous
from pyhdx.panel.base import DEFAULT_COLORS, STATIC_DIR
from pyhdx.panel.data_sources import DataSource
import panel as pn
import numpy as np
from pathlib import Path

tmpl, ctrl = _main_app()
directory = Path(__file__).parent
fpath = directory / 'test_data' / 'ecSecB_apo.csv'

dic = {}
dic['file_path'] = directory / 'test_data' / 'ecSecB_apo.csv'
dic['norm_mode'] = 'Exp'
dic['fd_state'] = 'Full deuteration control'
dic['fd_exposure'] = 0.167
dic['exp_state'] = 'SecB WT apo'

src_file = directory / 'test_data' / 'ecSecB_torch_fit.txt'
df = csv_to_dataframe(src_file)
data_dict = df.to_dict(orient='series')

print(data_dict)
Esempio n. 10
0
 def test_coverage(self):
     tmpl, ctrl = _main_app()
     ctrl.series = self.series