Charts

Every chart of the QC Analytical Results API: its parameters, an example request and the answer it gives, from the demo data.

The API has 18 charts: the app’s own, worked out by the same code. Each is POST /v1/charts/{type} with a JSON body of dataset_id, lab, analyte and the chart’s parameters. GET /v1/charts lists them with their parameters, as this page does.

Every answer has the same envelope: api_version, chart, dataset_id, parameters (as used, defaults filled in), rows_used, warnings and the chart’s spec. The examples below are from the demo data, with tables cut to their first two rows.

Version 1.0: the parameters and each spec layout are settled; a change would be a new version (see What’s new). Every chart uses the same names: value, original/duplicate, rd, pair, stage, check_id, lab_job, despatch, crm, x/index; outlier is true/false; band is ok, warning or action; limits are centre, warning_low, warning_high, action_low, action_high; stats keys are plain words with numbers; a faceted chart has panels keyed by check stage, each shaped like the single chart.

Parameters every chart takes

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.

analyte is not taken by rd-box-whiskers (it charts every analyte). A chart narrows to a date range (date_from, date_to, by date_type) or to despatches; with neither it uses the whole dataset.

The charts

Chart Dataset What
scatter precision Sample 1 v Sample 2 scatter, with outlier lines
rd-mean-pairs precision Relative difference v mean of the pair
rd-sequence precision Relative difference in sequence (date, check ID, job or despatch)
rd-percentile precision Relative difference v percentile
rd-rolling-median precision Rolling median relative difference by despatch
rd-density-histogram precision Histogram and density of the relative difference
qq-normal precision Relative difference against the normal distribution (Q-Q)
qq precision Sample 1 v Sample 2 quantiles (Q-Q)
ecdf precision Empirical cumulative distribution of the relative difference
thompson-howarth precision Precision v concentration and Thompson-Howarth, every check stage
rd-box-whiskers precision Relative difference box plots, every analyte
shewhart accuracy Shewhart control chart of a CRM, with Nelson rules
cusum accuracy CUSUM of a CRM
ewma accuracy EWMA of a CRM
all-time-series accuracy Shewhart, CUSUM and EWMA of a CRM together
crm-box-whiskers accuracy CRM results as box plots
z-score accuracy Z-scores of one or more CRMs
blanks accuracy Blank results against a warning level

Sample 1 v Sample 2 scatter, with outlier lines

POST /v1/charts/scatter, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
stage string no Sample check stage (CHECKSTAGE_CK). Not needed with facet_by_stage.
facet_by_stage logical default false One panel per check stage.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
outlier_method string default sqc one of sqc, mad Control limits from the standard deviation (sqc) or the median absolute deviation (mad).
sqc_outliers logical default false Mark outliers by control limits instead of the control line.
control_line_pct number default 20 5 to 40 The control line’s relative difference, %.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/scatter \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","stage":"Pulverising Stage","rd_formula":"MPRD","control_line_pct":20}'

The answer (177 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "scatter",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "stage": "Pulverising Stage",
    "facet_by_stage": false,
    "rd_formula": "MPRD",
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "outlier_method": "sqc",
    "sqc_outliers": false,
    "control_line_pct": 20
  },
  "rows_used": 177,
  "warnings": [],
  "spec": {
    "chart_type": "scatter",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "rd": "MPRD%",
      "sqc_outliers": false,
      "control_line_pct": 20,
      "facet": false,
      "subtitle": "Pulverising Stage   2022-11-16 to 2025-11-10"
    },
    "stats": {
      "n": 177,
      "lld": 0.01,
      "threshold": 0,
      "mean": -2.8,
      "median": 0,
      "skew": 0.1,
      "kurtosis": 0.8,
      "beyond_2sd": 5,
      "beyond_2sd_pct": 2.8
    },
    "outliers": {
      "count": 70,
      "pct": 39.5,
      "warning": false,
      "warning_text": "For normally distributed data, this should be no more than 0.3% of data above the error control line and no more than 4.6% above the warning control line. If some values are at low concentrations, try applying a threshold.",
      "label": "Outside the ±20% control lines"
    },
    "points": [
      {
        "original": 0.02,
        "duplicate": 0.01,
        "rd": 66.667,
        "outlier": true,
        "pair": "AC29214 : *REP AC29214",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10",
        "lab_job": "AL07117663",
        "despatch": "1108",
        "date": "2022-11-16"
      },
      {
        "original": 0.01,
        "duplicate": 0.01,
        "rd": 0,
        "outlier": false,
        "pair": "GR011188 : *REP GR011188",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10",
        "lab_job": "AL08118605",
        "despatch": "21101",
        "date": "2023-09-18"
      }
    ],
    "below": [],
    "max_val": 3.69,
    "limits": null,
    "ols_line": [
      {
        "x": 0,
        "y": 0.0289207638848395
      },
      {
        "x": 3.69,
        "y": 2.62836212457988
      }
    ],
    "robust_line": [
      {
        "x": 0,
        "y": 0
      },
      {
        "x": 3.69,
        "y": 3.69
      }
    ]
  }
}

What the spec holds

  • chart_type: “scatter”.
  • meta: an object with lab, analyte, rd, sqc_outliers, control_line_pct, facet, subtitle.
  • stats: an object with n, lld, threshold, mean, median, skew, kurtosis, beyond_2sd, beyond_2sd_pct.
  • outliers: an object with count, pct, warning, warning_text, label.
  • points: a table of 177 rows, columns original, duplicate, rd, outlier, pair, stage, lab_job, despatch, date.
  • below: a table of 0 rows, columns original, duplicate, rd, stage, lab_job, despatch.
  • max_val: 3.69.
  • limits: null here.
  • ols_line: a table of 2 rows, columns x, y.
  • robust_line: a table of 2 rows, columns x, y.

Relative difference v mean of the pair

POST /v1/charts/rd-mean-pairs, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
stage string no Sample check stage (CHECKSTAGE_CK). Not needed with facet_by_stage.
facet_by_stage logical default false One panel per check stage.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
outlier_method string default sqc one of sqc, mad Control limits from the standard deviation (sqc) or the median absolute deviation (mad).

Example

curl -s https://api.geoscience-analytics.com/v1/charts/rd-mean-pairs \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","stage":"Pulverising Stage","threshold_factor":5}'

The answer (177 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "rd-mean-pairs",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "stage": "Pulverising Stage",
    "facet_by_stage": false,
    "rd_formula": "MPRD",
    "threshold_factor": 5,
    "apply_upper_detection": false,
    "outlier_method": "sqc"
  },
  "rows_used": 177,
  "warnings": [],
  "spec": {
    "chart_type": "rd-mean-pairs",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "rd": "MPRD%",
      "mad": false,
      "threshold_factor": 5,
      "facet": false
    },
    "subtitle": "Pulverising Stage   2022-11-16 to 2025-11-10",
    "points": [
      {
        "pair_mean": 0.115,
        "rd": -8.696,
        "pair": "AC029740 : *REP AC029740",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10"
      },
      {
        "pair_mean": 0.085,
        "rd": -35.294,
        "pair": "AC029790 : *REP AC029790",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10"
      }
    ],
    "below": [
      {
        "pair_mean": 0.015,
        "rd": 66.667,
        "pair": "AC29214 : *REP AC29214",
        "stage": "Pulverising Stage"
      },
      {
        "pair_mean": 0.01,
        "rd": 0,
        "pair": "GR011188 : *REP GR011188",
        "stage": "Pulverising Stage"
      }
    ],
    "limits": {
      "centre": -0.0909565217391304,
      "warning_low": -51.3503907544629,
      "warning_high": 51.1684777109847,
      "action_low": -76.9801078708248,
      "action_high": 76.7981948273466,
      "unit": "SD",
      "ok": true
    },
    "median": 0,
    "mean": -0.0909565217391304,
    "threshold": 0.05,
    "stats": {
      "n": 46,
      "lld": 0.01,
      "threshold": 0.05,
      "mean": -0.091,
      "median": 0,
      "skew": 1,
      "kurtosis": 3.1,
      "beyond_2sd": 2,
      "beyond_2sd_pct": 4.3
    },
    "outliers": {
      "count": 1,
      "pct": 2.2,
      "warning": true,
      "warning_text": "For normally distributed data, this should be no more than 0.3% of data above the error control line and no more than 4.6% above the warning control line. If some values are at low concentrations, try applying a threshold.",
      "label": "Outliers (beyond 3 SD)"
    }
  }
}

What the spec holds

  • chart_type: “rd-mean-pairs”.
  • meta: an object with lab, analyte, rd, mad, threshold_factor, facet.
  • subtitle: “Pulverising Stage 2022-11-16 to 2025-11-10”.
  • points: a table of 46 rows, columns pair_mean, rd, pair, stage.
  • below: a table of 131 rows, columns pair_mean, rd, pair, stage.
  • limits: an object with centre, warning_low, warning_high, action_low, action_high, unit, ok.
  • median: 0.
  • mean: -0.09095652.
  • threshold: 0.05.
  • stats: an object with n, lld, threshold, mean, median, skew, kurtosis, beyond_2sd, beyond_2sd_pct.
  • outliers: an object with count, pct, warning, warning_text, label.

Relative difference in sequence (date, check ID, job or despatch)

POST /v1/charts/rd-sequence, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
stage string no Sample check stage (CHECKSTAGE_CK). Not needed with facet_by_stage.
facet_by_stage logical default false One panel per check stage.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
outlier_method string default sqc one of sqc, mad Control limits from the standard deviation (sqc) or the median absolute deviation (mad).
x_axis string default check_id one of check_id, lab_job, despatch, date What the points are in order of.
smoothing_span number default 50 10 to 100 Span of the trend line, as a % of the points.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/rd-sequence \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","stage":"Pulverising Stage","x_axis":"date"}'

The answer (177 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "rd-sequence",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "stage": "Pulverising Stage",
    "facet_by_stage": false,
    "rd_formula": "MPRD",
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "outlier_method": "sqc",
    "x_axis": "date",
    "smoothing_span": 50
  },
  "rows_used": 177,
  "warnings": [],
  "spec": {
    "chart_type": "rd-sequence",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "rd": "MPRD%",
      "x_axis": "date",
      "date_type": "return",
      "mad": false,
      "facet": false
    },
    "subtitle": "Pulverising Stage   2022-11-16 to 2025-11-10",
    "points": [
      {
        "x": 0,
        "rd": 66.667,
        "pair_mean": 0.015,
        "pair": "AC29214 : *REP AC29214",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10",
        "date": "2022-11-16",
        "outlier": false
      },
      {
        "x": 1,
        "rd": -66.667,
        "pair_mean": 0.015,
        "pair": "AC10110 : *REP AC10110",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10",
        "date": "2023-01-20",
        "outlier": false
      }
    ],
    "limits": {
      "centre": -2.8440395480226,
      "warning_low": -74.1256786681551,
      "warning_high": 68.4375995721099,
      "action_low": -109.766498228221,
      "action_high": 104.078419132176,
      "unit": "SD",
      "ok": true
    },
    "median": 0,
    "mean": -2.8440395480226,
    "trend": [
      {
        "x": 0,
        "y": -2.25230795073064
      },
      {
        "x": 1,
        "y": -2.35757872838776
      }
    ],
    "stats": {
      "n": 177,
      "lld": 0.01,
      "threshold": 0,
      "mean": -2.8,
      "median": 0,
      "skew": 0.1,
      "kurtosis": 0.8,
      "beyond_2sd": 5,
      "beyond_2sd_pct": 2.8
    },
    "outliers": {
      "count": 0,
      "pct": 0,
      "warning": false,
      "warning_text": "For normally distributed data, this should be no more than 0.3% of data above the error control line and no more than 4.6% above the warning control line. If some values are at low concentrations, try applying a threshold.",
      "label": "Outliers (beyond 3 SD)"
    }
  }
}

What the spec holds

  • chart_type: “rd-sequence”.
  • meta: an object with lab, analyte, rd, x_axis, date_type, mad, facet.
  • subtitle: “Pulverising Stage 2022-11-16 to 2025-11-10”.
  • points: a table of 177 rows, columns x, rd, pair_mean, pair, stage, date, outlier.
  • limits: an object with centre, warning_low, warning_high, action_low, action_high, unit, ok.
  • median: 0.
  • mean: -2.84404.
  • trend: a table of 177 rows, columns x, y.
  • stats: an object with n, lld, threshold, mean, median, skew, kurtosis, beyond_2sd, beyond_2sd_pct.
  • outliers: an object with count, pct, warning, warning_text, label.

Relative difference v percentile

POST /v1/charts/rd-percentile, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
stage string no Sample check stage (CHECKSTAGE_CK). Not needed with facet_by_stage.
facet_by_stage logical default false One panel per check stage.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
outlier_method string default sqc one of sqc, mad Control limits from the standard deviation (sqc) or the median absolute deviation (mad).

Example

curl -s https://api.geoscience-analytics.com/v1/charts/rd-percentile \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","stage":"Pulverising Stage"}'

The answer (177 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "rd-percentile",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "stage": "Pulverising Stage",
    "facet_by_stage": false,
    "rd_formula": "MPRD",
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "outlier_method": "sqc"
  },
  "rows_used": 177,
  "warnings": [],
  "spec": {
    "chart_type": "rd-percentile",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "rd": "MPRD%",
      "mad": false,
      "facet": false
    },
    "subtitle": "Pulverising Stage   2022-11-16 to 2025-11-10",
    "points": [
      {
        "percentile": 0.564971751412429,
        "rd": -100,
        "pair": "AC033120 : *REP AC033120",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10",
        "outlier": false
      },
      {
        "percentile": 1.12994350282486,
        "rd": -66.667,
        "pair": "CA018188 : *REP CA018188",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10",
        "outlier": false
      }
    ],
    "limits": {
      "centre": -2.8440395480226,
      "warning_low": -74.1256786681551,
      "warning_high": 68.4375995721099,
      "action_low": -109.766498228221,
      "action_high": 104.078419132176,
      "unit": "SD",
      "ok": true
    },
    "stats": {
      "n": 177,
      "lld": 0.01,
      "threshold": 0,
      "mean": -2.8,
      "median": 0,
      "skew": 0.1,
      "kurtosis": 0.8,
      "beyond_2sd": 5,
      "beyond_2sd_pct": 2.8
    },
    "outliers": {
      "count": 0,
      "pct": 0,
      "warning": false,
      "warning_text": "For normally distributed data, this should be no more than 0.3% of data above the error control line and no more than 4.6% above the warning control line. If some values are at low concentrations, try applying a threshold.",
      "label": "Outliers (beyond 3 SD)"
    }
  }
}

What the spec holds

  • chart_type: “rd-percentile”.
  • meta: an object with lab, analyte, rd, mad, facet.
  • subtitle: “Pulverising Stage 2022-11-16 to 2025-11-10”.
  • points: a table of 177 rows, columns percentile, rd, pair, stage, outlier.
  • limits: an object with centre, warning_low, warning_high, action_low, action_high, unit, ok.
  • stats: an object with n, lld, threshold, mean, median, skew, kurtosis, beyond_2sd, beyond_2sd_pct.
  • outliers: an object with count, pct, warning, warning_text, label.

Rolling median relative difference by despatch

POST /v1/charts/rd-rolling-median, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
stage string no Sample check stage (CHECKSTAGE_CK). Not needed with facet_by_stage.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
rolling_window integer default 20 5 to 30 Despatches in the rolling window.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/rd-rolling-median \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","stage":"Pulverising Stage","rolling_window":20}'

The answer (177 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "rd-rolling-median",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "stage": "Pulverising Stage",
    "rd_formula": "MPRD",
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "rolling_window": 20
  },
  "rows_used": 177,
  "warnings": [],
  "spec": {
    "chart_type": "rd-rolling-median",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "stage": "Pulverising Stage",
      "window": 20
    },
    "points": [
      {
        "x": 0,
        "y": 66.67,
        "pair": "AC29214 : *REP AC29214",
        "despatch": "1108",
        "pair_mean": 0.015
      },
      {
        "x": 11,
        "y": 0,
        "pair": "GR011188 : *REP GR011188",
        "despatch": "21101",
        "pair_mean": 0.01
      }
    ],
    "despatches": [
      {
        "x": 0,
        "label": "1108",
        "date": "2022-11-16",
        "pairs": 1,
        "y": 66.67,
        "rolling": 66.67
      },
      {
        "x": 1,
        "label": "3111",
        "date": "2023-01-20",
        "pairs": 1,
        "y": 66.67,
        "rolling": 66.67
      }
    ],
    "limits": {
      "stage_limit": 10,
      "action_limit": 20,
      "source": "standard"
    },
    "latest_rolling": 0.934579439252337,
    "top": 100,
    "stats": {
      "despatches": 103,
      "pairs": 177,
      "window": 20,
      "latest_rolling_median": 0.9,
      "latest_despatch_median": 0,
      "median_all_pairs": 1.9,
      "stage_limit": 10,
      "stage_limit_source": "standard",
      "over_stage_limit": 28,
      "over_action_limit": 26
    }
  }
}

What the spec holds

  • chart_type: “rd-rolling-median”.
  • meta: an object with lab, analyte, stage, window.
  • points: a table of 177 rows, columns x, y, pair, despatch, pair_mean.
  • despatches: a table of 103 rows, columns x, label, date, pairs, y, rolling.
  • limits: an object with stage_limit, action_limit, source.
  • latest_rolling: 0.9345794.
  • top: 100.
  • stats: an object with despatches, pairs, window, latest_rolling_median, latest_despatch_median, median_all_pairs, stage_limit, stage_limit_source, over_stage_limit, over_action_limit.

Histogram and density of the relative difference

POST /v1/charts/rd-density-histogram, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
stage string no Sample check stage (CHECKSTAGE_CK). Not needed with facet_by_stage.
facet_by_stage logical default false One panel per check stage.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
outlier_method string default sqc one of sqc, mad Control limits from the standard deviation (sqc) or the median absolute deviation (mad).
exclude_outliers logical default false Leave out the outlying pairs.
density_mode string default density_histogram one of histogram, density_histogram Histogram alone or with its density curve.
bins integer no 10 to 60 Number of bins; leave out for Sturges’ rule.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/rd-density-histogram \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","stage":"Pulverising Stage","bins":20}'

The answer (177 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "rd-density-histogram",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "stage": "Pulverising Stage",
    "facet_by_stage": false,
    "rd_formula": "MPRD",
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "outlier_method": "sqc",
    "exclude_outliers": false,
    "density_mode": "density_histogram",
    "bins": 20
  },
  "rows_used": 177,
  "warnings": [],
  "spec": {
    "chart_type": "rd-density-histogram",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "rd": "MPRD%",
      "density_mode": true,
      "bins": 20,
      "facet": false,
      "subtitle": "Pulverising Stage   2022-11-16 to 2025-11-10"
    },
    "stats": {
      "n": 177,
      "lld": 0.01,
      "threshold": 0,
      "mean": -2.8,
      "median": 0,
      "skew": 0.1,
      "kurtosis": 0.8,
      "beyond_2sd": 5,
      "beyond_2sd_pct": 2.8
    },
    "outliers": {
      "count": 0,
      "pct": 0,
      "warning": false,
      "warning_text": "For normally distributed data, this should be no more than 0.3% of data above the error control line and no more than 4.6% above the warning control line. If some values are at low concentrations, try applying a threshold.",
      "label": "Outliers (beyond 3 SD)"
    },
    "bins": [
      {
        "x": -95,
        "low": -100,
        "high": -90,
        "count": 1,
        "density": 0.000565,
        "y": 0.000565
      },
      {
        "x": -85,
        "low": -90,
        "high": -80,
        "count": 0,
        "density": 0,
        "y": 0
      }
    ],
    "bin_width": 10,
    "limits": {
      "centre": -2.8440395480226,
      "warning_low": -74.1256786681551,
      "warning_high": 68.4375995721099,
      "action_low": -109.766498228221,
      "action_high": 104.078419132176,
      "unit": "SD",
      "ok": true
    },
    "x_min": -114.043396575429,
    "x_max": 108.355317479384,
    "median": 0,
    "mean": -2.8440395480226,
    "density": [
      {
        "x": -100,
        "y": 0.00107563667125374
      },
      {
        "x": -99.6086105675147,
        "y": 0.00105694964062838
      }
    ]
  }
}

What the spec holds

  • chart_type: “rd-density-histogram”.
  • meta: an object with lab, analyte, rd, density_mode, bins, facet, subtitle.
  • stats: an object with n, lld, threshold, mean, median, skew, kurtosis, beyond_2sd, beyond_2sd_pct.
  • outliers: an object with count, pct, warning, warning_text, label.
  • bins: a table of 20 rows, columns x, low, high, count, density, y.
  • bin_width: 10.
  • limits: an object with centre, warning_low, warning_high, action_low, action_high, unit, ok.
  • x_min: -114.0434.
  • x_max: 108.3553.
  • median: 0.
  • mean: -2.84404.
  • density: a table of 512 rows, columns x, y.

Relative difference against the normal distribution (Q-Q)

POST /v1/charts/qq-normal, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
stage string no Sample check stage (CHECKSTAGE_CK). Not needed with facet_by_stage.
facet_by_stage logical default false One panel per check stage.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
outlier_method string default sqc one of sqc, mad Control limits from the standard deviation (sqc) or the median absolute deviation (mad).
exclude_outliers logical default false Leave out the outlying pairs.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/qq-normal \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","stage":"Pulverising Stage","exclude_outliers":true}'

The answer (177 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "qq-normal",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "stage": "Pulverising Stage",
    "facet_by_stage": false,
    "rd_formula": "MPRD",
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "outlier_method": "sqc",
    "exclude_outliers": true
  },
  "rows_used": 177,
  "warnings": [],
  "spec": {
    "chart_type": "qq-normal",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "rd": "MPRD%",
      "facet": false,
      "subtitle": "Pulverising Stage   2022-11-16 to 2025-11-10"
    },
    "stats": {
      "n": 177,
      "lld": 0.01,
      "threshold": 0,
      "mean": -2.8,
      "median": 0,
      "skew": 0.1,
      "kurtosis": 0.8,
      "beyond_2sd": 5,
      "beyond_2sd_pct": 2.8
    },
    "outliers": {
      "count": 0,
      "pct": 0,
      "warning": false,
      "warning_text": "For normally distributed data, this should be no more than 0.3% of data above the error control line and no more than 4.6% above the warning control line. If some values are at low concentrations, try applying a threshold.",
      "label": "Outliers (beyond 3 SD)"
    },
    "points": [
      {
        "x": -101.199108171495,
        "y": -100,
        "outlier": false,
        "pair": "AC033120 : *REP AC033120",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10"
      },
      {
        "x": -87.7067598258681,
        "y": -66.667,
        "outlier": false,
        "pair": "CA018188 : *REP CA018188",
        "stage": "Pulverising Stage   2022-11-16 to 2025-11-10"
      }
    ],
    "band": [
      {
        "x": -101.199108171495,
        "low": -28.0040117777512,
        "high": -16.3718809226821
      },
      {
        "x": -87.7067598258681,
        "low": -23.516123685702,
        "high": -15.9652013225286
      }
    ],
    "line": [
      {
        "x": -101.199108171495,
        "y": -22.1879463502166
      },
      {
        "x": 95.5110290754493,
        "y": 13.4919463502166
      }
    ],
    "quartiles": [-8.696, 0, 0],
    "quartiles_rounded": [-8.7, 0, 0],
    "mean": -2.8440395480226,
    "median": 0,
    "limits": {
      "centre": -2.8440395480226,
      "warning_low": -74.1256786681551,
      "warning_high": 68.4375995721099,
      "action_low": -109.766498228221,
      "action_high": 104.078419132176,
      "unit": "SD",
      "ok": true
    },
    "x_min": -101.199108171495,
    "x_max": 95.5110290754493,
    "y_min": -116.181845749033,
    "y_max": 110.493766652988
  }
}

What the spec holds

  • chart_type: “qq-normal”.
  • meta: an object with lab, analyte, rd, facet, subtitle.
  • stats: an object with n, lld, threshold, mean, median, skew, kurtosis, beyond_2sd, beyond_2sd_pct.
  • outliers: an object with count, pct, warning, warning_text, label.
  • points: a table of 177 rows, columns x, y, outlier, pair, stage.
  • band: a table of 177 rows, columns x, low, high.
  • line: a table of 2 rows, columns x, y.
  • quartiles: a list of 3 values.
  • quartiles_rounded: a list of 3 values.
  • mean: -2.84404.
  • median: 0.
  • limits: an object with centre, warning_low, warning_high, action_low, action_high, unit, ok.
  • x_min: -101.1991.
  • x_max: 95.51103.
  • y_min: -116.1818.
  • y_max: 110.4938.

Sample 1 v Sample 2 quantiles (Q-Q)

POST /v1/charts/qq, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
stage string no Sample check stage (CHECKSTAGE_CK). Not needed with facet_by_stage.
facet_by_stage logical default false One panel per check stage.
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
exclude_outliers logical default false Leave out the outlying pairs.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/qq \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","stage":"Pulverising Stage"}'

The answer (177 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "qq",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "stage": "Pulverising Stage",
    "facet_by_stage": false,
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "exclude_outliers": false
  },
  "rows_used": 177,
  "warnings": [],
  "spec": {
    "chart_type": "qq",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "facet": false,
      "subtitle": "Pulverising Stage   2022-11-16 to 2025-11-10"
    },
    "stats": {
      "n": 177,
      "lld": 0.01,
      "threshold": 0,
      "mean": -2.8,
      "median": 0,
      "skew": 0.1,
      "kurtosis": 0.8,
      "beyond_2sd": 5,
      "beyond_2sd_pct": 2.8
    },
    "outliers": {
      "count": 0,
      "pct": 0,
      "warning": false,
      "warning_text": "For normally distributed data, this should be no more than 0.3% of data above the error control line and no more than 4.6% above the warning control line. If some values are at low concentrations, try applying a threshold.",
      "label": "Outliers (beyond 3 SD)"
    },
    "pairs": [
      {
        "rank": 1,
        "x": 0.01,
        "y": 0.01,
        "outlier": false
      },
      {
        "rank": 2,
        "x": 0.01,
        "y": 0.01,
        "outlier": false
      }
    ],
    "x_min": 0.01,
    "x_max": 3.69,
    "y_min": 0.01,
    "y_max": 2.94
  }
}

What the spec holds

  • chart_type: “qq”.
  • meta: an object with lab, analyte, facet, subtitle.
  • stats: an object with n, lld, threshold, mean, median, skew, kurtosis, beyond_2sd, beyond_2sd_pct.
  • outliers: an object with count, pct, warning, warning_text, label.
  • pairs: a table of 177 rows, columns rank, x, y, outlier.
  • x_min: 0.01.
  • x_max: 3.69.
  • y_min: 0.01.
  • y_max: 2.94.

Empirical cumulative distribution of the relative difference

POST /v1/charts/ecdf, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
stage string no Sample check stage (CHECKSTAGE_CK). Not needed with facet_by_stage.
facet_by_stage logical default false One panel per check stage.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
outlier_method string default sqc one of sqc, mad Control limits from the standard deviation (sqc) or the median absolute deviation (mad).

Example

curl -s https://api.geoscience-analytics.com/v1/charts/ecdf \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","stage":"Pulverising Stage"}'

The answer (177 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "ecdf",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "stage": "Pulverising Stage",
    "facet_by_stage": false,
    "rd_formula": "MPRD",
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "outlier_method": "sqc"
  },
  "rows_used": 177,
  "warnings": [],
  "spec": {
    "chart_type": "ecdf",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "rd": "MPRD%",
      "facet": false,
      "subtitle": "Pulverising Stage   2022-11-16 to 2025-11-10"
    },
    "stats": {
      "n": 177,
      "lld": 0.01,
      "threshold": 0,
      "mean": -2.8,
      "median": 0,
      "skew": 0.1,
      "kurtosis": 0.8,
      "beyond_2sd": 5,
      "beyond_2sd_pct": 2.8
    },
    "outliers": {
      "count": 0,
      "pct": 0,
      "warning": false,
      "warning_text": "For normally distributed data, this should be no more than 0.3% of data above the error control line and no more than 4.6% above the warning control line. If some values are at low concentrations, try applying a threshold.",
      "label": "Outliers (beyond 3 SD)"
    },
    "limits": {
      "centre": -2.8440395480226,
      "warning_low": -74.1256786681551,
      "warning_high": 68.4375995721099,
      "action_low": -109.766498228221,
      "action_high": 104.078419132176,
      "unit": "SD",
      "ok": true
    },
    "x_min": -109.766498228221,
    "x_max": 104.078419132176,
    "ecdf": [
      {
        "x": -109.766498228221,
        "y": 0,
        "count": 0,
        "pct": 0
      },
      {
        "x": -100,
        "y": 0.00564971751412429,
        "count": 1,
        "pct": 0.6
      }
    ],
    "theory": [
      {
        "x": -109.766498228221,
        "y": 0.00134989803163009
      },
      {
        "x": -108.691900653546,
        "y": 0.00148972961732063
      }
    ],
    "mean": -2.8440395480226,
    "median": 0
  }
}

What the spec holds

  • chart_type: “ecdf”.
  • meta: an object with lab, analyte, rd, facet, subtitle.
  • stats: an object with n, lld, threshold, mean, median, skew, kurtosis, beyond_2sd, beyond_2sd_pct.
  • outliers: an object with count, pct, warning, warning_text, label.
  • limits: an object with centre, warning_low, warning_high, action_low, action_high, unit, ok.
  • x_min: -109.7665.
  • x_max: 104.0784.
  • ecdf: a table of 44 rows, columns x, y, count, pct.
  • theory: a table of 200 rows, columns x, y.
  • mean: -2.84404.
  • median: 0.

Precision v concentration and Thompson-Howarth, every check stage

POST /v1/charts/thompson-howarth, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
exclude_outliers logical default false Leave out the outlying pairs.
th_chart string default both one of precision_v_concentration, thompson_howarth, both Which of the two charts.
th_y string default abs_diff one of abs_diff, abs_diff_root2
th_window integer default 11 9 to 21 Pairs per partition (odd).
th_nugget logical default false Partition by (A - B)^2 for the nugget effect.
th_robust logical default true Slope and intercept by robust regression.
th_log_log logical default false Log v log axes.
th_force_intercept logical default false Force a zero or negative intercept through a small value (0.01).
th_hide_pairs logical default false Leave out the pairs’ own points.
th_median_of_means logical default false Use the median of the means for concentration.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/thompson-howarth \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","th_chart":"both","th_robust":true}'

The answer (423 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "thompson-howarth",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "rd_formula": "MPRD",
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "exclude_outliers": false,
    "th_chart": "both",
    "th_y": "abs_diff",
    "th_window": 11,
    "th_nugget": false,
    "th_robust": true,
    "th_log_log": false,
    "th_force_intercept": false,
    "th_hide_pairs": false,
    "th_median_of_means": false
  },
  "rows_used": 423,
  "warnings": [],
  "spec": {
    "chart_type": "thompson-howarth",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "start_date": "2022-11-16",
      "end_date": "2025-11-10",
      "yaxis_label": "|A - B| (Partioned statistic: Median)",
      "chart_to_show": 3
    },
    "stats": {},
    "th": {
      "pairs": [
        {
          "original": 0.06,
          "duplicate": 0.06,
          "stage": "Crushing Stage",
          "y": 0,
          "x": 0.06,
          "type": "Pairs",
          "count": 110
        },
        {
          "original": 0.01,
          "duplicate": 0.02,
          "stage": "Crushing Stage",
          "y": 0.01,
          "x": 0.015,
          "type": "Pairs",
          "count": 110
        }
      ],
      "partitioned": [
        {
          "stage": "Crushing Stage",
          "x": 0.01,
          "y": 0,
          "count": 110,
          "type": "Partitioned"
        },
        {
          "stage": "Crushing Stage",
          "x": 0.0140909090909091,
          "y": 0.01,
          "count": 110,
          "type": "Partitioned"
        }
      ],
      "coef": [
        {
          "stage": "Crushing Stage",
          "slope": 2.65027197718679e-16,
          "intercept": 0.00999999999999999
        },
        {
          "stage": "Field Prep Stage",
          "slope": 0.282417582417582,
          "intercept": 0.00114885114885115
        }
      ],
      "pvc": [
        {
          "stage": "Crushing Stage (PDL:0.02  LOD:0.01)",
          "precision": 99.8434775035404,
          "concentration": 0.021
        },
        {
          "stage": "Crushing Stage (PDL:0.02  LOD:0.01)",
          "precision": 88.7497577809248,
          "concentration": 0.023625
        }
      ],
      "stage_labels": [
        {
          "stage": "Crushing Stage",
          "label": "Crushing Stage 110 pairs Intercept: 0.01"
        },
        {
          "stage": "Field Prep Stage",
          "label": "Field Prep Stage 38 pairs Intercept: 0.001"
        }
      ],
      "x_label": "Mean of Means",
      "log_log": false,
      "hide_raw": false,
      "use_robust": true,
      "sd_factor": 1.04835651378718
    },
    "panels": ["Crushing Stage", "Field Prep Stage", "Pulverising Stage - Comp", "Pulverising Stage", "Sampling Stage"],
    "fits": [
      {
        "stage": "Crushing Stage",
        "method": "lm",
        "x": 0.01,
        "y": 0.00760374091523862,
        "low": 0.00403876899118993,
        "high": 0.0111687128392873
      },
      {
        "stage": "Crushing Stage",
        "method": "lm",
        "x": 0.0133429228998849,
        "y": 0.00776250776758739,
        "low": 0.00425929074088492,
        "high": 0.0112657247942899
      }
    ]
  }
}

What the spec holds

  • chart_type: “thompson-howarth”.
  • meta: an object with lab, analyte, start_date, end_date, yaxis_label, chart_to_show.
  • stats: an object with ``.
  • th: an object with pairs, partitioned, coef, pvc, stage_labels, x_label, log_log, hide_raw, use_robust, sd_factor.
  • panels: a list of 5 values.
  • fits: a table of 640 rows, columns stage, method, x, y, low, high.

Relative difference box plots, every analyte

POST /v1/charts/rd-box-whiskers, of a precision dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
rd_formula string default mprd one of MPRD, CV, HARD, ARD, RDHYSLOP Relative difference formula (see the methods).
threshold_factor number default 0 0 to 1000 Pairs with a mean below this many times the lower detection limit are set apart; 0 uses every pair.
apply_upper_detection logical default false Leave out pairs above the upper detection limit.
facet_by_stage_box logical default false One panel per check stage.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/rd-box-whiskers \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","facet_by_stage_box":true}'

The answer (29,497 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "rd-box-whiskers",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "date_type": "return",
    "rd_formula": "MPRD",
    "threshold_factor": 0,
    "apply_upper_detection": false,
    "facet_by_stage_box": true
  },
  "rows_used": 29497,
  "warnings": [],
  "spec": {
    "chart_type": "rd-box-whiskers",
    "meta": {
      "lab": "ALS",
      "start_date": "2022-11-16",
      "end_date": "2025-11-10",
      "rd": "MPRD%",
      "ylabelformula": "(a-b)/((a+b)/2)*100",
      "facet": true,
      "category_by": "ASSAYNAME",
      "group_by": "CHECKSTAGE_CK"
    },
    "stats": {},
    "stage_levels": ["Crushing Stage", "Field Prep Stage", "Pulverising Stage", "Pulverising Stage - Comp", "Sampling Stage"],
    "panels": [
      {
        "stage": "Crushing Stage",
        "slot": 0.8
      },
      {
        "stage": "Field Prep Stage",
        "slot": 0.8
      }
    ],
    "categories": [
      {
        "panel": 1,
        "name": "Ag_MEICP41s_ppm"
      },
      {
        "panel": 1,
        "name": "Ag_MEICP61s_ppm"
      }
    ],
    "boxes": [
      {
        "panel": 1,
        "x": 0,
        "low": -54.54,
        "q1": -15.83,
        "median": 0,
        "q3": 6.31,
        "high": 50,
        "category": "Ag_MEICP41s_ppm",
        "stage": "Crushing Stage",
        "n": 114
      },
      {
        "panel": 1,
        "x": 1,
        "low": -26.09,
        "q1": -26.09,
        "median": -26.09,
        "q3": -26.09,
        "high": -26.09,
        "category": "Ag_MEICP61s_ppm",
        "stage": "Crushing Stage",
        "n": 1
      }
    ],
    "outliers": [
      {
        "panel": 1,
        "x": 0,
        "y": 66.667,
        "category": "Ag_MEICP41s_ppm",
        "stage": "Crushing Stage",
        "pair": "AC033383 : AC033384"
      },
      {
        "panel": 1,
        "x": 0,
        "y": -66.667,
        "category": "Ag_MEICP41s_ppm",
        "stage": "Crushing Stage",
        "pair": "AC034336 : AC034337"
      }
    ]
  }
}

What the spec holds

  • chart_type: “rd-box-whiskers”.
  • meta: an object with lab, start_date, end_date, rd, ylabelformula, facet, category_by, group_by.
  • stats: an object with ``.
  • stage_levels: a list of 5 values.
  • panels: a table of 5 rows, columns stage, slot.
  • categories: a table of 425 rows, columns panel, name.
  • boxes: a table of 425 rows, columns panel, x, low, q1, median, q3, high, category, stage, n.
  • outliers: a table of 4055 rows, columns panel, x, y, category, stage, pair.

Shewhart control chart of a CRM, with Nelson rules

POST /v1/charts/shewhart, of an accuracy dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
x_axis string default check_id one of check_id, lab_job, despatch, date What the points are in order of.
smoothing_span number default 50 10 to 100 Span of the trend line, as a % of the points.
crm_type string yes Standard type (STANDARDTYPE).
crms strings yes Standard id (STANDARDID); several for z-score and crm-box-whiskers (a box each), the first is used elsewhere.
use_certified_values logical default false Use the certified value and SD the data gives, not ones computed from the results.
nelson_rules logical default false Test the eight Nelson rules.
change_points logical default false Find the shifts in the results (Taylor’s change-point analysis): each with its place, confidence and the mean before and after (API 1.1).

Example

curl -s https://api.geoscience-analytics.com/v1/charts/shewhart \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","crm_type":"LAB_STD","crms":["ALS-26"],"nelson_rules":true}'

The answer (147 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "shewhart",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "x_axis": "check_id",
    "smoothing_span": 50,
    "crm_type": "LAB_STD",
    "crms": ["ALS-26"],
    "use_certified_values": false,
    "nelson_rules": true,
    "change_points": false
  },
  "rows_used": 147,
  "warnings": [],
  "spec": {
    "chart_type": "shewhart",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "crm": "ALS-26",
      "x_axis": "check_id",
      "date_type": null,
      "nelson_rules": true
    },
    "points": [
      {
        "index": 1,
        "x": 1,
        "value": 2.67,
        "check_id": "ALS-26_09049466_45",
        "lab_job": "MI09049466",
        "despatch": "3171",
        "analyte": "Au_AA25_ppm",
        "band": "ok",
        "outlier": false,
        "rule_1": false,
        "rule_2": false,
        "rule_3": false,
        "rule_4": false,
        "rule_5": false,
        "rule_6": false,
        "rule_7": false,
        "rule_8": false
      },
      {
        "index": 2,
        "x": 2,
        "value": 2.64,
        "check_id": "ALS-26_09079517_26",
        "lab_job": "AL09079517",
        "despatch": "28101",
        "analyte": "Au_AA25_ppm",
        "band": "ok",
        "outlier": false,
        "rule_1": false,
        "rule_2": false,
        "rule_3": false,
        "rule_4": false,
        "rule_5": false,
        "rule_6": false,
        "rule_7": false,
        "rule_8": false
      }
    ],
    "certified_value": 2.64,
    "mean": 2.6391156462585,
    "median": 2.64,
    "limits": {
      "centre": 2.6391156462585,
      "warning_low": 2.5191173547166,
      "warning_high": 2.75911393780041,
      "action_low": 2.45911820894565,
      "action_high": 2.81911308357136,
      "unit": "SD",
      "ok": true
    },
    "sd": 0.0599991457709514,
    "trend": null,
    "nelson": [
      {
        "rule": 1,
        "description": "One point is more than 3 standard deviations from the expected value (outlier)",
        "status": "FAIL"
      },
      {
        "rule": 2,
        "description": "Nine (or more) points in sequentially on the same side of the expected value (shift)",
        "status": "PASS"
      }
    ],
    "stats": {
      "computed_mean": 2.639,
      "computed_sd": 0.06,
      "n": 147,
      "pct_outside_2sd": 8.8,
      "pct_outside_3sd": 0.7
    }
  }
}

What the spec holds

  • chart_type: “shewhart”.
  • meta: an object with lab, analyte, crm, x_axis, date_type, nelson_rules.
  • points: a table of 147 rows, columns index, x, value, check_id, lab_job, despatch, analyte, band, outlier, rule_1, rule_2, rule_3, rule_4, rule_5, rule_6, rule_7, rule_8.
  • certified_value: 2.64.
  • mean: 2.639116.
  • median: 2.64.
  • limits: an object with centre, warning_low, warning_high, action_low, action_high, unit, ok.
  • sd: 0.05999915.
  • trend: null here.
  • nelson: a table of 8 rows, columns rule, description, status.
  • stats: an object with computed_mean, computed_sd, n, pct_outside_2sd, pct_outside_3sd.

CUSUM of a CRM

POST /v1/charts/cusum, of an accuracy dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
x_axis string default check_id one of check_id, lab_job, despatch, date What the points are in order of.
crm_type string yes Standard type (STANDARDTYPE).
crms strings yes Standard id (STANDARDID); several for z-score and crm-box-whiskers (a box each), the first is used elsewhere.
use_certified_values logical default false Use the certified value and SD the data gives, not ones computed from the results.
change_points logical default false Find the shifts in the results (Taylor’s change-point analysis): each with its place, confidence and the mean before and after (API 1.1).
decision_interval number default 3 1 to 5 CUSUM decision interval H, x SD.
shift number default 0.5 0.5 to 3 CUSUM shift to detect k, x SD.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/cusum \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","crm_type":"LAB_STD","crms":["ALS-26"],"decision_interval":3,"shift":0.5}'

The answer (147 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "cusum",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "x_axis": "check_id",
    "crm_type": "LAB_STD",
    "crms": ["ALS-26"],
    "use_certified_values": false,
    "change_points": false,
    "decision_interval": 3,
    "shift": 0.5
  },
  "rows_used": 147,
  "warnings": [],
  "spec": {
    "chart_type": "cusum",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "crm": "ALS-26",
      "x_axis": "check_id",
      "date_type": null
    },
    "points": [
      {
        "index": 1,
        "x": 1,
        "value": 2.67,
        "check_id": "ALS-26_09049466_45",
        "lab_job": "MI09049466",
        "despatch": "3171",
        "analyte": "Au_AA25_ppm",
        "cusum_above": 0.000884780856020839,
        "above_outlier": false,
        "cusum_below": 0,
        "below_outlier": false
      },
      {
        "index": 2,
        "x": 2,
        "value": 2.64,
        "check_id": "ALS-26_09079517_26",
        "lab_job": "AL09079517",
        "despatch": "28101",
        "analyte": "Au_AA25_ppm",
        "cusum_above": 0,
        "above_outlier": false,
        "cusum_below": 0,
        "below_outlier": false
      }
    ],
    "target": 2.6391156462585,
    "sd": 0.0599991457709514,
    "k": 0.0299995728854757,
    "control_line": 0.179997437312854,
    "stats": {
      "target_computed": 2.639,
      "sd_computed": 0.06,
      "k": 0.5,
      "h": 3,
      "n": 147
    }
  }
}

What the spec holds

  • chart_type: “cusum”.
  • meta: an object with lab, analyte, crm, x_axis, date_type.
  • points: a table of 147 rows, columns index, x, value, check_id, lab_job, despatch, analyte, cusum_above, above_outlier, cusum_below, below_outlier.
  • target: 2.639116.
  • sd: 0.05999915.
  • k: 0.02999957.
  • control_line: 0.1799974.
  • stats: an object with target_computed, sd_computed, k, h, n.

EWMA of a CRM

POST /v1/charts/ewma, of an accuracy dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
x_axis string default check_id one of check_id, lab_job, despatch, date What the points are in order of.
crm_type string yes Standard type (STANDARDTYPE).
crms strings yes Standard id (STANDARDID); several for z-score and crm-box-whiskers (a box each), the first is used elsewhere.
use_certified_values logical default false Use the certified value and SD the data gives, not ones computed from the results.
lambda number default 0.2 0.05 to 1 EWMA weight.
sigmas number default 2.5 1 to 4 EWMA control lines, x sigma.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/ewma \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","crm_type":"LAB_STD","crms":["ALS-26"],"lambda":0.2,"sigmas":2.5}'

The answer (147 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "ewma",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "x_axis": "check_id",
    "crm_type": "LAB_STD",
    "crms": ["ALS-26"],
    "use_certified_values": false,
    "lambda": 0.2,
    "sigmas": 2.5
  },
  "rows_used": 147,
  "warnings": [],
  "spec": {
    "chart_type": "ewma",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "crm": "ALS-26",
      "x_axis": "check_id",
      "date_type": null
    },
    "points": [
      {
        "index": 1,
        "x": 1,
        "value": 2.67,
        "check_id": "ALS-26_09049466_45",
        "lab_job": "MI09049466",
        "despatch": "3171",
        "analyte": "Au_AA25_ppm",
        "ewma": 2.6452925170068,
        "upper": 2.66911521914398,
        "lower": 2.60911607337303,
        "outlier": false
      },
      {
        "index": 2,
        "x": 2,
        "value": 2.64,
        "check_id": "ALS-26_09079517_26",
        "lab_job": "AL09079517",
        "despatch": "28101",
        "analyte": "Au_AA25_ppm",
        "ewma": 2.64423401360544,
        "upper": 2.67753384470963,
        "lower": 2.60069744780738,
        "outlier": false
      }
    ],
    "target": 2.6391156462585,
    "sd": 0.0599991457709514,
    "lambda": 0.2,
    "sigmas": 2.5,
    "stats": {
      "target_computed": 2.639,
      "sd_computed": 0.06,
      "lambda": 0.2,
      "sigmas": 2.5
    }
  }
}

What the spec holds

  • chart_type: “ewma”.
  • meta: an object with lab, analyte, crm, x_axis, date_type.
  • points: a table of 147 rows, columns index, x, value, check_id, lab_job, despatch, analyte, ewma, upper, lower, outlier.
  • target: 2.639116.
  • sd: 0.05999915.
  • lambda: 0.2.
  • sigmas: 2.5.
  • stats: an object with target_computed, sd_computed, lambda, sigmas.

Shewhart, CUSUM and EWMA of a CRM together

POST /v1/charts/all-time-series, of an accuracy dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
crm_type string yes Standard type (STANDARDTYPE).
crms strings yes Standard id (STANDARDID); several for z-score and crm-box-whiskers (a box each), the first is used elsewhere.
use_certified_values logical default false Use the certified value and SD the data gives, not ones computed from the results.
decision_interval number default 3 1 to 5 CUSUM decision interval H, x SD.
shift number default 0.5 0.5 to 3 CUSUM shift to detect k, x SD.
lambda number default 0.2 0.05 to 1 EWMA weight.
sigmas number default 2.5 1 to 4 EWMA control lines, x sigma.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/all-time-series \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","crm_type":"LAB_STD","crms":["ALS-26"]}'

The answer (147 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "all-time-series",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "crm_type": "LAB_STD",
    "crms": ["ALS-26"],
    "use_certified_values": false,
    "decision_interval": 3,
    "shift": 0.5,
    "lambda": 0.2,
    "sigmas": 2.5
  },
  "rows_used": 147,
  "warnings": [],
  "spec": {
    "chart_type": "all-time-series",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "crm": "ALS-26"
    },
    "shewhart": {
      "chart_type": "shewhart",
      "meta": {
        "lab": "ALS",
        "analyte": "Au_AA25_ppm",
        "crm": "ALS-26",
        "x_axis": "check_id",
        "date_type": null,
        "nelson_rules": false
      },
      "points": [
        {
          "index": 1,
          "x": 1,
          "value": 2.67,
          "check_id": "ALS-26_09049466_45",
          "lab_job": "MI09049466",
          "despatch": "3171",
          "analyte": "Au_AA25_ppm",
          "band": "ok",
          "outlier": false,
          "rule_1": false,
          "rule_2": false,
          "rule_3": false,
          "rule_4": false,
          "rule_5": false,
          "rule_6": false,
          "rule_7": false,
          "rule_8": false
        },
        {
          "index": 2,
          "x": 2,
          "value": 2.64,
          "check_id": "ALS-26_09079517_26",
          "lab_job": "AL09079517",
          "despatch": "28101",
          "analyte": "Au_AA25_ppm",
          "band": "ok",
          "outlier": false,
          "rule_1": false,
          "rule_2": false,
          "rule_3": false,
          "rule_4": false,
          "rule_5": false,
          "rule_6": false,
          "rule_7": false,
          "rule_8": false
        }
      ],
      "certified_value": 2.64,
      "mean": 2.6391156462585,
      "median": 2.64,
      "limits": {
        "centre": 2.6391156462585,
        "warning_low": 2.5191173547166,
        "warning_high": 2.75911393780041,
        "action_low": 2.45911820894565,
        "action_high": 2.81911308357136,
        "unit": "SD",
        "ok": true
      },
      "sd": 0.0599991457709514,
      "trend": null,
      "nelson": [
        {
          "rule": 1,
          "description": "One point is more than 3 standard deviations from the expected value (outlier)",
          "status": null
        },
        {
          "rule": 2,
          "description": "Nine (or more) points in sequentially on the same side of the expected value (shift)",
          "status": null
        }
      ],
      "stats": {
        "computed_mean": 2.639,
        "computed_sd": 0.06,
        "n": 147,
        "pct_outside_2sd": 8.8,
        "pct_outside_3sd": 0.7
      }
    },
    "cusum": {
      "chart_type": "cusum",
      "meta": {
        "lab": "ALS",
        "analyte": "Au_AA25_ppm",
        "crm": "ALS-26",
        "x_axis": "check_id",
        "date_type": null
      },
      "points": [
        {
          "index": 1,
          "x": 1,
          "value": 2.67,
          "check_id": "ALS-26_09049466_45",
          "lab_job": "MI09049466",
          "despatch": "3171",
          "analyte": "Au_AA25_ppm",
          "cusum_above": 0.000884780856020839,
          "above_outlier": false,
          "cusum_below": 0,
          "below_outlier": false
        },
        {
          "index": 2,
          "x": 2,
          "value": 2.64,
          "check_id": "ALS-26_09079517_26",
          "lab_job": "AL09079517",
          "despatch": "28101",
          "analyte": "Au_AA25_ppm",
          "cusum_above": 0,
          "above_outlier": false,
          "cusum_below": 0,
          "below_outlier": false
        }
      ],
      "target": 2.6391156462585,
      "sd": 0.0599991457709514,
      "k": 0.0299995728854757,
      "control_line": 0.179997437312854,
      "stats": {
        "target_computed": 2.639,
        "sd_computed": 0.06,
        "k": 0.5,
        "h": 3,
        "n": 147
      }
    },
    "ewma": {
      "chart_type": "ewma",
      "meta": {
        "lab": "ALS",
        "analyte": "Au_AA25_ppm",
        "crm": "ALS-26",
        "x_axis": "check_id",
        "date_type": null
      },
      "points": [
        {
          "index": 1,
          "x": 1,
          "value": 2.67,
          "check_id": "ALS-26_09049466_45",
          "lab_job": "MI09049466",
          "despatch": "3171",
          "analyte": "Au_AA25_ppm",
          "ewma": 2.6452925170068,
          "upper": 2.66911521914398,
          "lower": 2.60911607337303,
          "outlier": false
        },
        {
          "index": 2,
          "x": 2,
          "value": 2.64,
          "check_id": "ALS-26_09079517_26",
          "lab_job": "AL09079517",
          "despatch": "28101",
          "analyte": "Au_AA25_ppm",
          "ewma": 2.64423401360544,
          "upper": 2.67753384470963,
          "lower": 2.60069744780738,
          "outlier": false
        }
      ],
      "target": 2.6391156462585,
      "sd": 0.0599991457709514,
      "lambda": 0.2,
      "sigmas": 2.5,
      "stats": {
        "target_computed": 2.639,
        "sd_computed": 0.06,
        "lambda": 0.2,
        "sigmas": 2.5
      }
    },
    "stats": []
  }
}

What the spec holds

  • chart_type: “all-time-series”.
  • meta: an object with lab, analyte, crm.
  • shewhart: an object with chart_type, meta, points, certified_value, mean, median, limits, sd, trend, nelson, stats.
  • cusum: an object with chart_type, meta, points, target, sd, k, control_line, stats.
  • ewma: an object with chart_type, meta, points, target, sd, lambda, sigmas, stats.
  • stats: a list of 0.

CRM results as box plots

POST /v1/charts/crm-box-whiskers, of an accuracy dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
crm_type string yes Standard type (STANDARDTYPE).
crms strings yes Standard id (STANDARDID); several for z-score and crm-box-whiskers (a box each), the first is used elsewhere.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/crm-box-whiskers \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","crm_type":"LAB_STD","crms":["ALS-26"]}'

The answer (147 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "crm-box-whiskers",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "crm_type": "LAB_STD",
    "crms": ["ALS-26"]
  },
  "rows_used": 147,
  "warnings": [],
  "spec": {
    "chart_type": "crm-box-whiskers",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "start_date": "2022-11-16",
      "end_date": "2025-11-12",
      "whisker_coef": 2
    },
    "crms": ["ALS-26"],
    "boxes": [
      {
        "crm": "ALS-26",
        "x": 0,
        "low": 2.51,
        "q1": 2.615,
        "median": 2.64,
        "q3": 2.67,
        "high": 2.77
      }
    ],
    "too_few": [],
    "min_results": 5,
    "points": [
      {
        "crm": "ALS-26",
        "x": 0,
        "jitter": -0.07034740105737,
        "value": 2.67,
        "check_id": "ALS-26_09049466_45",
        "lab_job": "MI09049466",
        "despatch": "3171",
        "date": "2024-06-09"
      },
      {
        "crm": "ALS-26",
        "x": 0,
        "jitter": -0.038362830108963,
        "value": 2.64,
        "check_id": "ALS-26_09079517_26",
        "lab_job": "AL09079517",
        "despatch": "28101",
        "date": "2024-08-28"
      }
    ],
    "stats": []
  }
}

What the spec holds

  • chart_type: “crm-box-whiskers”.
  • meta: an object with lab, analyte, start_date, end_date, whisker_coef.
  • crms: “ALS-26”.
  • boxes: a table of 1 rows, columns crm, x, low, q1, median, q3, high.
  • too_few: a table of 0 rows, columns crm, n.
  • min_results: 5.
  • points: a table of 147 rows, columns crm, x, jitter, value, check_id, lab_job, despatch, date.
  • stats: a list of 0.

Z-scores of one or more CRMs

POST /v1/charts/z-score, of an accuracy dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
x_axis string default check_id one of check_id, lab_job, despatch, date What the points are in order of.
crm_type string yes Standard type (STANDARDTYPE).
crms strings yes Standard id (STANDARDID); several for z-score and crm-box-whiskers (a box each), the first is used elsewhere.
use_certified_values logical default false Use the certified value and SD the data gives, not ones computed from the results.
group_by_crm logical default true Points grouped by CRM.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/z-score \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","crm_type":"LAB_STD","crms":["ALS-26","ST-327"]}'

The answer (251 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "z-score",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "x_axis": "check_id",
    "crm_type": "LAB_STD",
    "crms": ["ALS-26", "ST-327"],
    "use_certified_values": false,
    "group_by_crm": true
  },
  "rows_used": 251,
  "warnings": [],
  "spec": {
    "chart_type": "z-score",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "x_axis": "check_id",
      "date_type": null,
      "group_by_crm": true,
      "crm_values": false
    },
    "crms": [
      {
        "crm": "ALS-26",
        "sd": 0.0599991457709514,
        "sd_source": "computed"
      },
      {
        "crm": "ST-327",
        "sd": 0.232140010159072,
        "sd_source": "computed"
      }
    ],
    "points": [
      {
        "crm": "ALS-26",
        "x": 1,
        "z": 0.5,
        "band": "ok",
        "outlier": false,
        "value": 2.67,
        "certified_value": 2.64,
        "sd": 0.0599991457709514,
        "sd_source": "computed",
        "check_id": "ALS-26_09049466_45",
        "lab_job": "MI09049466",
        "despatch": "3171",
        "date": "2024-06-09"
      },
      {
        "crm": "ALS-26",
        "x": 2,
        "z": 0,
        "band": "ok",
        "outlier": false,
        "value": 2.64,
        "certified_value": 2.64,
        "sd": 0.0599991457709514,
        "sd_source": "computed",
        "check_id": "ALS-26_09079517_26",
        "lab_job": "AL09079517",
        "despatch": "28101",
        "date": "2024-08-28"
      }
    ],
    "excluded": [],
    "no_results": [],
    "stats": {
      "n": 251,
      "beyond_2sd": 18,
      "beyond_3sd": 1,
      "passed": 233,
      "warning": 17,
      "failed": 1
    }
  }
}

What the spec holds

  • chart_type: “z-score”.
  • meta: an object with lab, analyte, x_axis, date_type, group_by_crm, crm_values.
  • crms: a table of 2 rows, columns crm, sd, sd_source.
  • points: a table of 251 rows, columns crm, x, z, band, outlier, value, certified_value, sd, sd_source, check_id, lab_job, despatch, date.
  • excluded: a list of 0 values.
  • no_results: a list of 0 values.
  • stats: an object with n, beyond_2sd, beyond_3sd, passed, warning, failed.

Blank results against a warning level

POST /v1/charts/blanks, of an accuracy dataset.

Parameters

Parameter Type Required Values What
dataset_id string yes The id from POST /v1/datasets.
lab string yes Laboratory code.
analyte string yes Assay name (ASSAYNAME).
suite string no Analysis suite; leave out for every suite.
date_type string default return one of return, send Which date the date range and date axis use: laboratory return or despatch send.
date_from date no First date (YYYY-MM-DD); leave out for the dataset’s first.
date_to date no Last date (YYYY-MM-DD); leave out for the dataset’s last.
despatches strings no Despatch numbers to chart instead of a date range.
crm_type string yes Standard type (STANDARDTYPE).
crms strings yes Standard id (STANDARDID); several for z-score and crm-box-whiskers (a box each), the first is used elsewhere.
warning_factor number default 5 1 to 20 Warning level, x the lower detection limit.

Example

curl -s https://api.geoscience-analytics.com/v1/charts/blanks \
  -H "Authorization: Bearer $QC_API_KEY" -H "Content-Type: application/json" \
  -d '{"dataset_id":"<dataset_id>","lab":"ALS","analyte":"Au_AA25_ppm","crm_type":"COMPANY_BLANK","crms":["FB"],"warning_factor":5}'

The answer (6 rows used; tables cut to two rows here):

{
  "api_version": "1.1.0",
  "chart": "blanks",
  "dataset_id": "<dataset_id>",
  "parameters": {
    "lab": "ALS",
    "analyte": "Au_AA25_ppm",
    "date_type": "return",
    "crm_type": "COMPANY_BLANK",
    "crms": ["FB"],
    "warning_factor": 5
  },
  "rows_used": 6,
  "warnings": [],
  "spec": {
    "chart_type": "blanks",
    "meta": {
      "lab": "ALS",
      "analyte": "Au_AA25_ppm",
      "crm": "FB",
      "start_date": "2022-11-16",
      "end_date": "2025-11-12",
      "warning_factor": 5
    },
    "points": [
      {
        "x": 0,
        "value": 0.02,
        "check_id": "AC031209",
        "lab_job": "MI09140441",
        "despatch": "31182",
        "crm": "FB",
        "date": "2025-01-28",
        "lld_multiple": 2,
        "above_warning": false,
        "below_detection": false
      },
      {
        "x": 1,
        "value": 0.02,
        "check_id": "AC033527",
        "lab_job": "MI10015047",
        "despatch": "33462",
        "crm": "FB",
        "date": "2025-03-11",
        "lld_multiple": 2,
        "above_warning": false,
        "below_detection": false
      }
    ],
    "warning_value": 0.05,
    "lld": 0.01,
    "mixed_lld": false,
    "lld_min": 0.01,
    "lld_max": 0.01,
    "certified_value": 0.06,
    "stats": {
      "n": 6,
      "above_warning": 1,
      "pct_above_warning": 16.7
    }
  }
}

What the spec holds

  • chart_type: “blanks”.
  • meta: an object with lab, analyte, crm, start_date, end_date, warning_factor.
  • points: a table of 6 rows, columns x, value, check_id, lab_job, despatch, crm, date, lld_multiple, above_warning, below_detection.
  • warning_value: 0.05.
  • lld: 0.01.
  • mixed_lld: FALSE.
  • lld_min: 0.01.
  • lld_max: 0.01.
  • certified_value: 0.06.
  • stats: an object with n, above_warning, pct_above_warning.