Skip to content

Commit

Permalink
updated tests to use list for all objects category and type fields
Browse files Browse the repository at this point in the history
  • Loading branch information
B3rse committed Oct 31, 2023
1 parent 3fc75e5 commit fd77a9b
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 36 deletions.
8 changes: 4 additions & 4 deletions pipeline_utils/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

# Variables
PIPELINE_DEPLOY = 'pipeline_deploy'
CONSORTIA_ALIAS = 'CONSORTIUM'
SUBMISSION_CENTERS_ALIAS = 'SUBMISSION_CENTER'
CONSORTIA_ALIAS = ['smaht_consortium']
SUBMISSION_CENTERS_ALIAS = ['smaht_dac']
KEYS_ALIAS = '~/.cgap-keys.json'
MAIN_ALIAS = 'main'
BUILDER_ALIAS = '<ff-env>-pipeline-builder'
Expand Down Expand Up @@ -51,9 +51,9 @@ def main(args=None):
pipeline_deploy_parser.add_argument('--account', required=False, help='AWS account to use for deployment')
pipeline_deploy_parser.add_argument('--region', required=False, help='AWS account region to use for deployment')
pipeline_deploy_parser.add_argument('--consortia', required=False, nargs='+', help='List of consortia to use for deployment',
default=[CONSORTIA_ALIAS])
default=CONSORTIA_ALIAS)
pipeline_deploy_parser.add_argument('--submission-centers', required=False, nargs='+', help='List of centers to use for deployment',
default=[SUBMISSION_CENTERS_ALIAS])
default=SUBMISSION_CENTERS_ALIAS)

pipeline_deploy_parser.add_argument('--post-software', action='store_true', help='POST|PATCH Software objects')
pipeline_deploy_parser.add_argument('--post-file-format', action='store_true', help='POST|PATCH FileFormat objects')
Expand Down
7 changes: 5 additions & 2 deletions pipeline_utils/schemas/yaml_file_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@
}
},
'type': {
schema.DESCRIPTION: 'Type of the FileReference',
schema.TYPE: schema.STRING
schema.DESCRIPTION: 'Types of the FileReference',
schema.TYPE: schema.ARRAY,
schema.ITEMS: {
schema.TYPE: schema.STRING
}
},
'version': {
schema.DESCRIPTION: 'Version of the FileReference',
Expand Down
6 changes: 3 additions & 3 deletions tests/repo_correct/portal_objects/file_format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ extension: bam
description: format to represent aligned reads
secondary_formats:
- bai
file_types:
- FileReference
- FileProcessed
# file_types:
# - FileReference
# - FileProcessed
status: shared

---
Expand Down
12 changes: 8 additions & 4 deletions tests/repo_correct/portal_objects/file_reference.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ secondary_files:
status: uploading
uuid: 1936f246-22e1-45dc-bb5c-9cfd55537fe7
accession: GAPFIXRDPDK5
category: Sequencing Reads
type: Unaligned Reads
category:
- Sequencing Reads
type:
- Unaligned Reads

---

# hg38 fasta (MINIMAL)
name: reference_genome
category: Sequencing Reads
type: Aligned Reads
category:
- Sequencing Reads
type:
- Aligned Reads
description: hg38 full reference genome plus decoy for CGAP, fasta format
format: fa
version: hg38
6 changes: 4 additions & 2 deletions tests/repo_correct/portal_objects/software.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ version: 4.1.2
title: gatk 4.1.2
source_url: 'http:/broad'
description: gatk software package
category: Aligner
category:
- Aligner

---

# picard (MINIMAL)
# + uuid
# + accession
name: picard
category: Variant Caller
category:
- Variant Caller
commit: 324ePT
uuid: efdac7ec-7da3-4f23-9056-7a04abbc5e8b
accession: GAPMKF1LL29K
3 changes: 2 additions & 1 deletion tests/repo_correct/portal_objects/workflows/A_gatk-HC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
name: gatk-HaplotypeCaller
description: Run HaplotypeCaller from gatk package

category: Annotation
category:
- Annotation

runner:
language: wdl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ output:
uuid: 1936f246-22e1-45dc-bb5c-9cfd55537fe9
accession: GAPFIXRDPDK1

category: Feature Calling
category:
- Feature Calling
6 changes: 3 additions & 3 deletions tests/repo_error/portal_objects/file_format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ extension: bam
description: format to represent aligned reads
secondary_formats:
- bai
file_types:
- FileReference
- FileProcessed
# file_types:
# - FileReference
# - FileProcessed
status: shared

---
Expand Down
12 changes: 8 additions & 4 deletions tests/repo_error/portal_objects/file_reference.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ secondary_files:
status: uploading
uuid: 1936f246-22e1-45dc-bb5c-9cfd55537fe7
accession: GAPFIXRDPDK5
category: Sequencing Reads
type: Unaligned Reads
category:
- Sequencing Reads
type:
- Unaligned Reads

---

# hg38 fasta (MINIMAL)
name: reference_genome
category: Sequencing Reads
type: Aligned Reads
category:
- Sequencing Reads
type:
- Aligned Reads
description: hg38 full reference genome plus decoy for CGAP, fasta format
format: fa
version: hg38
6 changes: 4 additions & 2 deletions tests/repo_error/portal_objects/software.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ name: gatk
title: gatk 4.1.2
source_url: 'http:/broad'
description: gatk software package
category: Aligner
category:
- Aligner

---

# picard (MINIMAL)
# + uuid
# + accession
name: picard
category: Variant Caller
category:
- Variant Caller
commit: 324ePT
uuid: efdac7ec-7da3-4f23-9056-7a04abbc5e8b
accession: GAPMKF1LL29K
3 changes: 2 additions & 1 deletion tests/repo_error/portal_objects/workflows/A_gatk-HC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
name: gatk-HaplotypeCaller
description: Run HaplotypeCaller from gatk package

category: Annotation
category:
- Annotation

runner:
language: wdl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ output:
uuid: 1936f246-22e1-45dc-bb5c-9cfd55537fe9
accession: GAPFIXRDPDK1

category: Feature Calling
category:
- Feature Calling
8 changes: 4 additions & 4 deletions tests/test_yaml_file_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def test_file_reference():
"consortia": ["cgap-core"],
"status": "uploading",
"uuid": "1936f246-22e1-45dc-bb5c-9cfd55537fe7",
"data_category": "Sequencing Reads",
"data_type": "Unaligned Reads"
"data_category": ["Sequencing Reads"],
"data_type": ["Unaligned Reads"]
},
{
"aliases": ["cgap-core:FileReference-reference_genome_hg38"],
Expand All @@ -33,8 +33,8 @@ def test_file_reference():
"submission_centers": ["hms-dbmi"],
"consortia": ["cgap-core"],
"status": None,
"data_category": "Sequencing Reads",
"data_type": "Aligned Reads"
"data_category": ["Sequencing Reads"],
"data_type": ["Aligned Reads"]
}
]

Expand Down
4 changes: 2 additions & 2 deletions tests/test_yaml_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_software():
"source_url": "http:/broad",
"title": "gatk 4.1.2",
"version": "4.1.2",
"category": "Aligner"
"category": ["Aligner"]
},
{
"accession": "GAPMKF1LL29K",
Expand All @@ -32,7 +32,7 @@ def test_software():
"consortia": ["cgap-core"],
"title": "picard [324ePT]",
"uuid": "efdac7ec-7da3-4f23-9056-7a04abbc5e8b",
"category": "Variant Caller"
"category": ["Variant Caller"]
}
]

Expand Down
4 changes: 2 additions & 2 deletions tests/test_yaml_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_workflow():
"aliases": ["cgap-core:Workflow-gatk-HaplotypeCaller_v1.0.0"],
"name": "gatk-HaplotypeCaller",
"version": "v1.0.0",
"category": "Annotation",
"category": ["Annotation"],
"arguments": [
{
"argument_format": "bam",
Expand Down Expand Up @@ -65,7 +65,7 @@ def test_workflow():
},
{
"accession": "GAPFIXRDPDK1",
"category": "Feature Calling",
"category": ["Feature Calling"],
"aliases": ["cgap-core:Workflow-gatk-HaplotypeCaller_v1.0.0"],
"name": "gatk-HaplotypeCaller",
"version": "v1.0.0",
Expand Down

0 comments on commit fd77a9b

Please sign in to comment.