Distance query
To query for a sample's distance to others in the DB the request looks like:
curl -H "Content-Type: application/json" -X POST -d '{ "sample_id": "1"}' localhost:8080/distance
Output should looks something like:
{"type": "distance", "result": {"1": 10752, "7": 8103, "8": 7584, "4": 12553, "0": 10122, "3": 6876, "5": 5941, "2": 7926, "6": 12575}}
Where distance is the SNP distance of the query sample to the sample in the database.
Distance to the core tree
curl -H "Content-Type: application/json" -X POST -d '{"sample_id": "sample_id", "distance_type":"tree-distance"}' localhost:8080/distance
Output will look like:
{
"type": "distance",
"subType": "tree-distance",
"result": {"5b7c030cdd91c500105196b0": 4636,
"5b7c030cdd91c500105196b1": 6680,
"5b7c030cdd91c500105196b2": 9764
}
}
Distance to nearest-neighbours (top10)
curl -H "Content-Type: application/json" -X POST -d '{"sample_id": "sample_id", "distance_type":"nearest-neighbour"}' localhost:8080/distance
{
"type": "distance",
"result": {
"0": 9093,
"1": 6680,
"2": 4636,
"3": 9764,
"4": 9150,
"5": 1001,
"6": 5686,
"7": 1706,
"8": 9623,
"9": 6486
},
"subType": "nearest-neighbour"
}
Updated less than a minute ago