seismicrna.cluster.tests package
Submodules
- class seismicrna.cluster.tests.em_test.TestCalcBic(methodName='runTest')
Bases:
TestCase- test_formula()
- test_large_n_data()
- test_negative_n_data_raises()
- test_negative_n_params_raises()
- test_positive_log_like_raises()
- test_returns_float()
- test_zero_log_like()
- test_zero_n_data_returns_nan()
- test_zero_params()
- class seismicrna.cluster.tests.em_test.TestCalcLogLike(methodName='runTest')
Bases:
TestCase- test_multiple_uniqs()
- test_returns_float()
- test_single_read()
- test_single_uniq_multiple_counts()
- test_zero_counts()
- class seismicrna.cluster.tests.emk_test.TestAssignClusterings(methodName='runTest')
Bases:
TestCase- compare_result(x: ndarray, y: ndarray, expect: ndarray)
- test_0_clusters()
- test_0_positions()
- test_1_cluster()
- test_more_clusters()
- class seismicrna.cluster.tests.emk_test.TestCalcMeanArcsineDistanceClusters(methodName='runTest')
Bases:
TestCase- test_identical_clusters_distance_zero()
- test_nonnegative()
- test_permuted_columns_same_result()
- test_single_cluster()
- test_symmetry()
- class seismicrna.cluster.tests.emk_test.TestCalcMeanPearsonClusters(methodName='runTest')
Bases:
TestCase- test_identical_clusters_correlation_one()
- test_permuted_columns_same_result()
- test_returns_float()
- test_single_cluster()
- class seismicrna.cluster.tests.emk_test.TestGetCommonK(methodName='runTest')
Bases:
TestCase- test_empty_raises()
- test_mixed_ks_raises()
- test_multiple_runs_same_k()
- test_returns_correct_k()
- test_single_run()
- class seismicrna.cluster.tests.emk_test.TestSortRuns(methodName='runTest')
Bases:
TestCase- test_already_sorted()
- test_best_run_first()
- test_empty_list()
- test_mixed_ks_raises()
- test_reverse_order()
- test_single_run()
- class seismicrna.cluster.tests.jackpot_test.TestBootstrapJackpotScores(*args, **kwargs)
Bases:
TestCase- REF = 'test_ref'
- REFS = 'test_refs'
- SAMPLE = 'test_sample'
- run_ideal_jackpot(min_mut_gap: int, mut_collisions: str, mut_probs: str | None = None)
Test that bootstrapping “perfect” data correctly returns a jackpotting quotient that is expected to be 1.
- setUp()
Hook method for setting up the test fixture before exercising it.
- property sim_dir
- sim_jackpot_quotient(min_mut_gap: int, mut_collisions: str, seed: int, mut_probs: str | None = None)
Simulate a dataset and return its jackpotting quotient.
- tearDown()
Hook method for deconstructing the test fixture after testing it.
- test_ideal_jackpot_drop()
- test_ideal_jackpot_merge()
- test_ideal_jackpot_uncorrected()
- class seismicrna.cluster.tests.jackpot_test.TestCalcJackpotQuotient(methodName='runTest')
Bases:
TestCase- test_equal_scores_returns_one()
- test_formula()
- test_real_greater_than_null()
- test_real_less_than_null()
- test_zero_scores_returns_one()
- class seismicrna.cluster.tests.jackpot_test.TestCalcJackpotScore(methodName='runTest')
Bases:
TestCase- test_formula()
- test_single_unique_read()
- test_uniform_obs_eq_exp()
- test_zero_reads_empty_anomalies()
- test_zero_reads_nonempty_raises()
- class seismicrna.cluster.tests.jackpot_test.TestCalcJackpotScoreCi(methodName='runTest')
Bases:
TestCase- test_accepts_numpy_array()
- test_identical_scores_zero_width()
- test_interval_contains_mean()
- test_single_score_returns_nan()
- test_wider_ci_for_higher_confidence()
- class seismicrna.cluster.tests.jackpot_test.TestCalcSemiGAnomaly(methodName='runTest')
Bases:
TestCase- test_array_all_equal()
- test_array_all_unequal()
- test_float_equal()
- test_float_unequal()
- class seismicrna.cluster.tests.jackpot_test.TestLinearizeEndsMatrix(methodName='runTest')
Bases:
TestCase- test_diagonal_only()
- test_empty_matrix()
- test_multiple_entries_values()
- test_only_upper_triangle()
- test_single_entry()
- class seismicrna.cluster.tests.jackpot_test.TestSimClusters(methodName='runTest')
Bases:
TestCase- test_sim_clusters_dropped()
- test_sim_clusters_merged()
- class seismicrna.cluster.tests.jackpot_test.TestSimReads(methodName='runTest')
Bases:
TestCase- static count_reads(reads: ndarray, clusts: ndarray, n_clust: int)
Count reads for each cluster and position.
- test_sim_reads_dropped()
- test_sim_reads_merged()
- class seismicrna.cluster.tests.marginal_test.TestCalcMarginalSimulated(methodName='runTest')
Bases:
TestCaseVerify that calc_marginal returns log probabilities that match the empirical frequencies of simulated reads to within statistical tolerance, for both mut_collisions=”drop” and “merge”.
- test_5pos_gap2_drop()
- test_5pos_gap2_merge()
- class seismicrna.cluster.tests.marginal_test.TestMarginalResps(methodName='runTest')
Bases:
TestCase- compare(p_mut: ndarray, p_ends: ndarray, p_clust: ndarray, end5s: ndarray, end3s: ndarray, unmasked: ndarray, muts_per_pos: list[ndarray], min_mut_gap: int, mut_collisions: str, expect_log_marginals: ndarray, expect_resps: ndarray)
- test_1pos()
- test_1pos_2clusters()
- test_2pos_gap0()
- test_2pos_gap0_2clusters()
- test_2pos_gap1_drop()
- test_2pos_gap1_merge()
- test_2pos_masked0()
- test_2pos_masked1()
- test_6pos_gap2_2clusters_drop()
- test_6pos_gap2_2clusters_merge()