Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
'**.ipynb_checkpoints',
'logo/LICENSE.md',
# TODO update and un-exclude
'example/example_visualization.ipynb',
'example/example_visualization_without_visspec.ipynb',
]

Expand Down
1 change: 1 addition & 0 deletions doc/example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The following examples should help to get a better idea of how to use the PEtab
:maxdepth: 1

example/example_petablint.ipynb
example/example_visualization.ipynb
example/example_visualization_with_visspec.ipynb

Examples of systems biology parameter estimation problems specified in PEtab
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ plot4 JI09_151102_Drg421_418_Age LinePlot MeanAndSD JI09_151102_Drg421_418_Age__
plot5 JI09_160126_Drg449_444_CycNuc BarPlot MeanAndSD JI09_160126_Drg449_444_CycNuc__ctrl condition 0 Condition pRII_Western 0 pRII_Western Ctrl lin lin
plot5 JI09_160126_Drg449_444_CycNuc BarPlot MeanAndSD JI09_160126_Drg449_444_CycNuc__Fsk10_and_IBMX100 condition 0 Condition pRII_Western 0 pRII_Western IBMX(100)/Fsk(10) lin lin
plot5 JI09_160126_Drg449_444_CycNuc BarPlot MeanAndSD JI09_160126_Drg449_444_CycNuc__Sp8_Br_cAMPS_AM10 condition 0 Condition pRII_Western 0 pRII_Western Sp8-Br-cAMPS-AM(10) lin lin
plot6 JI09_160201_Drg453-452_CycNuc ScatterPlot MeanAndSD JI09_160201_Drg453-452_CycNuc__ctrl time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Ctrl lin lin
plot6 JI09_160201_Drg453-452_CycNuc ScatterPlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Fsk time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Fsk(10) lin lin
plot6 JI09_160201_Drg453-452_CycNuc ScatterPlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Sp8_Br_cAMPS_AM time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Sp8-Br-cAMPS-AM(10) lin lin
plot6 JI09_160201_Drg453-452_CycNuc LinePlot MeanAndSD JI09_160201_Drg453-452_CycNuc__ctrl time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Ctrl lin lin
plot6 JI09_160201_Drg453-452_CycNuc LinePlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Fsk time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Fsk(10) lin lin
plot6 JI09_160201_Drg453-452_CycNuc LinePlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Sp8_Br_cAMPS_AM time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Sp8-Br-cAMPS-AM(10) lin lin
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plotId plotName plotTypeSimulation plotTypeData datasetId xValues xOffset xLabel yValues yOffset yLabel legendEntry xScale yScale
plot5 JI09_160126_Drg449_444_CycNuc ScatterPlot MeanAndSD JI09_160126_Drg449_444_CycNuc__ctrl condition 0 Condition pRII_Western 0 pRII_Western Ctrl lin lin
plot5 JI09_160126_Drg449_444_CycNuc ScatterPlot MeanAndSD JI09_160126_Drg449_444_CycNuc__Fsk10_and_IBMX100 condition 0 Condition pRII_Western 0 pRII_Western IBMX(100)/Fsk(10) lin lin
plot5 JI09_160126_Drg449_444_CycNuc ScatterPlot MeanAndSD JI09_160126_Drg449_444_CycNuc__Sp8_Br_cAMPS_AM10 condition 0 Condition pRII_Western 0 pRII_Western Sp8-Br-cAMPS-AM(10) lin lin
plot6 JI09_160201_Drg453-452_CycNuc ScatterPlot MeanAndSD JI09_160201_Drg453-452_CycNuc__ctrl time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Ctrl lin lin
plot6 JI09_160201_Drg453-452_CycNuc ScatterPlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Fsk time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Fsk(10) lin lin
plot6 JI09_160201_Drg453-452_CycNuc ScatterPlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Sp8_Br_cAMPS_AM time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Sp8-Br-cAMPS-AM(10) lin lin
354 changes: 133 additions & 221 deletions doc/example/example_visualization.ipynb

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions petab/visualize/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def generate_barplot(self, ax: 'matplotlib.pyplot.Axes',
# TODO: plotTypeData == REPLICATE?
noise_col = self._error_column_for_plot_type_data(plotTypeData)

simu_colors = None
measurements_to_plot, simulations_to_plot = \
self.data_provider.get_data_to_plot(dataplot,
plotTypeData == PROVIDED)
Expand All @@ -191,15 +190,14 @@ def generate_barplot(self, ax: 'matplotlib.pyplot.Axes',
color = plt.rcParams["axes.prop_cycle"].by_key()["color"][0]

if measurements_to_plot is not None:
p = ax.bar(x_name, measurements_to_plot.data_to_plot['mean'],
yerr=measurements_to_plot.data_to_plot[noise_col],
color=color, **bar_kwargs, label='measurement')
simu_colors = p[0].get_facecolor()
ax.bar(x_name, measurements_to_plot.data_to_plot['mean'],
yerr=measurements_to_plot.data_to_plot[noise_col],
color=color, **bar_kwargs, label='measurement')

if simulations_to_plot is not None:
bar_kwargs['width'] = -bar_kwargs['width']
ax.bar(x_name, simulations_to_plot.data_to_plot['mean'],
color='white', edgecolor=simu_colors, **bar_kwargs,
color='white', edgecolor=color, **bar_kwargs,
label='simulation')

def generate_scatterplot(self, ax: 'matplotlib.pyplot.Axes',
Expand All @@ -222,7 +220,7 @@ def generate_scatterplot(self, ax: 'matplotlib.pyplot.Axes',
self.data_provider.get_data_to_plot(dataplot,
plotTypeData == PROVIDED)

if simulations_to_plot is None:
if simulations_to_plot is None or measurements_to_plot is None:
raise NotImplementedError('Scatter plots do not work without'
' simulation data')
ax.scatter(measurements_to_plot.data_to_plot['mean'],
Expand Down
15 changes: 15 additions & 0 deletions tests/test_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ def vis_spec_file_Isensee_replicates():
/ "Isensee_visualizationSpecification_replicates.tsv"


@pytest.fixture
def vis_spec_file_Isensee_scatterplot():
return EXAMPLE_DIR / "example_Isensee" \
/ "Isensee_visualizationSpecification_scatterplot.tsv"


@pytest.fixture
def simulation_file_Isensee():
return EXAMPLE_DIR / "example_Isensee" / "Isensee_simulationData.tsv"
Expand All @@ -124,6 +130,15 @@ def test_visualization_replicates(data_file_Isensee,
data_file_Isensee, simulation_file_Isensee)


def test_visualization_scatterplot(data_file_Isensee,
condition_file_Isensee,
vis_spec_file_Isensee_scatterplot,
simulation_file_Isensee):
plot_with_vis_spec(vis_spec_file_Isensee_scatterplot,
condition_file_Isensee,
data_file_Isensee, simulation_file_Isensee)


def test_visualization_small_visu_file_w_datasetid(data_file_Fujita,
condition_file_Fujita,
visu_file_Fujita_small):
Expand Down