See Configuration main chapter for more info
$ cp .env.example .env
$ docker build . -t automukit_api
$ docker run -it -p 3040:3040 automukit_api
You will need node & npm installed in your environment.
See Configuration main chapter for more info
$ cp .env.example .env
$ npm install
$ npm run dev
$ npm run build
$ npm start
This is a very simple way of keeping the API running on Linux. If the process dies then cron will restart it within a minute.
$ crontab -e
* * * * * cd /path/to/automukit_api && ./start.sh
Following settings can be configured using the .env file or environmental variables
SERVER_PORT - The port number for the express server
BASE_URL - The base url string for the web UI (used for script and css paths)
PRECISION - The max precision number in digits (amount of decimals) for result numbers
DEBUG - More verbose console output boolean (true | false)
For local installation, browse to http://localhost:3040
AutoMUKit API only has one endpoint which can be accessed using the url path root. Requests need to have Content-Type: application/json
header set.
{
replicateSamples: number[][],
references: {
value: number,
uncertainty: number,
controlSamples: number[]
}[],
ranges: {
mode: "relative" | "absolute",
min: number,
max: number,
coverageFactor: number,
replicateSamplesMin: number,
controlSamplesMin: number
}[]
}
replicateSamples
: Routine replicate samplesreferences
: Certified reference materialsvalue
: Certified concentrationuncertainty
: Standard uncertainty of certified concentration as absolute valuecontrolSamples
: CRM
ranges
: Concentration rangesmode
: Calculation modemin
: Minimum valuemax
: Maximum valuecoverageFactor
: Coverage factor kreplicateSamplesMin
: Minimum amount of replicate seriescontrolSamplesMin
: Minimum amount of CRM results
The run could not be completed: API returns status code 400 if request format validation fails or 422 if the calculation fails because of an program error.
{
errors: string[]
}
Successful run responds with array of results (one result object per concentration range). The result contains only range
and errors
attributes if the calculation for a range couldn't be completed. For successful calculation only the range
, uRw
, ub
, uncertainty
and expandedUncertainty
attributes will be present.
{
range: {
mode: "relative" | "absolute",
min: number,
max: number,
coverageFactor: number,
replicateSamplesMin: number,
controlSamplesMin: number
},
uRw?: number,
ub?: number,
uncertainty?: number,
expandedUncertainty?: number
errors?: string[]
}[]
range
: Concentration rangemode
: Calculation modemin
: Minimum valuemax
: Maximum valuecoverageFactor
: Coverage factor kreplicateSamplesMin
: Minimum amount of replicate seriescontrolSamplesMin
: Minimum amount of CRM results
uRw
: Within-laboratory reproducibility, u(Rw)ub
: Method and laboratory bias, u(bias)uncertainty
: Combined standard uncertainty, ucexpandedUncertainty
: Expanded uncertainty, Uerrors
: Calculation errors
The value from the certificate or the theoretical concentration for the certified reference material.
The uncertainty of the certified value is calculated from the confidence interval given in the certificate. For example if the CRM certificate shows 11.5 +- 0.5 µg/l (95 %, k=2) then u(Cref) = 0.5 µg/l / 2 = 0.25 µg/l = 2.17 %. If the control sample is not certified but its uncertainty can be solved from how it was prepared, the control sample can be used instead of the CRM.
Normally the measurement uncertainty is changing depending on the concentration. Therefore, it is recommended to divide the measurement range so that the absolute or relative uncertainty remains close to constant for each range.
Relationship between (a) absolute measurement uncertainty and concentration, and (b) relative measurement uncertainty and concentration. Division of the measurement range (c) at the dashed line into a low range where the absolute measurement uncertainty is constant and a high range where the relative measurement uncertainty is approximately constant.
Measurement uncertainty should normally be expressed as U, the expanded measurement uncertainty, with a stated confidence level and a coverage factor, k. In most cases k = 2, providing a level of confidence of approximately 95 %
In order to have a representative basis for the uncertainty estimation the number of results should ideally be more than 60.
Regular measurement of one or several CRM can be used to estimate the bias. Each reference material should be measured on 5 different analytical series before the values are used.
$ npm test