seismicrna.core.batch.tests package

Submodules

class seismicrna.core.batch.tests.accum_test.TestAccumulateBatches(methodName='runTest')

Bases: TestCase

test_cluster_2_batches()

. = Match, ! = Mutation, ? = Ambiguous, _ = Not Covered

  3468
  ACGT  C1  C2
--------------
2 _!?! 0.1 0.9
4 .!.. 0.3 0.7
7 !!!_ 0.5 0.5
--------------
0 !!._ 0.6 0.4
6 ?.._ 0.8 0.2
test_mask_2_batches()

. = Match, ! = Mutation, ? = Ambiguous, _ = Not Covered

  3468
  ACGT
------
2 _!?!
4 .!..
7 !!!_
------
0 !!._
6 ?.._
test_relate_1_batch()

. = Match, ! = Mutation, ? = Ambiguous, _ = Not Covered

  1234
  ACGT
------
0 _!?!
1 .!..
2 !!!_
3 !!._
4 ?.._
test_relate_2_batches()

. = Match, ! = Mutation, ? = Ambiguous, _ = Not Covered

  1234
  ACGT
------
0 _!?!
1 .!..
2 !!!_
------
0 !!._
1 ?.._
seismicrna.core.batch.tests.accum_test.get_batch_count_all_func(batches: list[RegionMutsBatch])
class seismicrna.core.batch.tests.confusion_test.TestCalcBhAdjustedPvals(methodName='runTest')

Bases: TestCase

test_2d_ndarray_per_column()
test_against_reference_implementation()
test_all_nan()
test_invalid_pvalues_raise()
test_monotonicity_enforcement()
test_nan_propagates_and_valid_entries_computed()
test_order_invariance()
test_pandas_dataframe()
test_pandas_series_preserves_index()
test_single_value()
test_sorted_input_hand_calc()
test_unsorted_input_hand_calc()
class seismicrna.core.batch.tests.confusion_test.TestCalcConfusionMatrix(methodName='runTest')

Bases: TestCase

test_clusters()
Pos.
Rd. 2579
0   ====
2   A=C=
3   =G=T
5   .G=.
8   ..==
9   T-=.
test_no_clusters()
Pos.
Rd. 2579
0   ====
2   A=C=
3   =G=T
5   .G=.
8   ..==
9   T-=.
class seismicrna.core.batch.tests.confusion_test.TestCalcConfusionPhi(methodName='runTest')

Bases: TestCase

test_dataframe()
test_series()
class seismicrna.core.batch.tests.confusion_test.TestCountIntersection(methodName='runTest')

Bases: TestCase

test_0_overlap()
test_count_intersect()
test_empty()
test_first_overlap()
test_last_overlap()
test_middle_overlap()
class seismicrna.core.batch.tests.confusion_test.TestInitConfusionMatrix(methodName='runTest')

Bases: TestCase

test_clusters()
test_no_clusters()
test_no_clusters_min_gap()
seismicrna.core.batch.tests.confusion_test.bh_ref_adjusted(p)

Reference BH adjusted p-values using scipy, NaN-safe.

class seismicrna.core.batch.tests.count_test.TestCalcCountPerPos(methodName='runTest')

Bases: TestCase

test_average()
      11  13  14  15
Read   A   C   G   T
--------------------
   0   1  64   1 255
   1 255 255   1 255
   5 128   1   1  16
   6 255   1   1  17
   7   1  64   1 255
   9 128   1   1   1
  10   1   1   1 255
  11   1   1   1   1
  14  64   3   1   1
  16 255 255   1   1
test_clusters()
      11  13  14  15
Read   A   C   G   T
--------------------
   0   1  64   1 255
   1 255 255   1 255
   5 128   1   1  16
   6 255   1   1  17
   7   1  64   1 255
   9 128   1   1   1
  10   1   1   1 255
  11   1   1   1   1
  14  64   3   1   1
  16 255 255   1   1
class seismicrna.core.batch.tests.count_test.TestCalcCountPerRead(methodName='runTest')

Bases: TestCase

test_average()
      11  13  14  15  17
Read   A   C   G   T   C
------------------------
   0   1  64   1 255 255
   1 255 255   1 255 255
   5 128   1   1  16   1
   6 255   1   1  17  64
   7   1  64   1 255 255
   9 128   1   1   1  16
  10   1   1   1 255 255
  11   1   1   1   1   1
  14  64   3   1   1 128
  16 255 255   1   1   2
class seismicrna.core.batch.tests.count_test.TestCalcCoverage(methodName='runTest')

Bases: TestCase

test_0_positions()
test_0_positions_weighted()
test_1_position()
test_1_segment()
1234567890123

-
--
---
 ---
   -
   ---
-------
-------------
      -------
       ---
         -
         ---
          ---
           --
            -
test_1_segment_mask()
1234567890123

.
..
---
 ...
   -
   ---
.......
.............
      .......
       ...
         -
         ...
          ...
           ..
            .
test_1_segment_redundant()
1234567890123

-------
   -------
      -------
   -------
-------
test_1_segment_redundant_weighted()
1234567890123   C1  C2

-------         0.6 0.2
   -------      0.5 0.3
      -------   0.9 0.8
   -------      0.4 1.0
-------         0.1 0.7
test_1_segment_weighted()
1234567890123   C1  C2

-               0.1 1.5
--              0.2 1.4
---             0.3 1.3
 ---            0.4 1.2
   -            0.5 1.1
   ---          0.6 1.0
-------         0.7 0.9
-------------   0.8 0.8
      -------   0.9 0.7
       ---      1.0 0.6
         -      1.1 0.5
         ---    1.2 0.4
          ---   1.3 0.3
           --   1.4 0.2
            -   1.5 0.1
test_2_segments_mask()
01234567890123

    [---]
][

 [---]
 ][

 [---]
    ][

 [---]
     ][

 [---]
      [===]

][
 [===]

 ][
 [===]

    ][
 [===]

     ][
 [===]
test_2_segments_nomask()
1234567890123

-----
        =====

   -----
     =====

  ----
  ====

        -
        =

    ----
         ====

    -----
         ====

    ------
         ====

-------------
=============
class seismicrna.core.batch.tests.count_test.TestCalcRelsPerPos(methodName='runTest')

Bases: TestCase

test_average()
      11  13  14  15
Read   A   C   G   T
--------------------
   0   1  64   1 255
   1 255 255   1 255
   5 128   1   1  16
   6 255   1   1  17
   7   1  64   1 255
   9 128   1   1   1
  10   1   1   1 255
  11   1   1   1   1
  14  64   3   1   1
  16 255 255   1   1
test_clusters()
      11  13  14  15
Read   A   C   G   T
--------------------
   0   1  64   1 255
   1 255 255   1 255
   5 128   1   1  16
   6 255   1   1  17
   7   1  64   1 255
   9 128   1   1   1
  10   1   1   1 255
  11   1   1   1   1
  14  64   3   1   1
  16 255 255   1   1
class seismicrna.core.batch.tests.count_test.TestCalcRelsPerRead(methodName='runTest')

Bases: TestCase

test_average()
      11  13  14  15  17
Read   A   C   G   T   C
------------------------
   0   1  64   1 255 255
   1 255 255   1 255 255
   5 128   1   1  16   1
   6 255   1   1  17  64
   7   1  64   1 255 255
   9 128   1   1   1  16
  10   1   1   1 255 255
  11   1   1   1   1   1
  14  64   3   1   1 128
  16 255 255   1   1   2
class seismicrna.core.batch.tests.count_test.TestCountEndCoords(methodName='runTest')

Bases: TestCase

test_length_0()
test_length_1()
test_length_2_diff()
test_length_2_same()
test_length_3_diff_weights()
test_length_3_same_weights()
test_length_3_same_weights_int()
class seismicrna.core.batch.tests.ends_test.TestCountReadsSegments(methodName='runTest')

Bases: TestCase

test_non_array()
test_valid()
test_wrong_dims()
class seismicrna.core.batch.tests.ends_test.TestFindContiguousReads(methodName='runTest')

Bases: TestCase

test_0_segments()
test_1_segment()
test_2_segments_mask()
test_2_segments_nomask()
class seismicrna.core.batch.tests.ends_test.TestFindReadEnd3s(methodName='runTest')

Bases: TestCase

test_0_segments()
test_1_segment_masked()
test_1_segment_none_masked()
test_2_segments_both_masked()
test_2_segments_masked()
test_2_segments_none_masked()
class seismicrna.core.batch.tests.ends_test.TestFindReadEnd5s(methodName='runTest')

Bases: TestCase

test_0_segments()
test_1_segment_masked()
test_1_segment_none_masked()
test_2_segments_both_masked()
test_2_segments_masked()
test_2_segments_none_masked()
class seismicrna.core.batch.tests.ends_test.TestMatchReadsSegments(methodName='runTest')

Bases: TestCase

test_match()
class seismicrna.core.batch.tests.ends_test.TestMergeReadEnds(methodName='runTest')

Bases: TestCase

test_mismatch()
test_valid()
test_wrong_dims()
class seismicrna.core.batch.tests.ends_test.TestSortSegmentEnds(methodName='runTest')

Bases: TestCase

test_0_segments()
test_1_segment_mask()
test_1_segment_nomask()
test_2_segments_mask()
test_2_segments_nomask()
test_n_segments_contig()
test_n_segments_discontig()
class seismicrna.core.batch.tests.muts_test.TestCalcMutsMatrix(methodName='runTest')

Bases: TestCase

test_full_reads_no_muts()
test_full_reads_no_muts_some_masked()
test_paired_reads_masked_segments()
test_paired_reads_no_muts()
test_partial_reads_muts()
test_partial_reads_no_muts()
test_partial_reads_no_muts_some_masked()
class seismicrna.core.batch.tests.muts_test.TestInjectCloseMuts(methodName='runTest')

Bases: TestCase

region = Region(r__full:1-5)
test_all_zero_probs()
test_empty_mut_probs()
test_existing_mutation_not_duplicated()
test_invalid_above_one()
test_invalid_ndim()
test_invalid_negative()
test_masked_position_skipped()
test_only_mutated_reads_injected()
test_original_mutation_preserved()
test_prob_one_injects_all()
test_read_not_covering_skipped()
test_window_of_two()
class seismicrna.core.batch.tests.muts_test.TestMergeCloseMuts(methodName='runTest')

Bases: TestCase

region = Region(r__full:1-5)
test_min_gap_zero_keeps_all()
test_no_mutations()
test_non_pattern_relationships_preserved()
test_reads_processed_independently()
test_single_mutation_survives()
test_three_muts_middle_is_artifact()
test_two_muts_gap_equals_min_gap()
test_two_muts_gap_exceeds_min_gap()
test_two_muts_gap_less_than_min_gap()