|
9 | 9 | )
|
10 | 10 |
|
11 | 11 |
|
| 12 | +def get_assay_terms(value, system): |
| 13 | + assay_terms = set() |
| 14 | + for sample in value.get('applied_to_samples', []): |
| 15 | + sample_object = system.get('request').embed( |
| 16 | + sample + '@@object_with_select_calculated_properties?field=file_sets') |
| 17 | + file_sets = sample_object.get('file_sets', []) |
| 18 | + for file_set in file_sets: |
| 19 | + if file_set.startswith('/measurement-sets/'): |
| 20 | + input_file_set_object = system.get('request').embed(file_set + '@@object?skip_calculated=true') |
| 21 | + assay_terms.add(input_file_set_object.get('assay_term')) |
| 22 | + return list(assay_terms) |
| 23 | + |
| 24 | + |
12 | 25 | @audit_checker('ConstructLibrarySet', frame='object')
|
13 | 26 | def audit_construct_library_set_associated_phenotypes(value, system):
|
14 | 27 | '''
|
@@ -97,26 +110,35 @@ def audit_integrated_content_files(value, system):
|
97 | 110 | '''
|
98 | 111 | [
|
99 | 112 | {
|
100 |
| - "audit_description": "Guide libraries are expected to link to an integrated content file of guide RNA sequences.", |
| 113 | + "audit_description": "Guide libraries used in CRISPR assays are expected to link to an integrated content file of guide RNA sequences.", |
101 | 114 | "audit_category": "missing guide RNA sequences",
|
102 | 115 | "audit_level": "NOT_COMPLIANT"
|
103 | 116 | },
|
104 | 117 | {
|
105 |
| - "audit_description": "Reporter libraries are expected to link to an integrated content file of MPRA sequence designs.", |
| 118 | + "audit_description": "Reporter libraries used in MPRA assays are expected to link to an integrated content file of MPRA sequence designs.", |
106 | 119 | "audit_category": "missing MPRA sequence designs",
|
107 | 120 | "audit_level": "NOT_COMPLIANT"
|
108 | 121 | }
|
109 | 122 | ]
|
110 | 123 | '''
|
111 | 124 | audit_message_guide = get_audit_message(audit_integrated_content_files, index=0)
|
112 | 125 | audit_message_reporter = get_audit_message(audit_integrated_content_files, index=1)
|
| 126 | + assay_terms = get_assay_terms(value, system) |
| 127 | + CRISPR_assays = [ |
| 128 | + '/assay-terms/OBI_0003659/', # in vitro CRISPR screen assay |
| 129 | + '/assay-terms/OBI_0003660/', # in vitro CRISPR screen using single-cell RNA-seq |
| 130 | + '/assay-terms/OBI_0003661/' # in vitro CRISPR screen using flow cytometry |
| 131 | + ] |
| 132 | + MPRA_assays = [ |
| 133 | + '/assay-terms/OBI_0002675/' # massively parallel reporter assay |
| 134 | + ] |
113 | 135 | library_expectation = {
|
114 |
| - 'guide library': ('guide RNA sequences', audit_message_guide), |
115 |
| - 'reporter library': ('MPRA sequence designs', audit_message_reporter), |
| 136 | + 'guide library': ('guide RNA sequences', audit_message_guide, CRISPR_assays), |
| 137 | + 'reporter library': ('MPRA sequence designs', audit_message_reporter, MPRA_assays), |
116 | 138 | }
|
117 | 139 | integrated_content_files = value.get('integrated_content_files', '')
|
118 | 140 | library_type = value.get('file_set_type', '')
|
119 |
| - if library_type in library_expectation: |
| 141 | + if library_type in library_expectation and any(assay_term in library_expectation[library_type][2] for assay_term in assay_terms): |
120 | 142 | file_expectation = library_expectation[library_type][0]
|
121 | 143 | audit_message = library_expectation[library_type][1]
|
122 | 144 | if integrated_content_files:
|
|
0 commit comments