Skip to content

Commit 4b2c5d3

Browse files
authored
Merge pull request #2107 from effigies/schema/phenotype-specificity
feat(schema): Rewrite PHENOTYPE_SUBJECTS_MISSING to run on each phenotype file
2 parents 9aaf7e3 + 2c9e882 commit 4b2c5d3

File tree

3 files changed

+21
-28
lines changed

3 files changed

+21
-28
lines changed

src/schema/meta/context.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ properties:
8080
type: array
8181
items:
8282
type: string
83-
phenotype:
84-
description: 'The union of participant_id columns in phenotype files'
85-
type: array
86-
items:
87-
type: string
8883
subject:
8984
description: 'Properties and contents of the current subject'
9085
type: object
@@ -109,11 +104,6 @@ properties:
109104
type: array
110105
items:
111106
type: string
112-
phenotype:
113-
description: 'The union of session_id columns in phenotype files'
114-
type: array
115-
items:
116-
type: string
117107

118108
# Properties of the current file
119109
path:

src/schema/rules/checks/dataset.yaml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,6 @@ ParticipantIDMismatch:
3030
sorted(dataset.subjects.sub_dirs)
3131
)
3232
33-
# 51
34-
PhenotypeSubjectsMissing:
35-
issue:
36-
code: PHENOTYPE_SUBJECTS_MISSING
37-
message: |
38-
A phenotype/ .tsv file lists subjects that were not found in
39-
the participant_id column found in the participants.tsv file.
40-
level: error
41-
selectors:
42-
- path == '/participants.tsv'
43-
- type(dataset.subjects.phenotype) != 'null'
44-
checks:
45-
- |
46-
allequal(
47-
sorted(intersects(columns.participant_id, dataset.subjects.phenotype)),
48-
sorted(dataset.subjects.phenotype)
49-
)
50-
5133
# 214
5234
SamplesTSVMissing:
5335
issue:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Rules for phenotype files
2+
---
3+
4+
# 51
5+
PhenotypeSubjectsMissing:
6+
issue:
7+
code: PHENOTYPE_SUBJECTS_MISSING
8+
message: |
9+
A phenotype/ .tsv file lists subjects that were not found in
10+
the participant_id column found in the participants.tsv file.
11+
level: error
12+
selectors:
13+
- datatype == 'phenotype'
14+
- suffix == '.tsv'
15+
- type(dataset.subjects.participant_id) != 'null'
16+
checks:
17+
- |
18+
allequal(
19+
sorted(intersects(columns.participant_id, dataset.subjects.participant_id)),
20+
sorted(dataset.subjects.participant_id)
21+
)

0 commit comments

Comments
 (0)