-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update terms and template docs (#90)
* Remove another deprecated modelSystemStrainNomenclature * Update schema csv and jsonld Add to modelSystemName, make dataType required, rewording some descriptions, add backend class notation, range and editor note (mainly for docs) * Update ext_classes * Add documentation functions and sections, regenerate * Revise new extended classes
- Loading branch information
Showing
14 changed files
with
1,568 additions
and
769 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#' Function to generate template documentation | ||
#' | ||
#' Creates one row per property and selected informational columns for: | ||
#' - marginality (required vs. recommended vs. optional; in our case, recommended/optional collapsed to optional) | ||
#' - controlled values / constraints on fields | ||
#' - cardinality (one or many values allowed) *currently omitted, see additional notes | ||
#' Example related resources for what this can look like: | ||
#' 1. https://bioschemas.org/profiles/ComputationalWorkflow/1.0-RELEASE | ||
#' 2. https://fairplus.github.io/the-fair-cookbook/content/recipes/interoperability/transcriptomics-metadata.html#assay-metadata | ||
#' 3. https://www.immport.org/shared/templateDocumentation?tab=1&template=bioSamples.txt | ||
#' 4. https://lincsproject.org/LINCS/files//2020_exp_meta_stand/General_Proteomics.pdf | ||
#' Marginality is mentioned in all examples. | ||
#' CV is mentioned for #1,2,3. | ||
#' Cardinality is mentioned in #1 only, so it's not prioritized. | ||
docTemplate <- function(schema, savedir = "templates/") { | ||
templates <- schema %>% | ||
filter(Root == "Template" & SubclassOf != "") %>% | ||
select(ID, DependsOn) | ||
for(template in templates$ID) { | ||
fields <- schema %>% | ||
filter(template == ID) %>% | ||
pull(DependsOn) %>% | ||
strsplit(split = ", ?") %>% | ||
unlist() | ||
index <- match(fields, schema$Attribute) | ||
# ControlledVocab col is handled specially and is derived from the Range col | ||
# Range is either filled with a class or blank, where blank means free text or Boolean values | ||
# Bools are "controlled vocabulary" vs. true ontology terms | ||
range <- dplyr::if_else(schema[index, "Range"] != "", paste0("#", schema[index, "Range"]), schema[index, "Valid.Values"]) | ||
template_tab <- data.frame(Field = fields, | ||
Description = schema[index, "Description"], | ||
Required = ifelse(schema[index, "Required"], "required", "optional"), | ||
ControlledVocab = range, | ||
# Cardinality = schema[index, "Cardinality"], | ||
Note = schema[index, "EditorNote"]) | ||
write.csv(template_tab, file = paste0(savedir, template, ".csv"), row.names = F) | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.