Exemplo n.º 1
0
def test_find_a_ctg_placement_3():
    """
    Test empty p_ctg paths. If the primary contig cannot be found, this should
    throw an exception.
    """
    p_paths = {}
    fp_in = StringIO(test_placement_1_a_path_as_text)
    a_paths = mod.load_tiling_paths_from_stream(fp_in, contig_lens=None, whitelist_seqs=None)

    with pytest.raises(Exception):
        result = mod.find_a_ctg_placement(p_paths, a_paths)
Exemplo n.º 2
0
def test_find_a_ctg_placement_2():
    """
    Test empty a_ctg paths.
    """
    fp_in = StringIO(test_placement_1_p_path_as_text)
    p_paths = mod.load_tiling_paths_from_stream(fp_in, contig_lens=None, whitelist_seqs=None)
    a_paths = {}

    result = mod.find_a_ctg_placement(p_paths, a_paths)

    assert(len(result.keys()) == 0)
Exemplo n.º 3
0
def test_find_a_ctg_placement_3():
    """
    Test empty p_ctg paths. If the primary contig cannot be found, this should
    throw an exception.
    """
    p_paths = {}
    fp_in = StringIO(test_placement_1_a_path_as_text)
    a_paths = mod.load_tiling_paths_from_stream(fp_in,
                                                contig_lens=None,
                                                whitelist_seqs=None)

    with pytest.raises(Exception):
        result = mod.find_a_ctg_placement(p_paths, a_paths)
Exemplo n.º 4
0
def test_find_a_ctg_placement_2():
    """
    Test empty a_ctg paths.
    """
    fp_in = StringIO(test_placement_1_p_path_as_text)
    p_paths = mod.load_tiling_paths_from_stream(fp_in,
                                                contig_lens=None,
                                                whitelist_seqs=None)
    a_paths = {}

    result = mod.find_a_ctg_placement(p_paths, a_paths)

    assert (len(list(result.keys())) == 0)
Exemplo n.º 5
0
def test_find_a_ctg_placement_1():
    """
    Normal test case.
    The find_a_ctg_placement method expects a valid primary contig tiling path dict and a
    valid associate contig tiling path dict as inputs.
    Validation of the construction of TilingPath objects is performed in the tests
    above; here we take these objects for granted.
    """
    fp_in = StringIO(test_placement_1_p_path_as_text)
    p_paths = mod.load_tiling_paths_from_stream(fp_in, contig_lens=None, whitelist_seqs=None)
    fp_in = StringIO(test_placement_1_a_path_as_text)
    a_paths = mod.load_tiling_paths_from_stream(fp_in, contig_lens=None, whitelist_seqs=None)

    result = mod.find_a_ctg_placement(p_paths, a_paths)

    for key, placement in result.iteritems():
        assert(placement == test_placement_1_expected[key])
Exemplo n.º 6
0
def test_find_a_ctg_placement_1():
    """
    Normal test case.
    The find_a_ctg_placement method expects a valid primary contig tiling path dict and a
    valid associate contig tiling path dict as inputs.
    Validation of the construction of TilingPath objects is performed in the tests
    above; here we take these objects for granted.
    """
    fp_in = StringIO(test_placement_1_p_path_as_text)
    p_paths = mod.load_tiling_paths_from_stream(fp_in,
                                                contig_lens=None,
                                                whitelist_seqs=None)
    fp_in = StringIO(test_placement_1_a_path_as_text)
    a_paths = mod.load_tiling_paths_from_stream(fp_in,
                                                contig_lens=None,
                                                whitelist_seqs=None)

    result = mod.find_a_ctg_placement(p_paths, a_paths)

    for key, placement in result.items():
        assert (placement == test_placement_1_expected[key])