Exemple #1
0
def test_simple_visualization(data_file_Fujita, condition_file_Fujita):
    plot_measurements_by_observable(data_file_Fujita, condition_file_Fujita)
    plot_measurements_by_observable(data_file_Fujita,
                                    condition_file_Fujita,
                                    plotted_noise=PROVIDED)
Exemple #2
0
def test_visualization_raises(data_file_Fujita, condition_file_Fujita,
                              data_file_Fujita_wrongNoise):
    sim_cond_num_list = [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5]]
    sim_cond_id_list = [['model1_data1'], ['model1_data2', 'model1_data3'],
                        ['model1_data4', 'model1_data5'], ['model1_data6']]
    observable_num_list = [[0], [1], [2], [0, 2], [1, 2]]
    observable_id_list = [['pS6_tot'], ['pEGFR_tot'], ['pAkt_tot']]
    error_counter = 0

    # Combining simulation condition numbers and IDs should not be allowed
    try:
        plot_data_and_simulation(data_file_Fujita,
                                 condition_file_Fujita,
                                 sim_cond_num_list=sim_cond_num_list,
                                 sim_cond_id_list=sim_cond_id_list)
    except NotImplementedError as ErrMsg:
        assert (ErrMsg.args[0] == 'Either specify a list of simulation '
                'condition IDs or a list of simulation '
                'condition numbers, but not both. '
                'Stopping.')
        error_counter += 1
    assert (error_counter == 1)

    # Combining observable numbers and IDs should not be allowed
    try:
        plot_data_and_simulation(data_file_Fujita,
                                 condition_file_Fujita,
                                 observable_num_list=observable_num_list,
                                 observable_id_list=observable_id_list)
    except NotImplementedError as ErrMsg:
        assert (ErrMsg.args[0] == 'Either specify a list of observable IDs or '
                'a list of observable numbers, but not both. '
                'Stopping.')
        error_counter += 1
    assert (error_counter == 2)

    # Combining observable and simulation conditions numbers or IDs should not
    # be allowed
    try:
        plot_data_and_simulation(data_file_Fujita,
                                 condition_file_Fujita,
                                 sim_cond_num_list=observable_num_list,
                                 observable_num_list=observable_num_list)
    except NotImplementedError as ErrMsg:
        assert (
            ErrMsg.args[0] == 'Plotting without visualization specification'
            ' file and datasetId can be performed via '
            'grouping by simulation conditions OR '
            'observables, but not both. Stopping.')
        error_counter += 1
    assert (error_counter == 3)
    try:
        plot_data_and_simulation(data_file_Fujita,
                                 condition_file_Fujita,
                                 sim_cond_id_list=observable_id_list,
                                 observable_id_list=observable_id_list)
    except NotImplementedError as ErrMsg:
        assert (
            ErrMsg.args[0] == 'Plotting without visualization specification'
            ' file and datasetId can be performed via '
            'grouping by simulation conditions OR '
            'observables, but not both. Stopping.')
        error_counter += 1
    assert (error_counter == 4)

    # If no numerical noise is provided, it should not work to plot it
    try:
        plot_measurements_by_observable(data_file_Fujita_wrongNoise,
                                        condition_file_Fujita,
                                        plotted_noise='provided')
    except NotImplementedError as ErrMsg:
        assert (ErrMsg.args[0] == "No numerical noise values provided in the "
                "measurement table. Stopping.")
        error_counter += 1

    assert (error_counter == 5)