def it_returns_the_fraction_of_all_dark_samples(): with tmp.tmp_folder(chdir=True): n_samples = 5000 sim_params = _stub_sim_params( ErrorModel.from_defaults(n_channels=2), n_samples) prep_result = PrepResult.stub_prep_result( pros=[".", "ABCDEFGHI"], pro_is_decoys=[False, False], peps=[".", "ABB"], pep_pro_iz=[0, 1], ) pep_seq_df = prep_result.pepseqs() dyemat, radmat, recall = _make_arrays("test1", n_peps=2, n_samples=n_samples) sim_worker._do_pep_sim( pep_seq_df[pep_seq_df.pep_i == 1], sim_params, n_samples=n_samples, output_dyemat=dyemat, output_radmat=radmat, output_recall=recall, ) assert np.all((0.9 < recall[1]) & (recall[1] < 1.0))
def it_copies(): error_model = ErrorModel.from_defaults(n_channels=2) src_params = SimParams.construct_from_aa_list(["DE", "Y"], error_model=error_model) src_params._build_join_dfs() src_bleach = src_params.error_model.dyes[0].p_bleach_per_cycle dst_params = src_params.copy() dst_params.error_model.set_dye_param("p_bleach_per_cycle", 1.0) _src_bleach = src_params.error_model.dyes[0].p_bleach_per_cycle _dst_bleach = dst_params.error_model.dyes[0].p_bleach_per_cycle assert _src_bleach == src_bleach assert _dst_bleach == 1.0