def test_out_of_range_probe_counts_throws(self, capsys): with pytest.raises(ValueError): results = ArrayType.from_probe_count(100) assert results is None captured = capsys.readouterr() assert captured.out == 'Unknown array type\n'
def _control_probe_selection(self): """ checks that control sections of each manifest match the number of probes the model expects. this TEST DOES NOT RUN because it would require downloading all 4 manifest files each time. """ array_type_filenames = manifests.ARRAY_TYPE_MANIFEST_FILENAMES # array_type : manifest_filename files = { array_type: Path(manifests.MANIFEST_DIR_PATH, manifest_filename).expanduser() for array_type, manifest_filename in array_type_filenames.items() } for array_type, filepath in files.items(): man = manifests.Manifest(array_type, filepath) if ArrayType( array_type ).num_controls != man._Manifest__control_data_frame.shape[0]: raise AssertionError( f'Control probes found ({man._Manifest__control_data_frame.shape[0]}) in file ({filepath}) does not match expected number: {ArrayType(array_type).num_controls}' )
def test_epic_plus(self): array_type = ArrayType.from_probe_count(1055583) assert array_type == ArrayType.ILLUMINA_EPIC_PLUS
def test_epic_probe_counts_upper_bound(self): array_type = ArrayType.from_probe_count(1053000) assert array_type == ArrayType.ILLUMINA_EPIC
def test_450k_probe_counts_upper_bound(self): array_type = ArrayType.from_probe_count(623000) assert array_type == ArrayType.ILLUMINA_450K
def test_27k_probe_counts_upper_bound(self): array_type = ArrayType.from_probe_count(56000) assert array_type == ArrayType.ILLUMINA_27K
def test_no_probe_counts_throws(self): with pytest.raises(TypeError): ArrayType.from_probe_count()