Skip to content

Commit

Permalink
feat(schemas): provide validation for lift.yaml
Browse files Browse the repository at this point in the history
Provides a lift.yaml file and apropriate schema validation for it.
  • Loading branch information
rbpatt2019 committed Dec 6, 2021
1 parent a901850 commit b0b5b9c
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
samples: "config/samples.yaml"

lift: "config/lift.yaml"

get_whitelist:
url: "https://github.com/10XGenomics/cellranger/raw/master/lib/python/cellranger/barcodes/3M-february-2018.txt.gz"

Expand Down
4 changes: 4 additions & 0 deletions config/lift.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Glp1r:
chr: 17
start: 31038812
end: 31078178
7 changes: 6 additions & 1 deletion workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ from yaml import safe_load
# Validate structures
with open(config["samples"], "r") as file:
metadata = safe_load(file)
validate(metadata, schema="../schema/samples.schema.yaml")
validate(metadata, schema="../schema/samples.schema.yaml")

with open(config["lift"], "r") as file:
lift = safe_load(file)
validate(lift, schema="../schema/lift.schema.yaml")

validate(config, schema="../schema/config.schema.yaml")

# Some useful variables
Expand Down
4 changes: 4 additions & 0 deletions workflow/schema/config.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ properties:
description: Samplesheet location
type: string

lift:
description: PolyA_DB Coordinates
type: string

get_whitelist:
description: Step Parametres
type: object
Expand Down
20 changes: 20 additions & 0 deletions workflow/schema/lift.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$schema: "http://json-schema.org/draft-07/schema#"

description: Sample File Schema

additionalProperties: false
patternProperties:
^[^\W_]*$:
description: Gene Symbol
type: object
additionalProperties: false
properties:
chr:
description: Chromosome number
type: integer
start:
description: Start coordinate, 1-indexed
type: integer
end:
description: End Coordinate, 1-indexed
type: integer

0 comments on commit b0b5b9c

Please sign in to comment.