From 0d8486acd7556737f3b0ff4babb8e3dfc2211ec9 Mon Sep 17 00:00:00 2001 From: Andrew Olson Date: Fri, 18 Mar 2016 17:56:27 -0400 Subject: [PATCH] speciestree --- api/swagger/swagger.yaml | 92 +++++++++++++++++++++++++++++++++++++++- npm-shrinkwrap.json | 12 +++--- package.json | 2 +- 3 files changed, 98 insertions(+), 8 deletions(-) diff --git a/api/swagger/swagger.yaml b/api/swagger/swagger.yaml index 5ce3938..4d948e0 100644 --- a/api/swagger/swagger.yaml +++ b/api/swagger/swagger.yaml @@ -1,6 +1,6 @@ swagger: "2.0" info: - version: "0.50.8-zm4.1" + version: "0.50.8-zm4.2" title: Gramene API for maizev4 # basePath prefixes all resource paths basePath: /zm4/v50 @@ -219,6 +219,26 @@ paths: description: "MongoDB response object" schema: $ref: "#/definitions/MongoGenetreesResponse" + /speciestrees: + x-swagger-router-controller: mongo + get: + summary: "MongoDB" + operationId: speciestrees + description: "Fetch documents from a collection" + parameters: + - $ref: "#/parameters/q" + - $ref: "#/parameters/rows" + - $ref: "#/parameters/start" + - $ref: "#/parameters/fl" + - $ref: "#/parameters/wt" + - $ref: "#/parameters/idList" + tags: + - "Data access" + responses: + 200: + description: "MongoDB response object" + schema: + $ref: "#/definitions/MongoSpeciestreesResponse" /maps: x-swagger-router-controller: mongo get: @@ -1013,6 +1033,72 @@ definitions: type: integer minimum: 0 + MongoSpeciestreesResponse: + type: 'array' + items: + $ref: '#/definitions/SpeciestreeRootNode' + + SpeciestreeRootNode: + allOf: + - $ref: '#/definitions/SpeciestreeNode' + - + required: + - root_id + - compara_db + properties: + root_id: + type: integer + minimum: 0 + compara_db: + type: string + + SpeciestreeNode: + allOf: + - $ref: '#/definitions/SpeciestreeInternalNode' + - $ref: '#/definitions/SpeciestreeLeafNode' + - + required: + - node_id + - distance_to_parent + - left_index + - right_index + - taxon_id + - taxon_name + - num_genes + properties: + node_id: + type: integer + minimum: 0 + distance_to_parent: + type: number + minimum: 0.0 + left_index: + type: integer + minimum: 0 + right_index: + type: integer + taxon_id: + type: integer + minimum: 0 + taxon_name: + type: string + minimum: 0 + num_genes: + type: integer + minimum: 0 + + SpeciestreeInternalNode: + properties: + children: + type: array + items: + $ref: '#/definitions/SpeciestreeNode' + + SpeciestreeLeafNode: + properties: + system_name: + type: string + MongoGenetreesResponse: type: 'array' items: @@ -1027,6 +1113,7 @@ definitions: - tree_id - tree_stable_id - tree_type + - compara_db properties: root_id: type: integer @@ -1040,6 +1127,9 @@ definitions: enum: - 'tree' - 'supertree' + compara_db: + type: string + GenetreeNode: allOf: - $ref: '#/definitions/GenetreeInternalNode' diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 68ba725..09282ef 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -23,9 +23,9 @@ "resolved": "https://registry.npmjs.org/append-field/-/append-field-0.1.0.tgz" }, "argparse": { - "version": "1.0.6", + "version": "1.0.7", "from": "argparse@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.6.tgz" + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.7.tgz" }, "array-flatten": { "version": "1.1.1", @@ -445,8 +445,8 @@ }, "gramene-mongodb-config": { "version": "1.49.0", - "from": "warelab/gramene-mongodb-config#zm4", - "resolved": "git://github.com/warelab/gramene-mongodb-config.git#532abb1e455381e1ad28b8f1880575c76c601e04" + "from": "git://github.com/warelab/gramene-mongodb-config.git#zm4", + "resolved": "git://github.com/warelab/gramene-mongodb-config.git#8c8b6a7f530d13455746dd015c9860d53c60be69" }, "har-validator": { "version": "2.0.6", @@ -539,9 +539,9 @@ "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.1.9.tgz" }, "js-yaml": { - "version": "3.5.4", + "version": "3.5.5", "from": "js-yaml@>=3.3.0 <4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.4.tgz" + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz" }, "jsbn": { "version": "0.1.0", diff --git a/package.json b/package.json index 516ceb2..4bc3fbd 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "csv-stringify": "0.0.8", "csv2": "^0.1.1", "express": "^4.12.3", - "gramene-mongodb-config": "warelab/gramene-mongodb-config#zm4", + "gramene-mongodb-config": "git://github.com/warelab/gramene-mongodb-config#zm4", "gramene-bedify": "1.0.5", "isnumber": "^1.0.0", "kerberos": "0.0.18",