seismicrna.duplex.tests package

Submodules

class seismicrna.duplex.tests.duplex_test.DuplexClusterProductTest(methodName='runTest')

Bases: TestCase

A duplex of clustered sources is the cross-product of their clusters.

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_average_source_stays_unclustered()

Combining two unclustered strands yields one average profile.

test_cluster_product_with_no_data_partner()

A clustered strand duplexed with a data-less partner gives one fused profile per cluster of the clustered strand, each of which cofolds on its own reactivities.

test_cross_product_count()

K1 x K2 clusters give K1*K2 fused profiles over the duplex.

test_cross_product_folds()

Each fused cluster profile folds into its own duplex.

test_cross_product_maps_source_clusters()

Combination n=(i,j) carries strand-1 cluster i on the 5’ side and strand-2 cluster j on the 3’ side (product order).

test_fallback_table_without_a_best_k()

A clustered table whose cluster step found no best number of clusters (best_k = 0, its fallback) is duplexed using the one number of clusters it contains, rather than producing none.

test_no_best_k_and_several_ks_is_an_error()

If several numbers of clusters are available and none is best, which to duplex is ambiguous, so it raises rather than guessing.

test_propagates_parent_branch()

A parent (source) branch is carried into the duplex path.

test_rejects_mismatched_parent_branches()

Two data sources on different branches cannot be duplexed.

test_rejects_mismatched_probes()

Two data sources probed with different chemicals cannot be duplexed (the duplex folds with one energy method).

class seismicrna.duplex.tests.duplex_test.DuplexEnergyMethodTest(methodName='runTest')

Bases: TestCase

Cofolding uses SHAPE flags directly (Deigan), DMS pseudo-energies (Cordero), and rejects any method RNAcofold cannot express.

test_cordero_fit_is_per_strand()

Each strand’s Cordero pseudoenergies are fit independently, so one strand’s reactivities do not affect the other’s (a pooled fit would couple them through a shared scale factor).

test_cordero_uses_pseudomus()

Cordero (DMS) feeds pseudo-mutation rates, not reactivities.

test_deigan_uses_shape_flags()

Deigan feeds reactivities with the user’s slope/intercept.

test_profile_rejects_unsupported()
test_resolve_auto()
test_resolve_passthrough()
test_resolve_rejects_unsupported()
class seismicrna.duplex.tests.duplex_test.DuplexPairingTest(methodName='runTest')

Bases: TestCase

Every way of choosing the 3’ strand contributes its own duplexes, so they compose rather than override one another.

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_all_sources_compose()

Pairwise, –dimer, and a partner sequence all contribute at once; none of them suppresses the others.

test_no_duplex_pair_leaves_partners()

–no-duplex-pair drops only the pairwise combinations.

test_nothing_to_duplex()

With every source of pairs turned off, nothing is made.

test_pairwise_is_the_default()
test_rerunning_does_not_duplex_duplexes()

Running duplex again over a directory that already holds its own output makes the same duplexes, not chimeras of them: a duplex table among the inputs is not a strand of a new duplex.

class seismicrna.duplex.tests.duplex_test.DuplexTest(methodName='runTest')

Bases: TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_duplex_dimer()

–dimer combines a table with itself into a homodimer.

test_duplex_named_sequence_partner()

A (name, sequence) partner names the 3’ strand.

test_duplex_sequence_partner()

A data-less partner sequence becomes the 3’ strand: the duplex loads, its cut is the 5’ strand’s length, and the partner’s positions carry no data.

test_fold_duplex_is_graphable()

Folding a duplex produces a duplex structure (via RNAcofold) that pairs with the duplex profile as one entity.

test_loads_via_api()

A duplex table loads like any position table and reconstructs the fused identity, the strand break, and its two sources.

test_per_reference_region_override()

Per-reference overrides beat the global default in both directions, and a conflict is rejected.

class seismicrna.duplex.tests.duplex_test.IterDuplexPairsTest(methodName='runTest')

Bases: TestCase

Duplex candidates are grouped by branches (what make_duplex requires of two strands) and paired in a deterministic order.

test_every_pair()
test_groups_by_branches()
test_groups_by_step_not_flattened_branches()

Tables from different steps do not pair, even on default branches: flattening the branches would drop every step and every empty branch name, making a filter table and a duplex table look alike, but make_duplex compares the branches themselves.

test_one_table_makes_no_pair()
test_order_independent()
seismicrna.duplex.tests.duplex_test.make_cluster_strand(ref: str, seq: DNA, best_k: int) Strand

Build a Strand backed by a synthetic clustered position table with clusters 1..best_k, each carrying distinct mutation rates.

seismicrna.duplex.tests.duplex_test.write_idmut(out_dir: Path, ref: str, seq: DNA, muts: dict) Path