forked from dbmi-bgm/portal-pipeline-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from smaht-dac/naming_objects
.
- Loading branch information
Showing
10 changed files
with
200 additions
and
24 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
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
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,32 @@ | ||
from pipeline_utils.schemas import schema | ||
|
||
yaml_reference_genome_schema = { | ||
## Schema ######################### | ||
schema.SCHEMA: 'https://json-schema.org/draft/2020-12/schema', | ||
schema.ID: '/schemas/YAMLReferenceGenome', | ||
schema.TITLE: 'YAMLReferenceGenome', | ||
schema.DESCRIPTION: 'Schema to validate a YAML description of a ReferenceGenome', | ||
schema.TYPE: schema.OBJECT, | ||
schema.PROPERTIES: { | ||
'name': { | ||
schema.DESCRIPTION: 'Name of the ReferenceGenome', | ||
schema.TYPE: schema.STRING | ||
}, | ||
'version': { | ||
schema.DESCRIPTION: 'Version of the ReferenceGenome', | ||
schema.TYPE: schema.STRING | ||
}, | ||
'code': { | ||
schema.DESCRIPTION: 'Code for the ReferenceGenome', | ||
schema.TYPE: schema.STRING | ||
}, | ||
'files': { | ||
schema.DESCRIPTION: 'Associated reference files', | ||
schema.TYPE: schema.ARRAY, | ||
schema.ITEMS: { | ||
schema.TYPE: schema.STRING | ||
} | ||
} | ||
}, | ||
schema.REQUIRED: ['name', 'version', 'code'] | ||
} |
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,12 @@ | ||
################################################################ | ||
# GRCh38 Genome Reference | ||
################################################################ | ||
name: GRCh38 | ||
version: GCA_000001405.15 | ||
files: | ||
- complete-reference-fasta-no-alt@GCA_000001405.15_GRCh38_no_decoy | ||
- complete-reference-bwt-no-alt@GCA_000001405.15_GRCh38_no_decoy | ||
# Required for displaying in the file name | ||
code: GRCh38 | ||
# This is required to sync with a previously generated object | ||
uuid: e89937e6-80d3-4605-8dea-4a74c7981a9f |
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
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,36 @@ | ||
################################################################# | ||
# Libraries | ||
################################################################# | ||
import sys, os | ||
import pytest | ||
from pipeline_utils.lib import yaml_parser | ||
|
||
################################################################# | ||
# Tests | ||
################################################################# | ||
def test_software(): | ||
""" | ||
""" | ||
res = [ | ||
{"code": "GRCh38", | ||
"title": "GRCh38 [GCA_000001405.15]", | ||
"consortia": ["cgap-core"], | ||
"identifier": "GRCh38", | ||
"submission_centers": ["hms-dbmi"], | ||
"uuid": "e89937e6-80d3-4605-8dea-4a74c7981a9f", | ||
"files": [ | ||
"cgap-core:ReferenceFile-complete-reference-fasta-no-alt_GCA_000001405.15_GRCh38_no_decoy", | ||
"cgap-core:ReferenceFile-complete-reference-bwt-no-alt_GCA_000001405.15_GRCh38_no_decoy" | ||
], | ||
"aliases": ["cgap-core:ReferenceGenome-GRCh38_GCA_000001405.15"]} | ||
|
||
] | ||
|
||
for i, d in enumerate(yaml_parser.load_yaml('tests/repo_correct/portal_objects/reference_genome.yaml')): | ||
# creating JSON object | ||
d_ = yaml_parser.YAMLReferenceGenome(d).to_json( | ||
submission_centers=["hms-dbmi"], | ||
consortia=["cgap-core"] | ||
) | ||
# check | ||
assert d_ == res[i] |
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