Exemplo n.º 1
0
def get_scheme(fasta, config=None):
    if not config:
        config = get_config()
    references = process_fasta(fasta)
    scheme = MultiplexScheme(
        references,
        config.get("primer3"),
        config.get("target_overlap"),
        config.get("step_distance"),
        config.get("min_unique"),
        config.get("prefix"),
    )
    scheme.design_scheme()
    return scheme
Exemplo n.º 2
0
def get_scheme(fasta, **kwargs):
    references = process_fasta(fasta)
    scheme = MultiplexScheme(references, **kwargs)
    scheme.design_scheme()
    return scheme
Exemplo n.º 3
0
def test_scheme_runs_with_single_reference(chikv_input):
    references = process_fasta(chikv_input)[:1]
    scheme = MultiplexScheme(references)
    scheme.design_scheme()

    assert len(scheme.regions) > 30
Exemplo n.º 4
0
def test_process_fasta_too_short_input(input_fasta_short_500):
    with pytest.raises(ValueError, match="too short"):
        process_fasta(input_fasta_short_500, min_ref_size=900)
Exemplo n.º 5
0
def test_process_fasta_gaps_removed(input_fasta_valid_with_gaps):
    references = process_fasta(input_fasta_valid_with_gaps)
    assert "-" not in references[0]
Exemplo n.º 6
0
def test_process_fasta_chikv_demo(chikv_input):
    references = process_fasta(chikv_input)
    assert len(references) == 2
Exemplo n.º 7
0
def test_process_fasta_returns_list_of_seq_records(input_fasta_5_random_valid):
    references = process_fasta(input_fasta_5_random_valid)
    assert len(references) == 5
    assert all(isinstance(r, SeqRecord) for r in references)
Exemplo n.º 8
0
def test_process_fasta_size_difference_over_500(
    input_fasta_size_difference_over_500, ):
    with pytest.raises(ValueError, match="too different in size"):
        process_fasta(input_fasta_size_difference_over_500)
Exemplo n.º 9
0
def test_process_fasta_too_many_records(input_fasta_101_random_valid):
    with pytest.raises(ValueError, match="A maximum of 100"):
        process_fasta(input_fasta_101_random_valid)
Exemplo n.º 10
0
def test_process_fasta_invalid_alphabet(input_fasta_invalid_alphabet):
    with pytest.raises(ValueError, match="invalid nucleotide codes"):
        process_fasta(input_fasta_invalid_alphabet)
Exemplo n.º 11
0
def test_process_fasta_empty_input(input_fasta_empty):
    with pytest.raises(ValueError,
                       match="does not contain any valid references"):
        process_fasta(input_fasta_empty)
Exemplo n.º 12
0
def test_process_fasta_chikv_demo(chikv_input):
    """Does process_fasta return 2 SeqRecord objects for demo CHIKV input?"""
    references = process_fasta(chikv_input)
    assert len(references) == 2
Exemplo n.º 13
0
def test_process_fasta_size_difference_over_500(
    input_fasta_size_difference_over_500, ):
    """Does process_fasta raise for size difference over 500?"""
    with pytest.raises(ValueError, match="too different in size"):
        process_fasta(input_fasta_size_difference_over_500)
Exemplo n.º 14
0
def test_process_fasta_too_many_records(input_fasta_101_random_valid):
    """Does process_fasta raise for too many references?"""
    with pytest.raises(ValueError, match="A maximum of 100"):
        process_fasta(input_fasta_101_random_valid)
Exemplo n.º 15
0
def test_process_fasta_maintains_gaps(input_fasta_valid_with_gaps):
    """Does process_fasta remove gaps?"""
    references = process_fasta(input_fasta_valid_with_gaps)
    assert "-" not in references[0]
Exemplo n.º 16
0
def test_process_fasta_too_many_records(input_fasta_too_many_refs_random_valid):
    """Does process_fasta raise for too many references?"""
    with pytest.raises(ValueError, match=f"A maximum of {config.MAX_REFERENCES}"):
        process_fasta(input_fasta_too_many_refs_random_valid)