Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Sage The DCC has derived standards for how content is annotated in Synapse and this page describes how the DCC manages management of the keys, definitions, and references used to annotate files. See Synapse Annotations for general information. Approved terms are available in a searchable

...

Schemas

The synapseAnnotations Github repo includes schemas for individual metadata terms. The Each term is stored in a JSON mini-schema and the terms are organized by modules in the each terms/<module>/ folder. There are subfolders for each module, and the term names include the module. The mechanisms that manage and implement these annotations are described in the README.

Annotation schemas in JSON

Templates for adding new terms are included in the term-templates/ directory. Each individual term is stored in its own JSON mini schema. This is a valid JSON Schema, such as the following:

Code Block
languagejson
{   $schema": "<http://json-schema.org/draft-07/schema#",>
    "$id": "<https://repo-prod.prod.sagebase.org/repo/v1/schema/type/registered/sage.annotations-experimentalData.specimenID-0.0.1",>
    "description": "Identifying string linked to a particular sample or specimen",
    "type": "string"
}

Schema editing procedure

...

Create Github issue if needed in https://github.com/Sage-Bionetworks/synapseAnnotations/issues

...

Term information is stored in JSON schemas in the synapseAnnotations/terms directory.
NOTE: Terms specific to MODEL-AD are stored in: synapseAnnotations/terms/neuro

...

Create a JSON schema file or edit an existing one.

...

Copy and Paste schema template.

...

Edit $id line with Modulename and Key name.

...

Version numbers start with 0.0.1 and should be incremented with each update.

...

Add new term, a brief definition, and an ontology citation for the included definition.

...

Create a branch name formatted like ‘username-edit-type/‘

...

Add a brief description of changes to commit

...

Data checks will start to run in the background. All data checks must successfully pass.

...

Once desired changes are committed, initiate a Pull Request and select DCC curators as reviewers.

...

Edit JSON Schema

  • Copy a template from: synapseAnnotations/term-templates

  • Edit new file

    • Edit $id line with <MODULENAME> and <KEY>

    • Increment version with each update

    • Add Term, Definition, and a source for Definition (https://www.ebi.ac.uk/ols/index )

    • Commit changes to a new branch

  • Schema validation checks will automatically start to run in the background.

  • Address any errors until validation passes

  • Open a Pull Request and select DCC reviewers

Update Schemas

...

    • R --help

    • Register all schemas

...

    • : ./register-schemas.R terms/*/*.json

...

    • Verify if this script runs automatically as part of the Github workflow

  • To update the Synapse annotations table

...

  • :

    • ./update-annotations-table.R

Generate Template

...

...

Add/Remove terms from XLS template file. Alternatively, this can be done programmatically with JSON.

  • SysBio Metadata Templates: https://github.com/Sage-Bionetworks/sysbioDCCjsonschemas/tree/master/schema_metadata_templates

  • Construct a JSON schema file to generate XLS template

  • Make sure to register latest versions of JSON schemas

  • To create a Synapse table of all terms in metadata templates:

    • create_Syn_table_from_Syn_schemas.py

  • For example, to generate a Metadata Template:

    • create_template_from_Syn_schema_sorted.py

  • Code Block
    cd ~/Documents/GitHub/sysbioDCCjsonschemas/code/python/.
    python3 create_template_from_Syn_schema_sorted.py \
            sysbio.metadataTemplates-ad.manifest \ 
            manifest_test.xlsx excel \
            ~/Documents/GitHub/sysbioDCCjsonschemas/schema_metadata_templates/AD/manifest_metadata_template.json
            

...

...