Skip to content

SN Generic Config item #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ smaht-portal
Change Log
----------

0.168.0
=======
`PR 413 SN Generic Config item <https://github.com/smaht-dac/smaht-portal/pull/413>`

* Add new item, GenericConfig, that can be used to hold JSON objects


0.167.0
=======
`PR 412 Submission Status page: Add Donor and Tissue select fields <https://github.com/smaht-dac/smaht-portal/pull/412>`
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "encoded"
version = "0.167.0"
version = "0.168.0"
description = "SMaHT Data Analysis Portal"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down
1 change: 1 addition & 0 deletions src/encoded/project/loadxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SMaHTProjectLoadxl(SnovaultProjectLoadxl):
"static_section",
"page",
"filter_set",
"generic_config",
"higlass_view_config",
"ingestion_submission",
"ontology",
Expand Down
67 changes: 67 additions & 0 deletions src/encoded/schemas/generic_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"title": "Generic Configuration",
"description": "Configuration details for general use",
"$id": "/profiles/generic_config.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"identifier",
"body"
],
"identifyingProperties": [
"aliases",
"identifier",
"uuid"
],
"additionalProperties": false,
"mixinProperties": [
{
"$ref": "mixins.json#/aliases"
},
{
"$ref": "mixins.json#/attribution"
},
{
"$ref": "mixins.json#/description"
},
{
"$ref": "mixins.json#/identifier"
},
{
"$ref": "mixins.json#/modified"
},
{
"$ref": "mixins.json#/schema_version"
},
{
"$ref": "mixins.json#/status"
},
{
"$ref": "mixins.json#/submitted"
},
{
"$ref": "mixins.json#/tags"
},
{
"$ref": "mixins.json#/title"
},
{
"$ref": "mixins.json#/uuid"
},
{
"$ref": "mixins.json#/version"
}
],
"properties": {
"schema_version": {
"default": "1"
},
"body": {
"additionalProperties": true,
"description": "The config JSON",
"formInput": "code",
"title": "JSON Configuration",
"type": "object"
}
}
}
35 changes: 35 additions & 0 deletions src/encoded/tests/data/workbook-inserts/generic_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[
{
"uuid": "d263fb0c-5476-4b16-bcfa-48623a2b8b0b",
"identifier": "eqm_column_mappings",
"tags": [
"external_quality_metrics"
],
"version": "1",
"body": {
"version": "2.0.0",
"sheet_mappings": {
"DuplexSeq_ExternalQualityMetric": "duplexseq_external_quality_metric",
"DSA_ExternalQualityMetric": "dsa_external_quality_metric"
},
"column_mappings": {
"duplexseq_external_quality_metric": {
"total_raw_reads_sequenced": {
"qc_values#.derived_from": "{name}",
"qc_values#.value": "{value:integer}",
"qc_values#.key": "Total Raw Reads Sequenced",
"qc_values#.tooltip": "# of reads (150bp)"
}
},
"dsa_external_quality_metric": {
"contig_l50": {
"qc_values#.derived_from": "{name}",
"qc_values#.value": "{value: integer}",
"qc_values#.key": "Contig L50",
"qc_values#.tooltip": "L50 of contigs: the count of the smallest number of contigs whose total length makes up 50% of the assembly size"
}
}
}
}
}
]
22 changes: 22 additions & 0 deletions src/encoded/types/generic_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from snovault import collection, load_schema

from .acl import ONLY_ADMIN_VIEW_ACL
from .base import Item


@collection(
name='generic-configs',
unique_key='generic_config:identifier',
acl=ONLY_ADMIN_VIEW_ACL,
properties={
'title': 'Generic Config',
'description': 'Configurations for general use',
})
class GenericConfig(Item):
"""
Item type which contains a JSON `body` property and other metadata.
"""
item_type = 'generic_config'
schema = load_schema("encoded:schemas/generic_config.json")
embedded_list = []
name_key = None
Loading