Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weighted Means and various improvements #187

Merged
merged 2 commits into from
Nov 11, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.cirdles.tripoli.gui.dialogs.TripoliMessageDialog;
import org.cirdles.tripoli.sessions.analysis.Analysis;
import org.cirdles.tripoli.sessions.analysis.AnalysisInterface;
import org.cirdles.tripoli.sessions.analysis.massSpectrometerModels.dataModels.mcmc.AllBlockInitForOGTripoli;
import org.cirdles.tripoli.sessions.analysis.massSpectrometerModels.dataModels.mcmc.initializers.AllBlockInitForOGTripoli;
import org.cirdles.tripoli.sessions.analysis.massSpectrometerModels.dataSourceProcessors.MassSpecOutputSingleBlockRecord;
import org.cirdles.tripoli.sessions.analysis.massSpectrometerModels.detectorSetups.Detector;
import org.cirdles.tripoli.sessions.analysis.methods.AnalysisMethod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private void launchSessionManager() throws IOException, TripoliException {
sessionManagerMenuItem.setDisable(false);
saveSessionAsMenuItem.setDisable(false);
closeSessionMenuItem.setDisable(false);
analysisMenu.setDisable(false);
analysisMenu.setDisable(true);
}

private void buildSessionMenuMRU() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,18 @@ private void drawAxes(GraphicsContext g2d) {

public void showTitle(GraphicsContext g2d) {
Paint savedPaint = g2d.getFill();
Font titleFont = Font.font("Monospaced Bold", 12);
Font titleFont = Font.font("Courier Bold", 12);
g2d.setFont(titleFont);
g2d.setFill(Paint.valueOf("RED"));
g2d.fillText(plotTitle[0], leftMargin, 12);
double titleLeftX = 15;
g2d.fillText(plotTitle[0], titleLeftX, 12);
if (2 == plotTitle.length) {
Text textTitle1 = new Text(plotTitle[0].split("\\.")[0]);
textTitle1.setFont(titleFont);
Text textTitle2 = new Text(plotTitle[1].split("\\.")[0]);
textTitle2.setFont(titleFont);
double offset = textTitle1.getLayoutBounds().getWidth() - textTitle2.getLayoutBounds().getWidth();
g2d.fillText(plotTitle[1], leftMargin + offset, 22);
g2d.fillText(plotTitle[1], titleLeftX + offset, 22);
}
g2d.setFill(savedPaint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ public class PlotWallPane extends Pane implements PlotWallPaneInterface {
private final String iD;
private final boolean[] zoomFlagsXY = new boolean[2];
private final AnalysisInterface analysis;
private final MCMCPlotsControllerInterface mcmcPlotsControllerInterface;
private final MCMCPlotsControllerInterface mcmcPlotsController;
AnalysisManagerCallbackI analysisManagerCallbackI;
private double toolBarHeight;
private int toolBarCount;
private boolean logScale;
private ConstantsTripoliApp.PlotLayoutStyle plotLayoutStyle;


private PlotWallPane(String iD, AnalysisInterface analysis, MCMCPlotsControllerInterface mcmcPlotsControllerInterface, AnalysisManagerCallbackI analysisManagerCallbackI) {
private PlotWallPane(String iD, AnalysisInterface analysis, MCMCPlotsControllerInterface mcmcPlotsController, AnalysisManagerCallbackI analysisManagerCallbackI) {
this.iD = iD;
zoomFlagsXY[0] = true;
zoomFlagsXY[1] = true;
this.analysis = analysis;
this.mcmcPlotsControllerInterface = mcmcPlotsControllerInterface;
this.mcmcPlotsController = mcmcPlotsController;
this.analysisManagerCallbackI = analysisManagerCallbackI;
plotLayoutStyle = ConstantsTripoliApp.PlotLayoutStyle.TILE;

Expand All @@ -69,12 +69,12 @@ private PlotWallPane(String iD, AnalysisInterface analysis, MCMCPlotsControllerI
public static PlotWallPaneInterface createPlotWallPane(
String iD,
AnalysisInterface analysis,
MCMCPlotsControllerInterface mcmcPlotsControllerInterface,
MCMCPlotsControllerInterface mcmcPlotsController,
AnalysisManagerCallbackI analysisManagerCallbackI) {
if (null == iD) {
return new PlotWallPane("NONE", analysis, mcmcPlotsControllerInterface, analysisManagerCallbackI);
return new PlotWallPane("NONE", analysis, mcmcPlotsController, analysisManagerCallbackI);
} else {
return new PlotWallPane(iD, analysis, mcmcPlotsControllerInterface, analysisManagerCallbackI);
return new PlotWallPane(iD, analysis, mcmcPlotsController, analysisManagerCallbackI);
}
}

Expand Down Expand Up @@ -223,12 +223,14 @@ public void toggleRatiosLogRatios() {
}

public void applyBurnIn() {
int burnIn = (int) analysis.getMapOfBlockIdToPlots().get(mcmcPlotsControllerInterface.getCurrentBlockID())[5][0].getShadeWidthForModelConvergence();
int blockID = mcmcPlotsControllerInterface.getCurrentBlockID();
int burnIn = (int) analysis.getMapOfBlockIdToPlots().get(mcmcPlotsController.getCurrentBlockID())[5][0].getShadeWidthForModelConvergence();
int blockID = mcmcPlotsController.getCurrentBlockID();
analysis.getMapOfBlockIdToModelsBurnCount().put(blockID, burnIn);

blockEnsemblePlotEngine(blockID, analysis);
mcmcPlotsControllerInterface.plotEnsemblesEngine(analysis.getMapOfBlockIdToPlots().get(blockID));
mcmcPlotsControllerInterface.plotRatioSessionEngine();
mcmcPlotsController.plotEnsemblesEngine(analysis.getMapOfBlockIdToPlots().get(blockID));
((Analysis) analysis).analysisRatioEngine();
mcmcPlotsController.plotAnalysisRatioEngine();
EnsemblesStore.produceSummaryModelFromEnsembleStore(blockID, analysis);

// fire up OGTripoli style analysis plots
Expand All @@ -238,18 +240,20 @@ public void applyBurnIn() {
}

public void applyBurnInAllBlocks() {
int burnIn = (int) analysis.getMapOfBlockIdToPlots().get(mcmcPlotsControllerInterface.getCurrentBlockID())[5][0].getShadeWidthForModelConvergence();
int burnIn = (int) analysis.getMapOfBlockIdToPlots().get(mcmcPlotsController.getCurrentBlockID())[5][0].getShadeWidthForModelConvergence();
int blockIDCount = analysis.getMapOfBlockIdToPlots().keySet().size() + 1;

for (int blockID = 1; blockID < blockIDCount; blockID++) {
((Analysis) analysis).updateShadeWidthsForConvergenceLinePlots(blockID, burnIn);
analysis.getMapOfBlockIdToModelsBurnCount().put(blockID, burnIn);
blockEnsemblePlotEngine(blockID, analysis);
mcmcPlotsControllerInterface.plotEnsemblesEngine(analysis.getMapOfBlockIdToPlots().get(blockID));
// mcmcPlotsControllerInterface.plotRatioSessionEngine();
mcmcPlotsController.plotEnsemblesEngine(analysis.getMapOfBlockIdToPlots().get(blockID));
// mcmcPlotsController.analysisRatioEngine();
EnsemblesStore.produceSummaryModelFromEnsembleStore(blockID, analysis);
}

mcmcPlotsControllerInterface.plotRatioSessionEngine();
((Analysis) analysis).analysisRatioEngine();
mcmcPlotsController.plotAnalysisRatioEngine();

// fire up OGTripoli style analysis plots
if (null != analysisManagerCallbackI) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ public interface PlotWallPaneInterface {

public void stackPlots();

public void tilePlots();

public void toggleShowStatsAllPlots();

}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ public void stackPlots() {
}
}

/**
*
*/
@Override
public void tilePlots() {
// not applicable
}

/**
*
*/
@Override
public void toggleShowStatsAllPlots() {
// not used
}

public void buildOGTripoliToolBar(List<SpeciesRecordInterface> species) {
ToolBar toolBar = new ToolBar();
toolBar.setPrefHeight(toolBarHeight);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.cirdles.tripoli.gui.dataViews.plots.plotsControllers.ogTripoliPlots.analysisPlots.BlockRatioCyclesAnalysisPlot;
import org.cirdles.tripoli.gui.dataViews.plots.plotsControllers.ogTripoliPlots.analysisPlots.SpeciesIntensityAnalysisPlot;
import org.cirdles.tripoli.gui.dataViews.plots.plotsControllers.tripoliPlots.RatioHistogramPlot;
import org.cirdles.tripoli.gui.dataViews.plots.plotsControllers.tripoliPlots.analysisPlots.AnalysisRatioPlot;
import org.cirdles.tripoli.gui.utilities.TripoliColor;

import static org.cirdles.tripoli.gui.dataViews.plots.PlotWallPane.gridCellDim;
Expand Down Expand Up @@ -253,8 +254,13 @@ public void toggleShowStats() {
public void toggleRatiosLogRatios() {
if (!getChildren().isEmpty() && (getChildren().get(0) instanceof RatioHistogramPlot)) {
((RatioHistogramPlot) getChildren().get(0)).toggleRatiosLogRatios();
((RatioHistogramPlot) getChildren().get(0)).repaint();
// ((RatioHistogramPlot) getChildren().get(0)).repaint();
}
if (!getChildren().isEmpty() && (getChildren().get(0) instanceof AnalysisRatioPlot)) {
((AnalysisRatioPlot) getChildren().get(0)).toggleRatiosLogRatios();
// ((AnalysisRatioPlot) getChildren().get(0)).repaint();
}

}

public void restorePlot() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* @author James F. Bowring
*/
public class MCMCPlotBuildersTask extends Task<String> implements LoggingCallbackInterface, PlotBuildersTaskInterface {
public class MCMCPlotBuildersTask extends Task<String> implements LoggingCallbackInterface, MCMCPlotBuildersTaskInterface {
public static AnalysisInterface analysis;
private final int blockID;
// plotBuilders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.cirdles.tripoli.plots.PlotBuilder;

public interface PlotBuildersTaskInterface {
public interface MCMCPlotBuildersTaskInterface {
boolean healthyPlotbuilder();

PlotBuilder[] getPeakShapesBuilder();
Expand Down
Loading