Skip to content

Commit 1ff73de

Browse files
committed
rf(schema): Rewrite PHENOTYPE_SUBJECTS_MISSING to run on each phenotype file
1 parent 254e22e commit 1ff73de

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

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)