Skip to content

Commit

Permalink
Revert both (#2283, #2248) ENCD-4020 commits
Browse files Browse the repository at this point in the history
  • Loading branch information
caseylitton authored Jun 12, 2018
1 parent dd187c9 commit ab3557a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 41 deletions.
25 changes: 6 additions & 19 deletions src/encoded/audit/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2514,19 +2514,18 @@ def audit_experiment_ChIP_control(value, system, files_structure):
return

num_IgG_controls = 0

for control_dataset in value['possible_controls']:
if not is_control_dataset(control_dataset):
for control in value['possible_controls']:
if ('target' not in control) or ('control' not in control['target']['investigated_as']):
detail = 'Experiment {} is ChIP-seq but its control {} is not linked to a target with investigated.as = control'.format(
value['@id'],
control_dataset['@id'])
control['@id'])
yield AuditFailure('invalid possible_control', detail, level='ERROR')
return

if not control_dataset.get('replicates'):
if not control.get('replicates'):
continue

if 'antibody' in control_dataset.get('replicates')[0]:
if 'antibody' in control.get('replicates')[0]:
num_IgG_controls += 1

# If all of the possible_control experiments are mock IP control experiments
Expand All @@ -2535,23 +2534,11 @@ def audit_experiment_ChIP_control(value, system, files_structure):
# The binding group agreed that ChIP-seqs all should have an input control.
detail = 'Experiment {} is ChIP-seq and requires at least one input control, as agreed upon by the binding group. {} is not an input control'.format(
value['@id'],
control_dataset['@id'])
control['@id'])
yield AuditFailure('missing input control', detail, level='NOT_COMPLIANT')
return


def is_control_dataset(dataset):
if 'target' not in dataset:
return False
if (dataset['@type'][0] == 'Experiment'):
return 'control' in dataset['target']['investigated_as']
else:
for target_of_related_dataset in dataset['target']:
if 'control' not in target_of_related_dataset['investigated_as']:
return False
return True


def audit_experiment_spikeins(value, system, excluded_types):
if not check_award_condition(value, [
"ENCODE3",
Expand Down
4 changes: 0 additions & 4 deletions src/encoded/schemas/changelogs/experiment.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
## Changelog for experiment.json

### Minor changes since schema version 20

* *possible_controls* property allows specification of any type of Dataset as possible control

### Schema version 20

* Added *organoid* to biosample_type enums.
Expand Down
8 changes: 4 additions & 4 deletions src/encoded/schemas/experiment.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,16 @@
},
"possible_controls": {
"title": "Controls",
"description": "Dataset that contain files that can serve as scientific controls for this experiment.",
"description": "Experiments that contain files that can serve as scientific controls for this experiment.",
"type": "array",
"default": [],
"uniqueItems": true,
"items": {
"title": "Control",
"description": "A dataset that contains files that can serve as a scientific control for this experiment.",
"comment": "See dataset.json for a list of available identifiers. Exact pairing of data files with their controls is done using file relationships.",
"description": "An experiment that contains files that can serve as a scientific control for this experiment.",
"comment": "See experiment.json for a list of available identifiers. Exact pairing of data files with their controls is done using file relationships.",
"type": "string",
"linkTo": "Dataset"
"linkTo": "Experiment"
}
},
"supersedes": {
Expand Down
14 changes: 0 additions & 14 deletions src/encoded/tests/test_schema_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ def experiment_no_error(testapp, lab, award):
}
return item

@pytest.fixture
def matched_set(testapp, lab, award):
item = {
'lab': lab['@id'],
'award': award['@id']
}
return item

def test_not_pipeline_error_without_message_ok(testapp, experiment_no_error):
# internal_status != pipeline error, so an error detail message is not required.
Expand Down Expand Up @@ -130,10 +123,3 @@ def test_experiment_submission_date_dependency(testapp, experiment_no_error):
'date_submitted': '2000-10-10'},
status=200)

def test_experiment_possible_controls(testapp, experiment_no_error, matched_set):
exp = testapp.post_json('/experiment', experiment_no_error).json['@graph'][0]
matched_set_control = testapp.post_json('/matched_set', matched_set).json['@graph'][0]
testapp.patch_json(
exp['@id'],
{'possible_controls': [matched_set_control['@id']]},
status=200)
1 change: 1 addition & 0 deletions src/encoded/types/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ class Series(Dataset, CalculatedSeriesAssay, CalculatedSeriesBiosample, Calculat
'related_datasets.replicates.library.spikeins_used',
'related_datasets.replicates.library.treatments',
'related_datasets.possible_controls',
'related_datasets.possible_controls.target',
'related_datasets.possible_controls.lab',
'related_datasets.target.organism',
'related_datasets.references',
Expand Down

0 comments on commit ab3557a

Please sign in to comment.