diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 105e721..b0a1c09 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -27,5 +27,5 @@ jobs: path: .cache restore-keys: | mkdocs-material- - - run: pip install mkdocs-material mkdocs-table-reader-plugin + - run: pip install mkdocs-material mkdocs-table-reader-plugin pandas - run: mkdocs gh-deploy --force diff --git a/.gitignore b/.gitignore index a65dce4..8689633 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,8 @@ vignettes/*.pdf # schematic-related files great_expectations/ .DS_Store +**/.DS_Store +**/**/.DS_Store + +# MKDocs +scripts/__pycache__ \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 2460bb0..838f27a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,7 +3,9 @@

- GitHub release (latest by date) + + GitHub release (latest by date) +

**Welcome!** 👋 Explore metadata terms used by MC2 Center diff --git a/docs/model/dataset.md b/docs/model/dataset.md new file mode 100644 index 0000000..f2fc4ea --- /dev/null +++ b/docs/model/dataset.md @@ -0,0 +1 @@ +{{ read_csv('dataset/template.csv') }} diff --git a/docs/model/education.md b/docs/model/education.md new file mode 100644 index 0000000..8ddad6f --- /dev/null +++ b/docs/model/education.md @@ -0,0 +1 @@ +{{ read_csv('education/template.csv') }} diff --git a/docs/model/grant.md b/docs/model/grant.md new file mode 100644 index 0000000..5d5068b --- /dev/null +++ b/docs/model/grant.md @@ -0,0 +1 @@ +{{ read_csv('grant/template.csv') }} diff --git a/docs/model/person.md b/docs/model/person.md new file mode 100644 index 0000000..70a7033 --- /dev/null +++ b/docs/model/person.md @@ -0,0 +1 @@ +{{ read_csv('person/template.csv') }} \ No newline at end of file diff --git a/docs/model/publication.md b/docs/model/publication.md new file mode 100644 index 0000000..b8c521c --- /dev/null +++ b/docs/model/publication.md @@ -0,0 +1 @@ +{{ read_csv('publication/template.csv') }} \ No newline at end of file diff --git a/docs/model/tool.md b/docs/model/tool.md new file mode 100644 index 0000000..b4a83fb --- /dev/null +++ b/docs/model/tool.md @@ -0,0 +1 @@ +{{ read_csv('tool/template.csv') }} \ No newline at end of file diff --git a/docs/template/dataset.md b/docs/template/dataset.md deleted file mode 100644 index 8b64086..0000000 --- a/docs/template/dataset.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('dataset/annotationProperty.csv', usecols=['Attribute','Description','Required']) }} diff --git a/docs/template/education.md b/docs/template/education.md deleted file mode 100644 index b16fbe8..0000000 --- a/docs/template/education.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('education/annotationProperty.csv', usecols=['Attribute','Description','Required']) }} diff --git a/docs/template/grant.md b/docs/template/grant.md deleted file mode 100644 index 82b837a..0000000 --- a/docs/template/grant.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('grant/annotationProperty.csv', usecols=['Attribute','Description','Required']) }} \ No newline at end of file diff --git a/docs/template/person.md b/docs/template/person.md deleted file mode 100644 index bdff002..0000000 --- a/docs/template/person.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('person/annotationProperty.csv', usecols=['Attribute','Description','Required']) }} \ No newline at end of file diff --git a/docs/template/publication.md b/docs/template/publication.md deleted file mode 100644 index d7c2538..0000000 --- a/docs/template/publication.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('publication/annotationProperty.csv', usecols=['Attribute','Description','Required']) }} \ No newline at end of file diff --git a/docs/template/tool.md b/docs/template/tool.md deleted file mode 100644 index 77bc254..0000000 --- a/docs/template/tool.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('tool/annotationProperty.csv', usecols=['Attribute','Description','Required']) }} \ No newline at end of file diff --git a/docs/valid_values/all_terms.md b/docs/valid_values/all_terms.md new file mode 100644 index 0000000..af344c5 --- /dev/null +++ b/docs/valid_values/all_terms.md @@ -0,0 +1,4 @@ +!!! note + For details and descriptions, please visit the terms by models. + +{{ read_csv('../all_valid_values.csv', header=0, names=['Attribute','Term']) }} diff --git a/docs/valid_values/dataset.md b/docs/valid_values/dataset.md new file mode 100644 index 0000000..17d922d --- /dev/null +++ b/docs/valid_values/dataset.md @@ -0,0 +1,55 @@ +List of standard terms for the [Dataset Data Model](../model/dataset.md). + +## Attribute: `Dataset Assay` + +
+ +{{ read_csv('shared/assay.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Dataset File Formats` + +
+ +{{ read_csv('dataset/dataset_file_format.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Dataset Grant Number` + +
+ +{{ read_csv('grant/grant_number.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Dataset Species` + +
+ +{{ read_csv('dataset/dataset_species.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Dataset Tissue` + +
+ +{{ read_csv('shared/tissue.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + + +## Attribute: `Dataset Tumor Type` + +
+ +{{ read_csv('shared/tumorType.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
diff --git a/docs/valid_values/education.md b/docs/valid_values/education.md new file mode 100644 index 0000000..f581ef6 --- /dev/null +++ b/docs/valid_values/education.md @@ -0,0 +1,104 @@ +List of standard terms for the [Education Resource Data Model](../model/education.md). + +## Attribute: `Resource Access Hazard` + +
+ +{{ read_csv('education/ed_hazard.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Activity Type` + +
+ +{{ read_csv('education/ed_activity_type.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Educational Level` + +
+ +{{ read_csv('education/ed_level.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Grant Number` + +
+ +{{ read_csv('grant/grant_number.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Intended Use` + +
+ +{{ read_csv('education/ed_intended_use.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Language` + +
+ +{{ read_csv('education/ed_language.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Media Accessibility` + +
+ +{{ read_csv('education/ed_accessibility.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Origin Institution` + +
+ +{{ read_csv('institution/institution_name.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Primary Audience` + +
+ +{{ read_csv('education/ed_primary_audience.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Primary Format` + +
+ +{{ read_csv('education/ed_primary_format.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Topic` + +
+ +{{ read_csv('education/ed_topic.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Resource Secondary Topic` + +See [Resource Topic](#attribute-resource-topic) diff --git a/docs/valid_values/grant.md b/docs/valid_values/grant.md new file mode 100644 index 0000000..051a5f5 --- /dev/null +++ b/docs/valid_values/grant.md @@ -0,0 +1,55 @@ +List of standard terms for the [Grant Data Model](../model/grant.md). + + +## Attribute: `Grant Consortium Name` + +
+ +{{ read_csv('consortium/consortium_name.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Grant Institution Alias` + +
+ +{{ read_csv('institution/institution_alias.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Grant Institution Name` + +
+ +{{ read_csv('institution/institution_name.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Grant Number` + +
+ +{{ read_csv('grant/grant_number.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Grant Theme Name` + +
+ +{{ read_csv('theme/theme_name.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Grant Type` + +
+ +{{ read_csv('grant/grant_type.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
diff --git a/docs/valid_values/person.md b/docs/valid_values/person.md new file mode 100644 index 0000000..a20313e --- /dev/null +++ b/docs/valid_values/person.md @@ -0,0 +1,45 @@ +List of standard terms for the [Person Data Model](../model/person.md). + +## Attribute: `Chair Roles` + +
+ +{{ read_csv('person/chair_roles.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Last Known Institution` + +
+ +{{ read_csv('institution/institution_name.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Person Consortium Name` + +
+ +{{ read_csv('consortium/consortium_name.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Person Grant Number` + +
+ +{{ read_csv('grant/grant_number.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Working Group Participation` + +
+ +{{ read_csv('person/working_group_participation.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
diff --git a/docs/valid_values/publication.md b/docs/valid_values/publication.md new file mode 100644 index 0000000..7bb7915 --- /dev/null +++ b/docs/valid_values/publication.md @@ -0,0 +1,45 @@ +List of standard terms for the [Publication Data Model](../model/publication.md). + +## Attribute: `Publication Accessibility` + +
+ +{{ read_csv('publication/publication_accessibility.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Publication Assay` + +
+ +{{ read_csv('shared/assay.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Publication Grant Number` + +
+ +{{ read_csv('grant/grant_number.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Publication Tissue` + +
+ +{{ read_csv('shared/tissue.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Publication Tumor Type` + +
+ +{{ read_csv('shared/tumorType.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
diff --git a/docs/valid_values/tool.md b/docs/valid_values/tool.md new file mode 100644 index 0000000..c75f57d --- /dev/null +++ b/docs/valid_values/tool.md @@ -0,0 +1,136 @@ +List of standard terms for the [Tool Data Model](../model/tool.md). + +## Attribute: `Tool Accessibility` + +
+ +{{ read_csv('tool/tool_accessibility.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Cost` + +
+ +{{ read_csv('tool/tool_cost.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Documentation Type` + +
+ +{{ read_csv('tool/tool_documentation_type.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Download Type` + +
+ +{{ read_csv('tool/tool_download_type.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Grant Number` + +
+ +{{ read_csv('grant/grant_number.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Input Data` + +
+ +{{ read_csv('tool/tool_data.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Input Format` + +
+ +{{ read_csv('tool/tool_format.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Language` + +
+ +{{ read_csv('tool/tool_language.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool License` + +
+ +{{ read_csv('tool/tool_license.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Link Type` + +
+ +{{ read_csv('tool/tool_link_type.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Operating System` + +
+ +{{ read_csv('tool/tool_operating_system.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Operation` + +
+ +{{ read_csv('tool/tool_operation.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Output Data` + +See [Tool Input Data](#attribute-tool-input-data) + + +## Attribute: `Tool Output Format` + +See [Tool Input Data](#attribute-tool-input-format) + + +## Attribute: `Tool Topic` + +
+ +{{ read_csv('tool/tool_topic.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
+ + +## Attribute: `Tool Type` + +
+ +{{ read_csv('tool/tool_type.csv', header=0, names=['Valid Value','Description'], usecols=['Valid Value','Description'], tablefmt='html') }} + +
diff --git a/docs/vocab/consortium.md b/docs/vocab/consortium.md deleted file mode 100644 index c0fd933..0000000 --- a/docs/vocab/consortium.md +++ /dev/null @@ -1,7 +0,0 @@ -## Name - -{{ read_csv('consortium/consortium_name.csv', usecols=['Attribute','Description']) }} - -## Funding agency - -{{ read_csv('consortium/consortium_funding_agency.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/dataset.md b/docs/vocab/dataset.md deleted file mode 100644 index 379183f..0000000 --- a/docs/vocab/dataset.md +++ /dev/null @@ -1,7 +0,0 @@ -## File format - -{{ read_csv('dataset/dataset_file_format.csv', usecols=['Attribute','Description']) }} - -## Species - -{{ read_csv('dataset/dataset_species.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/education.md b/docs/vocab/education.md deleted file mode 100644 index 8ebe8ad..0000000 --- a/docs/vocab/education.md +++ /dev/null @@ -1,35 +0,0 @@ -## Accessibility - -{{ read_csv('education/ed_accessibility.csv', usecols=['Attribute','Description']) }} - -## Activity type - -{{ read_csv('education/ed_activity_type.csv', usecols=['Attribute','Description']) }} - -## Hazard - -{{ read_csv('education/ed_hazard.csv', usecols=['Attribute','Description']) }} - -## Intended use - -{{ read_csv('education/ed_intended_use.csv', usecols=['Attribute','Description']) }} - -## Language - -{{ read_csv('education/ed_language.csv', usecols=['Attribute','Description']) }} - -## Level - -{{ read_csv('education/ed_level.csv', usecols=['Attribute','Description']) }} - -## Primary audience - -{{ read_csv('education/ed_primary_audience.csv', usecols=['Attribute','Description']) }} - -## Primary format - -{{ read_csv('education/ed_primary_format.csv', usecols=['Attribute','Description']) }} - -## Topic - -{{ read_csv('education/ed_topic.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/grant.md b/docs/vocab/grant.md deleted file mode 100644 index 791c810..0000000 --- a/docs/vocab/grant.md +++ /dev/null @@ -1,7 +0,0 @@ -## Number - -{{ read_csv('grant/grant_number.csv', usecols=['Attribute','Description']) }} - -## Type - -{{ read_csv('grant/grant_type.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/institution.md b/docs/vocab/institution.md deleted file mode 100644 index cd88c0f..0000000 --- a/docs/vocab/institution.md +++ /dev/null @@ -1,11 +0,0 @@ -## Name - -{{ read_csv('institution/institution_name.csv', usecols=['Attribute','Description']) }} - -## Alias - -{{ read_csv('institution/institution_alias.csv', usecols=['Attribute','Description']) }} - -## State location - -{{ read_csv('institution/institution_location_state.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/person.md b/docs/vocab/person.md deleted file mode 100644 index 5e6c433..0000000 --- a/docs/vocab/person.md +++ /dev/null @@ -1,7 +0,0 @@ -## Chair role - -{{ read_csv('person/chair_roles.csv', usecols=['Attribute','Description']) }} - -## Working group participation - -{{ read_csv('person/working_group_participation.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/project.md b/docs/vocab/project.md deleted file mode 100644 index f477a79..0000000 --- a/docs/vocab/project.md +++ /dev/null @@ -1,3 +0,0 @@ -## Type - -{{ read_csv('project/project_type.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/publication.md b/docs/vocab/publication.md deleted file mode 100644 index c63aecc..0000000 --- a/docs/vocab/publication.md +++ /dev/null @@ -1,4 +0,0 @@ -## Accessibility - -{{ read_csv('publication/publication_accessibility.csv', usecols=['Attribute','Description']) }} - diff --git a/docs/vocab/shared/assay.md b/docs/vocab/shared/assay.md deleted file mode 100644 index fcd893b..0000000 --- a/docs/vocab/shared/assay.md +++ /dev/null @@ -1,7 +0,0 @@ -## General - -{{ read_csv('shared/assay.csv', usecols=['Attribute','Description']) }} - -## Image-specific - -{{ read_csv('shared/imageAssay.csv', usecols=['Attribute','Description']) }} \ No newline at end of file diff --git a/docs/vocab/shared/disease_status.md b/docs/vocab/shared/disease_status.md deleted file mode 100644 index 9d14557..0000000 --- a/docs/vocab/shared/disease_status.md +++ /dev/null @@ -1,7 +0,0 @@ -## General - -{{ read_csv('shared/diseaseStatus.csv', usecols=['Attribute','Description']) }} - -## Metastasis status - -{{ read_csv('shared/metStatus.csv', usecols=['Attribute','Description']) }} \ No newline at end of file diff --git a/docs/vocab/shared/element_type.md b/docs/vocab/shared/element_type.md deleted file mode 100644 index bd71559..0000000 --- a/docs/vocab/shared/element_type.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('shared/elementType.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/shared/matrix_type.md b/docs/vocab/shared/matrix_type.md deleted file mode 100644 index 4f6da36..0000000 --- a/docs/vocab/shared/matrix_type.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('shared/matrixType.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/shared/preservation.md b/docs/vocab/shared/preservation.md deleted file mode 100644 index 210248d..0000000 --- a/docs/vocab/shared/preservation.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('shared/preservation.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/shared/sex.md b/docs/vocab/shared/sex.md deleted file mode 100644 index dbfff98..0000000 --- a/docs/vocab/shared/sex.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('shared/biologicalSex.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/shared/specimen.md b/docs/vocab/shared/specimen.md deleted file mode 100644 index 535ae69..0000000 --- a/docs/vocab/shared/specimen.md +++ /dev/null @@ -1,7 +0,0 @@ -## Composition - -{{ read_csv('shared/specimenComp.csv', usecols=['Attribute','Description']) }} - -## Type - -{{ read_csv('shared/specimenType.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/shared/tissue.md b/docs/vocab/shared/tissue.md deleted file mode 100644 index 093bc4e..0000000 --- a/docs/vocab/shared/tissue.md +++ /dev/null @@ -1 +0,0 @@ -{{ read_csv('shared/tissue.csv', usecols=['Attribute','Description']) }} \ No newline at end of file diff --git a/docs/vocab/shared/tumor.md b/docs/vocab/shared/tumor.md deleted file mode 100644 index ca48e51..0000000 --- a/docs/vocab/shared/tumor.md +++ /dev/null @@ -1,15 +0,0 @@ -## Type - -{{ read_csv('shared/tumorType.csv', usecols=['Attribute','Description']) }} - -## Subtype - -{{ read_csv('shared/tumorSubtype.csv', usecols=['Attribute','Description']) }} - -## Grade - -{{ read_csv('shared/tumorGrade.csv', usecols=['Attribute','Description']) }} - -## Origin - -{{ read_csv('shared/tumorOrigin.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/theme.md b/docs/vocab/theme.md deleted file mode 100644 index 3ce392c..0000000 --- a/docs/vocab/theme.md +++ /dev/null @@ -1,3 +0,0 @@ -## Name - -{{ read_csv('theme/theme_name.csv', usecols=['Attribute','Description']) }} diff --git a/docs/vocab/tool.md b/docs/vocab/tool.md deleted file mode 100644 index fa0ffbe..0000000 --- a/docs/vocab/tool.md +++ /dev/null @@ -1,51 +0,0 @@ -## Accessibility - -{{ read_csv('tool/tool_accessibility.csv', usecols=['Attribute','Description']) }} - -## Cost - -{{ read_csv('tool/tool_cost.csv', usecols=['Attribute','Description']) }} - -## Data - -{{ read_csv('tool/tool_data.csv', usecols=['Attribute','Description']) }} - -## Documentation type - -{{ read_csv('tool/tool_documentation_type.csv', usecols=['Attribute','Description']) }} - -## Download type - -{{ read_csv('tool/tool_download_type.csv', usecols=['Attribute','Description']) }} - -## Format - -{{ read_csv('tool/tool_format.csv', usecols=['Attribute','Description']) }} - -## Language - -{{ read_csv('tool/tool_language.csv', usecols=['Attribute','Description']) }} - -## License - -{{ read_csv('tool/tool_license.csv', usecols=['Attribute','Description']) }} - -## Link type - -{{ read_csv('tool/tool_link_type.csv', usecols=['Attribute','Description']) }} - -## Operating system - -{{ read_csv('tool/tool_operating_system.csv', usecols=['Attribute','Description']) }} - -## Operation - -{{ read_csv('tool/tool_operation.csv', usecols=['Attribute','Description']) }} - -## Topic - -{{ read_csv('tool/tool_topic.csv', usecols=['Attribute','Description']) }} - -## Type - -{{ read_csv('tool/tool_type.csv', usecols=['Attribute','Description']) }} diff --git a/mkdocs.yml b/mkdocs.yml index 610eeb2..442ab0f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -10,40 +10,30 @@ repo_name: data-models # Navigation nav: - Home: - - Introduction: index.md + - index.md + - MC2 Center Data Models: + - Dataset Data Model: model/dataset.md + - Education Resource Data Model: model/education.md + - Grant Data Model: model/grant.md + - Person Data Model: model/person.md + - Publication Data Model: model/publication.md + - Tool Data Model: model/tool.md + - Standard Terms: + - All terms: valid_values/all_terms.md - Terms by model: - - Consortium: vocab/consortium.md - - Dataset: vocab/dataset.md - - Education: vocab/education.md - - Grant: vocab/grant.md - - Institution: vocab/institution.md - - Person: vocab/person.md - - Project: vocab/project.md - - Publication: vocab/publication.md - - Theme: vocab/theme.md - - Tool: vocab/tool.md - - Shared models: - - Assay: vocab/shared/assay.md - - Biological sex: vocab/shared/sex.md - - Disease status: vocab/shared/disease_status.md - - Element type: vocab/shared/element_type.md - - Matrix type: vocab/shared/matrix_type.md - - Preservation: vocab/shared/preservation.md - - Specimen: vocab/shared/specimen.md - - Tissue: vocab/shared/tissue.md - - Tumor: vocab/shared/tumor.md - - Annotation templates: - - Dataset: template/dataset.md - - Education: template/education.md - - Grant: template/grant.md - - Person: template/person.md - - Publication: template/publication.md - - Tool: template/tool.md - - Next steps: next-steps.md + - Dataset: valid_values/dataset.md + - Education Resource: valid_values/education.md + - Grant: valid_values/grant.md + - Person: valid_values/person.md + - Publication: valid_values/publication.md + - Tool: valid_values/tool.md + - Next Steps: next-steps.md # Theme configuration theme: name: material + font: + text: DM Sans palette: - media: "(prefers-color-scheme: light)" scheme: default @@ -64,9 +54,10 @@ theme: info: octicons/info-16 features: - content.code.copy - - navigation.tabs - - navigation.footer + - navigation.indexes - navigation.sections + - navigation.tabs + - navigation.tabs.sticky - search.highlight - search.share - search.suggest @@ -79,6 +70,9 @@ plugins: select_readers: - read_csv +hooks: + - scripts/hooks.py + markdown_extensions: - admonition - pymdownx.details diff --git a/scripts/hooks.py b/scripts/hooks.py new file mode 100644 index 0000000..18f616a --- /dev/null +++ b/scripts/hooks.py @@ -0,0 +1,49 @@ +from os.path import join +import pandas as pd + +DATA_MODELS = [ + "dataset", + "education", + "grant", + "person", + "publication", + "tool", +] + +COLS_TO_RENDER = [ + 'Attribute', + 'Description', + 'Required', + 'Validation Rules' +] + +def on_pre_build(config, **kwargs) -> None: + """Pre-process template files. + + Desired markdown: render model template so that + - it is known which attributes require valid values + - clicking on attribute will direct to valid values table + """ + for model in DATA_MODELS: + parent = join("modules", model) + df = ( + pd.read_csv(join(parent, 'annotationProperty.csv')) + .fillna("")) + + # If attribute has a list of valid values, create a link. + for _, row in df[df['Valid Values'].ne("")].iterrows(): + attr_link = "[" + row['Attribute'] + ( + f"](../valid_values/{model}.md#attribute-" + f"{row['Attribute'].lower().replace(' ', '-')})") + df.at[_, 'Attribute'] = attr_link + + # For any validation rules with a regex, replace `\` with `\\` + # for proper rendering. + df['Validation Rules'] = ( + df['Validation Rules'] + .replace(r"\\", r"\\\\", regex=True)) + + # Indicate "None" if there are no validation rules for the attribute. + df.loc[df['Validation Rules'] == "", "Validation Rules"] = "_None_" + + df[COLS_TO_RENDER].to_csv(join(parent, 'template.csv'), index=False)