Skip to content

Commit

Permalink
Merge pull request #241 from plantbreeding/issue-191
Browse files Browse the repository at this point in the history
Issue 191
  • Loading branch information
BrapiCoordinatorSelby authored Apr 19, 2018
2 parents d4e53ca + d6fed55 commit b1e264a
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 18 deletions.
6 changes: 5 additions & 1 deletion Scripts/buildBrapiBlueprint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ sources=( "GeneralInfo/Intro.md"
"Studies/Studies_Observations_GET.md"
"Studies/Studies_Observations_PUT.md"
"Phenotypes/README.md"
"Phenotypes/PhenotypeSearch.md"
"Phenotypes/PhenotypesSearch_GET.md"
"Phenotypes/PhenotypesSearch_POST.md"
"Phenotypes/PhenotypesSearch_Table_POST.md"
"Phenotypes/PhenotypesSearch_CSV_POST.md"
"Phenotypes/PhenotypesSearch_TSV_POST.md"
"Traits/README.md"
"Traits/ListAllTraits.md"
"Traits/TraitDetails.md"
Expand Down
26 changes: 26 additions & 0 deletions Specification/Phenotypes/PhenotypesSearch_CSV_POST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

### Phenotypes Search (CSV) [POST /brapi/v1/phenotypes-search/csv]

+ Request (application/json)

{
"germplasmDbIds" : [ "Blabla", "34Mtp362" ], // (optional) The name or synonym of external genebank accession identifiers
"observationVariableDbIds" : [ "37373", "CO_321:00000234"], // (optional) The IDs of traits, could be ontology ID, database ID or PUI
"studyDbIds" : [ "383", "2929", "WHEAT_NETWK_2016_MONTPELLIER" ], // (optional) The database ID / PK of the studies search parameter
"locationDbIds" : [ "383838", "MONTPELLIER" ], // (optional) locations these traits were collected
"trialDbIds" : [ "3838", "Drought_resistance_CG_2020" ], // (optional) list of trials to search across
"programDbIds" : [ "3838", "Drought_resistance_CG_2020" ], // (optional) list of programs to search across
"seasonDbIds" : [ "338", "2010", "1956-2014", "2002-2003-2004", "2007 Spring" ], // (optional) The year or Phenotyping campaign of a multi-annual study (trees, grape, ...)
"observationLevel" : "plot", // (optional) The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure.
"observationTimeStampRangeStart" : "2015-06-16T00:53:26-0800" // (optional) Timestamp range start
"observationTimeStampRangeEnd" : "2015-06-18T00:53:26-0800" // (optional) Timestamp range end
"pageSize" : 100, // (optional) The size of the pages to be returned. Default is `1000`.
"page" : 0, // (optional) Which result page is requested
}

+ Response 200 (application/csv)

"year","studyDbId","studyName","locationDbId","locationName","germplasmDbId","germplasmName","observationUnitDbId","plotNumber","replicate","blockNumber", "entryType", "X", "Y", "variableDbId1", "variableDbId2", "variableDbId3"
"2015", "YieldStudy2015-5", "Yield wheat 2015", "mtp-north-32", "Montpellier", "doi:10.155454/12349537E12", "IR-8", "2016-Maugio-34-575-abc-123", "120", "", "2", "", "5", "15", "45", "3", "10"
"2016", "YieldStudy2016-5", "Yield wheat 2016", "mtp-north-32", "Montpellier", "doi:10.155454/12349537E13", "IR-8", "2016-Maugio-34-575-abc-124", "120", "", "2", "", "5", "15", "47", "4", "11"

Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ See <a href="#introduction/search-services">Search Services</a> for additional i

Implemented for GnpIS and PHIS data (https://urgi.versailles.inra.fr/ws/webresources/brapi/v1/phenotypes).
Use case: this section allows to get a dataset from multiple studies. It allows to integrate data from several databases.
Refactor note : This call allows to get and integrate portions of multiple phenotyping data matrixes. A proposed evolution allowed to get a list of single observations, this functionality is still possible with this call by specifybing the observation variable, see below.
Refactor note : This call allows to get and integrate portions of multiple phenotyping data matrixes. A proposed evolution allowed to get a list of single observations, this functionality is still possible with this call by specifying the observation variable, see below.
Example Use cases:
- Study a panel of germplasm accross multiple studies, search parameters : {"germplasmDbIds" : [ "Syrah", "34Mtp362" ]}
- Get all data for a specific study : {"studyDbIds" : [ "383" ]}
- Get simple atomic phenotyping values : {"germplasmDbIds" : [ "Syrah", "34Mtp362" ], "observationVariableDbIds" : [ "CO_345:0000043"]}
- Study Locations for adaptation to climat change : {"locationDbIds" : [ "383838", "MONTPELLIER" ], "germplasmDbIds" : [ "all ids for a given species"]}
- Study Locations for adaptation to climate change : {"locationDbIds" : [ "383838", "MONTPELLIER" ], "germplasmDbIds" : [ "all ids for a given species"]}
- Find phenotypes that are from after a certain timestamp

###### Response data types
Expand Down Expand Up @@ -49,26 +49,26 @@ Example Use cases:
|observations.observationTimeStamp|string|ISO format "2006-07-03T10:00:38-0800"||
|observations.collector|string| Person or team who has made the observation||

### Phenotype Search [POST /brapi/v1/phenotypes-search]

observationTimeStamp : Iso Standard 8601.

observationValue data type inferred from the ontology

+ Request (application/json)
### Phenotype Search (GET) [GET /brapi/v1/phenotypes-search{?germplasmDbIds}{?observationVariableDbIds}{?studyDbIds}{?locationDbIds}{?trialDbIds}{?programDbIds}{?seasonDbIds}{?observationLevel}{?observationTimeStampRangeStart}{?observationTimeStampRangeEnd}{?pageSize}{?page}]
+ Parameters
+ germplasmDbIds (optional, string, `Blabla`) ... The name or synonym of external genebank accession identifiers
+ observationVariableDbIds (optional, string, `37373`) ... The IDs of traits, could be ontology ID, database ID or PUI
+ studyDbIds (optional, string, `2929`) ... The database ID / PK of the studies search parameter
+ locationDbIds (optional, string, `383838`) ... locations these traits were collected
+ trialDbIds (optional, string, `3838`) ... list of trials to search across
+ programDbIds (optional, string, `3838`) ... list of programs that have phenotyped this trait
+ seasonDbIds (optional, string, `2010`) ... The year or Phenotyping campaign of a multi-annual study (trees, grape, ...)
+ observationLevel (optional, string, `plot`) ... The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure.
+ observationTimeStampRangeStart (optional, string, `2015-06-16T00:53:26-0800`) ... Timestamp range start
+ observationTimeStampRangeEnd (optional, string, `2015-06-18T00:53:26-0800`) ... Timestamp range end
+ pageSize (optional, integer, `1000`) ... The size of the pages to be returned. Default is `1000`.
+ page (optional, integer, `0`) ... Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`.

{
"germplasmDbIds" : [ "Blabla", "34Mtp362" ], // (optional) The name or synonym of external genebank accession identifiers
"observationVariableDbIds" : [ "37373", "CO_321:00000234"], // (optional) The IDs of traits, could be ontology ID, database ID or PUI
"studyDbIds" : [ "383", "2929", "WHEAT_NETWK_2016_MONTPELLIER" ], // (optional) The database ID / PK of the studies search parameter
"locationDbIds" : [ "383838", "MONTPELLIER" ], // (optional) locations these traits were collected
"programDbIds" : [ "3838", "Drought_resistance_CG_2020" ], // (optional) list of programs that have phenotyped this trait
"seasonDbIds" : [ "338", "2010", "1956-2014", "2002-2003-2004", "2007 Spring" ], // (optional) The year or Phenotyping campaign of a multiannual study (trees, grape, ...)
"observationLevel" : "plot", // (optional) The type of the observationUnit. Returns only the observaton unit of the specified type; the parent levels ID can be accessed through observationUnitStructure.
"observationTimeStampRange" : ["2015-06-16T00:53:26-0800","2015-06-18T00:53:26-0800"] // (optional) Array fixed length of 2. First item is the Start Timestamp, second item is the End Timestamp.
"pageSize" : 100, // (optional) The size of the pages to be returned. Default is `1000`.
"page" : 1, // (optional) Which result page is requested
}

+ Response 200 (application/json)

{
Expand Down
132 changes: 132 additions & 0 deletions Specification/Phenotypes/PhenotypesSearch_POST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@

### Phenotype Search (POST) [POST /brapi/v1/phenotypes-search]

+ Request (application/json)

{
"germplasmDbIds" : [ "Blabla", "34Mtp362" ], // (optional) The name or synonym of external genebank accession identifiers
"observationVariableDbIds" : [ "37373", "CO_321:00000234"], // (optional) The IDs of traits, could be ontology ID, database ID or PUI
"studyDbIds" : [ "383", "2929", "WHEAT_NETWK_2016_MONTPELLIER" ], // (optional) The database ID / PK of the studies search parameter
"locationDbIds" : [ "383838", "MONTPELLIER" ], // (optional) locations these traits were collected
"trialDbIds" : [ "3838", "Drought_resistance_CG_2020" ], // (optional) list of trials to search across
"programDbIds" : [ "3838", "Drought_resistance_CG_2020" ], // (optional) list of programs that have phenotyped this trait
"seasonDbIds" : [ "338", "2010", "1956-2014", "2002-2003-2004", "2007 Spring" ], // (optional) The year or Phenotyping campaign of a multi-annual study (trees, grape, ...)
"observationLevel" : "plot", // (optional) The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure.
"observationTimeStampRangeStart" : "2015-06-16T00:53:26-0800" // (optional) Timestamp range start
"observationTimeStampRangeEnd" : "2015-06-18T00:53:26-0800" // (optional) Timestamp range end
"pageSize" : 100, // (optional) The size of the pages to be returned. Default is `1000`.
"page" : 1, // (optional) Which result page is requested
}

+ Response 200 (application/json)

{
"metadata": {
"pagination": {
"pageSize": 100,
"currentPage": 1,
"totalCount": 102,
"totalPages": 2
},
"status": [],
"datafiles": []
},
"result": {
"data": [
{
"observationUnitDbId": "2016-Maugio-34-575-abc-123",
"observationLevel": "plot",
"observationLevels": "bloc:2,subBloc:1,plot:2016-Maugio-34-575-abc-123",
"plotNumber": "2016-Maugio-34-575-abc-123",
"plantNumber" : null,
"blockNumber" : "2",
"replicate": null,
"observationUnitName": "2016-Maugio-34-575",
"germplasmDbId": "doi:10.155454/12349537E12",
"germplasmName": "IR-8",
"studyDbId": "YieldStudy2015-5",
"studyName": "Yield wheat 2015",
"studyLocationDbId": "mtp-north-32",
"studyLocation": "Montpellier",
"programName": "Whealbi",
"X": "5",
"Y": "15",
"entryType": null,
"entryNumber": null,
"treatments": [
{
"factor": "water regimen",
"modality": "water deficit"
}
],
"observationUnitXref":[
{"source": "biosampleEBI", "id": "SAMEA179865230"},
{"source": "gnpis.lot", "id": "INRA:CoeSt6 _SMH03"},
{"source": "kernelDB", "id": "239865"}
],
"observations": [
{
"observationDbId": "153453453",
"observationVariableDbId": "CO_321:0000045",
"observationVariableName": "Plant_height",
"observationTimeStamp": "2015-06-16T00:53:26-0800",
"season": "2015",
"collector": "Mr. Technician",
"value": "45"
},
{
"observationDbId": "23453454345",
"observationVariableDbId": "CO_321:0000996",
"observationVariableName": "GW100_g",
"observationTimeStamp": "2015-06-16T00:53:26-0800",
"season": "2015",
"collector": "Mr. Technician",
"value": "3"
}
]
},
{
"observationUnitDbId": "45204",
"observationLevel": "plant",
"observationLevels": null,
"plotNumber": null,
"plantNumber" : "45204",
"blockNumber" : null,
"replicate": "2",
"observationUnitName": "2010-Cornell-37-99",
"germplasmDbId": "doi:10.155499/12349537E00",
"germplasmName": "ZE-45",
"studyDbId": "YieldStudy2010-5",
"studyName": "Yield wheat 2010",
"studyLocationDbId": "88484",
"studyLocation": "Cornell",
"programName": "Wheat for futur",
"X": null,
"Y": null,
"entryType": null,
"entryNumber": null,
"treatments": [],
"observations": [
{
"observationDbId": "153453453",
"observationVariableDbId": "CO_321:0000045",
"observationVariableName": "Plant_height",
"observationTimeStamp": "2010-06-16T00:53:26-0800",
"season": "2010",
"collector": "Mr. Technician",
"value": "45"
},
{
"observationDbId": "23453454345",
"observationVariableDbId": "CO_321:0000996",
"observationVariableName": "GW100_g",
"observationTimeStamp": "2010-06-16T00:53:26-0800",
"season": "2010",
"collector": "Mr. Technician",
"value": "3"
}
]
}
]
}
}
26 changes: 26 additions & 0 deletions Specification/Phenotypes/PhenotypesSearch_TSV_POST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

### Phenotypes Search (TSV) [POST /brapi/v1/phenotypes-search/tsv]

+ Request (application/json)

{
"germplasmDbIds" : [ "Blabla", "34Mtp362" ], // (optional) The name or synonym of external genebank accession identifiers
"observationVariableDbIds" : [ "37373", "CO_321:00000234"], // (optional) The IDs of traits, could be ontology ID, database ID or PUI
"studyDbIds" : [ "383", "2929", "WHEAT_NETWK_2016_MONTPELLIER" ], // (optional) The database ID / PK of the studies search parameter
"locationDbIds" : [ "383838", "MONTPELLIER" ], // (optional) locations these traits were collected
"trialDbIds" : [ "3838", "Drought_resistance_CG_2020" ], // (optional) list of trials to search across
"programDbIds" : [ "3838", "Drought_resistance_CG_2020" ], // (optional) list of programs to search across
"seasonDbIds" : [ "338", "2010", "1956-2014", "2002-2003-2004", "2007 Spring" ], // (optional) The year or Phenotyping campaign of a multi-annual study (trees, grape, ...)
"observationLevel" : "plot", // (optional) The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnit Structure.
"observationTimeStampRangeStart" : "2015-06-16T00:53:26-0800" // (optional) Timestamp range start
"observationTimeStampRangeEnd" : "2015-06-18T00:53:26-0800" // (optional) Timestamp range end
"pageSize" : 100, // (optional) The size of the pages to be returned. Default is `1000`.
"page" : 1, // (optional) Which result page is requested
}

+ Response 200 (application/tsv)

"year" "studyDbId" "studyName" "locationDbId" "locationName" "germplasmDbId" "germplasmName" "observationUnitDbId" "plotNumber" "replicate" "blockNumber" "entryType" "X" "Y" "variableDbId1" "variableDbId2" "variableDbId3"
"2015" "YieldStudy2015-5" "Yield wheat 2015" "mtp-north-32" "Montpellier" "doi:10.155454/12349537E12" "IR-8" "2016-Maugio-34-575-abc-123" "120" "" "2" "" "5" "15" "45" "3" "10"
"2016" "YieldStudy2016-5" "Yield wheat 2016" "mtp-north-32" "Montpellier" "doi:10.155454/12349537E13" "IR-8" "2016-Maugio-34-575-abc-124" "120" "" "2" "" "5" "15" "47" "4" "11"

47 changes: 47 additions & 0 deletions Specification/Phenotypes/PhenotypesSearch_Table_POST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

### Phenotypes Search (Table) [POST /brapi/v1/phenotypes-search/table]

+ Request (application/json)

{
"germplasmDbIds" : [ "Blabla", "34Mtp362" ], // (optional) The name or synonym of external genebank accession identifiers
"observationVariableDbIds" : [ "37373", "CO_321:00000234"], // (optional) The IDs of traits, could be ontology ID, database ID or PUI
"studyDbIds" : [ "383", "2929", "WHEAT_NETWK_2016_MONTPELLIER" ], // (optional) The database ID / PK of the studies search parameter
"locationDbIds" : [ "383838", "MONTPELLIER" ], // (optional) locations these traits were collected
"trialDbIds" : [ "3838", "Drought_resistance_CG_2020" ], // (optional) list of trials to search across
"programDbIds" : [ "3838", "Drought_resistance_CG_2020" ], // (optional) list of programs to search across
"seasonDbIds" : [ "338", "2010", "1956-2014", "2002-2003-2004", "2007 Spring" ], // (optional) The year or Phenotyping campaign of a multi-annual study (trees, grape, ...)
"observationLevel" : "plot", // (optional) The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnit Structure.
"observationTimeStampRangeStart" : "2015-06-16T00:53:26-0800" // (optional) Timestamp range start
"observationTimeStampRangeEnd" : "2015-06-18T00:53:26-0800" // (optional) Timestamp range end
"pageSize" : 100, // (optional) The size of the pages to be returned. Default is `1000`.
"page" : 0, // (optional) Which result page is requested
}

+ Response 200 (application/json)

{
"metadata": {
"pagination": {
"pageSize": 100,
"currentPage": 0,
"totalCount": 2,
"totalPages": 1
},
"status": [],
"datafiles": []
},
"result" : {
"headerRow": [ "year","studyDbId","studyName","locationDbId","locationName","germplasmDbId","germplasmName","observationUnitDbId","plotNumber","replicate","blockNumber", "observationTimestamp", "entryType", "X", "Y"],
"observationVariableDbIds": [ "variable1DbId", "variable2DbId", "variable3DbId"], // for linking
"observationVariableNames": [ "plant height", "fruit weight", "root weight" ], // for display
// the observationNames will follow the columns defined in the headerRow

"data" :
[
["2017", "stu1", "Study Name", "loc1", "Location Name", "CIP1", "CIP Name", "abc123", 1, 1, 1, "2017-06-16T00:53:26Z", "Test Entry", "1", "2", "25.3", "103.4", "50.75"],
["2017", "stu1", "Study Name", "loc1", "Location Name", "CIP1", "CIP Name", "abc124", 1, 1, 1, "2017-06-16T00:54:57Z", "Test Entry", "2", "2", "27.9", "98.65", "45.345"]
]
}
}

0 comments on commit b1e264a

Please sign in to comment.