View source: R/brapi_put_observationunits_observationUnitDbId.R
| brapi_put_observationunits_observationUnitDbId | R Documentation |
Update an existing Observation Unit
brapi_put_observationunits_observationUnitDbId( con = NULL, observationUnitDbId = "", additionalInfo = list(), externalReferences = "", germplasmDbId = "", germplasmName = "", locationDbId = "", locationName = "", observationUnitName = "", observationUnitPUI = "", observationUnitPosition = list(), programDbId = "", programName = "", seedLotDbId = "", studyDbId = "", studyName = "", treatments = "", trialDbId = "", trialName = "" )
con |
list; required: TRUE; BrAPI connection object |
observationUnitDbId |
character; required: TRUE; The unique identifier of the specific observation unit. |
additionalInfo |
list; required: FALSE; Additional arbitrary information. If provided use the following construct list(additionalProp1 = "string", additionalProp2 = "string", additionalProp3 = "string"). The Examples section shows an example on how to construct the
|
externalReferences |
data.frame; required: FALSE; A data.frame of
external reference ids. These are references to this piece of data in an
external system. Could be a simple string or a URI. The
The Examples section shows an example of how to construct the
|
germplasmDbId |
character; required: FALSE; Unique germplasm (accession) identifier for the observation unit. |
germplasmName |
character; required: FALSE; Human readable germplasm name for the observation unit. It can be the preferred name and does not have to be unique. |
locationDbId |
character; required: FALSE; The identifier, which uniquely identifies a location, associated with this study. |
locationName |
character; required: FALSE; The human readable name of a location associated with this study. |
observationUnitName |
character; required: FALSE; A human readable name for an observation unit. |
observationUnitPUI |
character; required: FALSE; A Permanent Unique Identifier for an observation unit. MIAPPE V1.1 (DM-72) External ID - Identifier for the observation unit in a persistent repository, comprises the name of the repository and the identifier of the observation unit therein. The EBI Biosamples repository can be used. URI are recommended when possible. |
observationUnitPosition |
list; required: FALSE; All positional and
layout information related to this Observation Unit. MIAPPE V1.1 (DM-73)
Spatial distribution - Type and value of a spatial coordinate
(georeference or relative) or level of observation (plot 45, subblock 7,
block 2) provided as a key-value pair of the form type:value. Levels of
observation must be consistent with those listed in the Study section. The
|
programDbId |
character; required: FALSE; The identifier, which uniquely identifies a program. |
programName |
character; required: FALSE; The human readable name of a program. |
seedLotDbId |
character; required: FALSE; The unique identifier for the originating Seed Lot. |
studyDbId |
character; required: FALSE; The identifier, which uniquely identifies a study within the given database server. |
studyName |
character; required: FALSE; The human readable name for a study. |
treatments |
data.frame; required: FALSE; Data.frame of treatments
applied to an observation unit. MIAPPE V1.1 (DM-74) Observation Unit
factor value - List of values for each factor applied to the observation
unit. Each row in the
|
trialDbId |
character; required: FALSE; The identifier, which uniquely identifies a trial. |
trialName |
character; required: FALSE; The human readable name of a trial. |
Update an existing Observation Units
data.frame
Maikel Verouden
Other brapi-phenotyping:
brapi_get_events(),
brapi_get_images_imageDbId(),
brapi_get_images(),
brapi_get_methods_methodDbId(),
brapi_get_methods(),
brapi_get_observationlevels(),
brapi_get_observations_observationDbId(),
brapi_get_observations_table(),
brapi_get_observations(),
brapi_get_observationunits_observationUnitDbId(),
brapi_get_observationunits_table(),
brapi_get_observationunits(),
brapi_get_ontologies(),
brapi_get_scales_scaleDbId(),
brapi_get_scales(),
brapi_get_search_images_searchResultsDbId(),
brapi_get_search_observations_searchResultsDbId(),
brapi_get_search_observationunits_searchResultsDbId(),
brapi_get_search_variables_searchResultsDbId(),
brapi_get_traits_traitDbId(),
brapi_get_traits(),
brapi_get_variables_observationVariableDbId(),
brapi_get_variables(),
brapi_post_images(),
brapi_post_methods(),
brapi_post_observations(),
brapi_post_observationunits(),
brapi_post_scales(),
brapi_post_search_images(),
brapi_post_search_observations(),
brapi_post_search_observationunits(),
brapi_post_search_variables(),
brapi_post_traits(),
brapi_post_variables(),
brapi_put_images_imageDbId_imagecontent(),
brapi_put_images_imageDbId(),
brapi_put_methods_methodDbId(),
brapi_put_observations_observationDbId(),
brapi_put_scales_scaleDbId(),
brapi_put_traits_traitDbId(),
brapi_put_variables_observationVariableDbId()
Other Observation Units:
brapi_get_observationlevels(),
brapi_get_observationunits_observationUnitDbId(),
brapi_get_observationunits_table(),
brapi_get_observationunits(),
brapi_get_search_observationunits_searchResultsDbId(),
brapi_post_observationunits(),
brapi_post_search_observationunits()
## Not run:
con <- brapi_db()$testserver
con[["token"]] <- "YYYY"
additionalInfo <- list(dummyData = "TRUE",
example = "post_observationunits")
externalReferences <-
data.frame(referenceID = c("doi:10.155454/12341234",
"http://purl.obolibrary.org/obo/ro.owl",
"75a50e76"),
referenceSource = c("DOI",
"OBO Library",
"Remote Data Collection Upload Tool"))
germplasmDbId <- "germplasm2"
germplasmName <- "Tomatillo Fantastico"
locationDbId <- "location_01"
locationName <- "Location 1"
observationUnitName <- "Plot 1"
observationUnitPUI <- "doi:10.12345/plot/1a9afc14"
## Create the observationUnitPosition list object
observationUnitPosition <- list()
observationUnitPosition$entryType <- "TEST"
## Create a geoCoordinates list object
library(geojsonR)
## Point geometry
init <- TO_GeoJson$new()
pointGeometry <- list()
pointData <- c(-76.46313, # longitude
42.44423, # lattitude
123) # altitude
pointGeometry[["geometry"]] <- init$Point(data = pointData,
stringify = FALSE)
pointGeometry[["type"]] <- "Feature"
##
## Polygon geometry with an exterior and one interior ring
init <- TO_GeoJson$new()
## Individual polygon points are provided as c(longitude, latitude, altitude)
polygonData <- list(list(c(-76.476949, 42.447274, 123), # exterior ring (rectangle)
c(-76.474429, 42.447258, 123),
c(-76.474428, 42.446193, 123),
c(-76.476961, 42.446211, 123),
c(-76.476949, 42.447274, 123)))
polygonGeometry <- list()
polygonGeometry[["geometry"]] <- init$Polygon(data = polygonData,
stringify = FALSE)
polygonGeometry[["type"]] <- "Feature"
observationUnitPosition$geoCoordinates <- pointGeometry
observationUnitPosition$observationLevel <- list(
levelCode = "plot_1",
levelName = "plot",
levelOrder = 4)
observationUnitPosition$observationLevelRelationships <- data.frame(
levelCode = c("fieldA", "rep1", "block1"),
levelName = c("field", "rep", "block"),
levelOrder = c(1, 2, 3))
observationUnitPosition$positionCoordinateX <- "1"
observationUnitPosition$positionCoordinateXType <- "PLANTED_ROW"
observationUnitPosition$positionCoordinateY <- "1"
observationUnitPosition$positionCoordinateYType <- "PLANTED_INDIVIDUAL"
programDbId <- "program1"
programName <- "The BrAPI Breeding Program"
seedLotDbId <- "seed_lot2"
studyDbId <- "study1"
studyName <- "Paw paw 2013 yield trial"
treatments <- data.frame(
factor = c("fertilizer", "irrigation"),
modality = c("high fertilizer", "low water"))
trialDbId <- "trial1"
trialName <- "Peru Yield Trial 1"
## POST /observationunits to add a new one
out <- brapi_post_observationunits(
con = con,
additionalInfo = additionalInfo,
externalReferences = externalReferences,
germplasmDbId = germplasmDbId,
germplasmName = germplasmName,
locationDbId = locationDbId,
locationName = locationName,
observationUnitName = observationUnitName,
observationUnitPUI = observationUnitPUI,
observationUnitPosition = observationUnitPosition,
programDbId = programDbId,
programName = programName,
seedLotDbId = seedLotDbId,
studyDbId = studyDbId,
studyName = studyName,
treatments = treatments,
trialDbId = trialDbId,
trialName = trialName)
## Obtain the observationUnitDbId of the new observation unit
observationUnitDbId <- unique(out$observationUnitDbId)
## Update the information of the new observation unit
brapi_put_observationunits_observationUnitDbId(
con = con,
observationUnitDbId = observationUnitDbId,
additionalInfo = list(
dummyData = "TRUE",
example = "put_observationunits_observationUnitDbId"),
observationUnitPosition = list(geoCoordinates = polygonGeometry))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.