diff --git a/schema/library.raml b/schema/library.raml index 7b565d45..490b2ef1 100644 --- a/schema/library.raml +++ b/schema/library.raml @@ -1956,6 +1956,9 @@ types: required: false format: int64 correlationMethod: ScatterCorrelationMethod + returnPointIds: + type: boolean + required: false Scatterplot: type: object additionalProperties: false @@ -2236,6 +2239,9 @@ types: r2: type: number required: false + pointIds: + type: string[] + required: false DensityplotData: type: object additionalProperties: false diff --git a/schema/url/data/pass/plugin-scatterplot.raml b/schema/url/data/pass/plugin-scatterplot.raml index c108b89d..3bb51e1d 100644 --- a/schema/url/data/pass/plugin-scatterplot.raml +++ b/schema/url/data/pass/plugin-scatterplot.raml @@ -40,6 +40,9 @@ types: required: false correlationMethod: type: ScatterCorrelationMethod + returnPointIds: + type: boolean + required: false Scatterplot: additionalProperties: false diff --git a/schema/url/data/plots.raml b/schema/url/data/plots.raml index da43790a..952c574b 100644 --- a/schema/url/data/plots.raml +++ b/schema/url/data/plots.raml @@ -243,6 +243,9 @@ types: r2: type: number required: false + pointIds: + type: string[] + required: false DensityplotData: additionalProperties: false diff --git a/src/main/java/org/veupathdb/service/eda/data/plugin/pass/ScatterplotPlugin.java b/src/main/java/org/veupathdb/service/eda/data/plugin/pass/ScatterplotPlugin.java index 461000b3..c9fd8885 100644 --- a/src/main/java/org/veupathdb/service/eda/data/plugin/pass/ScatterplotPlugin.java +++ b/src/main/java/org/veupathdb/service/eda/data/plugin/pass/ScatterplotPlugin.java @@ -123,6 +123,8 @@ protected void writeResults(OutputStream out, Map dataStrea String deprecatedShowMissingness = showMissingness.equals("FALSE") ? "noVariables" : showMissingness.equals("TRUE") ? "strataVariables" : showMissingness; String yVarType = util.getVariableType(spec.getYAxisVariable()); String correlationMethod = spec.getCorrelationMethod() != null ? spec.getCorrelationMethod().getValue() : "none"; + String recordIdColumnName = util.toColNameOrEmpty(util.getEntityIdVarSpec(spec.getOutputEntityId())); + String returnPointIds = spec.getReturnPointIds() != null ? String.valueOf(spec.getReturnPointIds()).toUpperCase() : "FALSE"; if (yVarType.equals("DATE") && !valueSpec.equals("raw")) { LOG.error("Cannot calculate trend lines for y-axis date variables. The `valueSpec` property must be set to `raw`."); @@ -139,6 +141,7 @@ protected void writeResults(OutputStream out, Map dataStrea nonStrataVarColNames, (name, conn) -> conn.voidEval(util.getVoidEvalFreadCommand(name, + util.getEntityIdVarSpec(spec.getOutputEntityId()), spec.getXAxisVariable(), spec.getYAxisVariable(), spec.getOverlayVariable(), @@ -149,9 +152,17 @@ protected void writeResults(OutputStream out, Map dataStrea useRConnectionWithProcessedRemoteFiles(Resources.RSERVE_URL, filesProcessor, connection -> { connection.voidEval(getVoidEvalVariableMetadataList(varMap)); String cmd = - "plot.data::scattergl(" + DEFAULT_SINGLE_STREAM_NAME + ", variables, '" + - valueSpec + "', NULL, correlationMethod = '" + correlationMethod + "', TRUE, TRUE, '" + - deprecatedShowMissingness + "')"; + "plot.data::scattergl(" + + DEFAULT_SINGLE_STREAM_NAME + + ", variables" + + ", value= '" + valueSpec + + "', overlayValues = NULL" + + ", correlationMethod = '" + correlationMethod + + "', sampleSizes=TRUE, completeCases=TRUE" + + ", evilMode='" + deprecatedShowMissingness + + "', idColumn = '" + recordIdColumnName + + "', returnPointIds = " + returnPointIds + ")"; + streamResult(connection, cmd, out); }); }