seismicrna.sim.tests package
Submodules
- class seismicrna.sim.tests.abstract_test.AbstractTestBase(methodName='runTest')
Bases:
TestCaseSilence logging during tests; subclasses get tmpdirs as needed.
- classmethod setUpClass()
Hook method for setting up class fixture before running tests in the class.
- classmethod tearDownClass()
Hook method for deconstructing the class fixture after running all tests in the class.
- class seismicrna.sim.tests.abstract_test.FakeFilterPositionTable(*, top: Path, sample: str, ref: str, refseq: DNA, reg: str, clusts: list[tuple[int, int]], counts_per_clust: dict[tuple[int, int], DataFrame])
Bases:
objectDuck-typed FilterPositionTable for abstract_table tests.
Only the attributes that
abstract_tablereads are implemented.- iter_profiles(*, fold_table_region=True, regions=None, **kwargs)
- class seismicrna.sim.tests.abstract_test.TestAbstractTable(methodName='runTest')
Bases:
AbstractTestBase- DB_STRING = '((....))'
- REF = 'ref'
- REFSEQ = DNA('ACGTACGT')
- REG = 'myreg'
- SAMPLE = 'sample'
- setUp()
Hook method for setting up the test fixture before exercising it.
- tearDown()
Hook method for deconstructing the test fixture after testing it.
- test_clustered_multiple_ct_files()
- test_min_aucroc_skips_cluster()
- test_missing_cluster_ct_file_uses_only_available()
- test_no_ct_files_returns_empty()
- test_no_matching_ct_ref_skips_profile()
- test_no_matching_ct_reg_skips_profile()
- test_non_clustered_auto_detect()
- test_non_clustered_with_explicit_struct_file()
- class seismicrna.sim.tests.abstract_test.TestAccumulateRatios(methodName='runTest')
Bases:
AbstractTestBase- test_accumulates_from_empty()
- test_concatenates_arrays_per_key()
- test_three_inputs_compound()
- class seismicrna.sim.tests.abstract_test.TestCalcRatioStats(methodName='runTest')
Bases:
AbstractTestBase- MARGIN = 1e-06
- test_fvar_falls_back_to_margin_when_too_few_values()
- test_fvar_keys_are_acgt()
- test_fvar_known_values()
- test_fvar_omits_n_base()
- test_mean_clipped_to_margin_when_zero()
- test_mean_clipped_to_upper_bound()
- class seismicrna.sim.tests.abstract_test.TestCalcRatios(methodName='runTest')
Bases:
AbstractTestBaseVerify _calc_ratios computes per-position ratios analytically.
- REFSEQ = DNA('ACGTACGT')
- test_loq_paired_vs_unpaired()
- test_per_base_mutation_rate_xm()
- test_per_base_substitution_ratios()
- test_unpaired_collects_only_unpaired_positions()
- class seismicrna.sim.tests.abstract_test.TestEndToEndComposition(methodName='runTest')
Bases:
AbstractTestBase- DB_STRING = '((....))'
- REF = 'ref'
- REFSEQ = DNA('ACGTACGT')
- setUp()
Hook method for setting up the test fixture before exercising it.
- tearDown()
Hook method for deconstructing the test fixture after testing it.
- test_four_tables_accumulate()
- test_single_table()
- test_two_tables_accumulate()
- class seismicrna.sim.tests.abstract_test.TestFormatParamTokens(methodName='runTest')
Bases:
AbstractTestBaseGuard against regressions where sim abstract emits parameters that
make_pmut_meansdoes not accept (e.g.pnd).- test_all_other_keys_still_emitted()
- test_emitted_tokens_round_trip_to_make_pmut_means()
- class seismicrna.sim.tests.cli_test.TestSimCLIInvocation(methodName='runTest')
Bases:
TestCaseSmoke-test each subcommand via CliRunner.
Two tiers:
–help: validates Click’s param parsing and help-text generation for every command (including fold, which needs a positional arg).
empty invocation ([]): calls run() through the full decorator stack with no files; commands return empty results with exit_code 0. fold is excluded because its positional arg is required and Click itself rejects an empty invocation with exit_code 2.
- setUp()
Hook method for setting up the test fixture before exercising it.
- tearDown()
Hook method for deconstructing the test fixture after testing it.
- test_abstract_empty()
- test_abstract_help()
- test_clusts_empty()
- test_clusts_help()
- test_ends_empty()
- test_ends_help()
- test_fastq_empty()
- test_fastq_help()
- test_fold_help()
- test_idmut_empty()
- test_idmut_help()
- test_muts_empty()
- test_muts_help()
- test_params_empty()
- test_params_help()
- test_ref_empty()
- test_ref_help()
- test_total_empty()
- test_total_help()
- class seismicrna.sim.tests.cli_test.TestSimCLIParams(methodName='runTest')
Bases:
TestCaseCheck every CLI param name appears in run()’s signature.
inspect.signature() follows the __wrapped__ chain (all decorators in run_func use @wraps) and stops at the __signature__ set by param_defaults, which preserves the original parameter names.
- test_abstract()
- test_clusts()
- test_ends()
- test_fastq()
- test_fold()
- test_idmut()
- test_muts()
- test_params()
- test_ref()
- test_total()
- class seismicrna.sim.tests.ends_test.TestSimPEnds(methodName='runTest')
Bases:
TestCase- equate(end5: int, end3: int, center_fmean: float, center_fvar: float, length_fmean: float, length_fvar: float, end5s: ndarray, end3s: ndarray, pends: ndarray, **kwargs)
- test_center_fvar_0_length_fvar_0()
- test_zero_length_1_to_0_keep()
- test_zero_length_9_to_8_drop()
- test_zero_length_9_to_8_keep()
- class seismicrna.sim.tests.idmut_test.TestParseMinMutGapWeights(methodName='runTest')
Bases:
TestCase- test_duplicate_gap()
- test_empty_string()
- test_gap_float_string()
- test_gap_not_integer()
- test_multiple_pairs()
- test_multiple_zero_weights_excluded()
- test_negative_gap()
- test_negative_weight()
- test_output_sorted_by_gap()
- test_pair_extra_colon()
- test_pair_missing_colon()
- test_single_pair_gap0()
- test_single_pair_nonzero_gap()
- test_single_pair_weight_zero_invalid()
- test_weight_above_1()
- test_weight_not_float()
- test_weights_do_not_sum_to_1()
- test_weights_exceed_1_in_total()
- test_weights_sum_to_1_within_float_tolerance()
- test_zero_weight_excluded()
- class seismicrna.sim.tests.idmut_test.TestSimulateBatches(methodName='runTest')
Bases:
TestCase- AMB = 129
- NUM_READS = 10000000
- PCLUST = [0.2, 0.5, 0.3]
- P_GAP = {0: 0.2, 5: 0.3, 15: 0.5}
- TOLERANCE = 0.005
- test_drop_read_counts_single_gap()
Single-gap DROP path must yield ~num_reads final reads.
- test_read_counts_with_gap_weights()