Exemple #1
0
def test_get_options_dir_returns_correct_path_for_run_directory():
    output_dir = "dummy"
    quant_method = "quant"
    assert piq._get_options_dir(
        True, _get_test_options(output_dir),
        **get_test_qr_options(quant_method=quant_method)) == \
        output_dir + os.path.sep + quant_method + "_30x_50b_pe_no_bias"
Exemple #2
0
def test_read_directory_checker_returns_correct_checker_if_directory_should_exist_and_does_exist():
    with utils.temp_dir_created() as temp_dir:
        test_options = _get_test_options(temp_dir)
        options_dir = piq._get_options_dir(
            False, test_options, **get_test_qr_options())
        os.mkdir(options_dir)

        directory_checker = piq._reads_directory_checker(True)
        directory_checker(_get_logger(), test_options, **get_test_qr_options())
Exemple #3
0
def test_prepare_quantification_creates_correct_file():
    with utils.temp_dir_created() as dir_path:
        options = _get_test_options(dir_path)
        qr_options = get_test_qr_options(quant_method=quant._Cufflinks())
        piq._prepare_quantification(
            _get_logger(), options, **qr_options)

        quant_dir = piq._get_options_dir(True, options, **qr_options)
        _check_file_exists(quant_dir, "run_quantification.sh")
Exemple #4
0
def test_prepare_read_simulation_creates_correct_files():
    with utils.temp_dir_created() as dir_path:
        options = _get_test_options(dir_path)
        qr_options = get_test_qr_options()
        piq._prepare_read_simulation(_get_logger(), options, **qr_options)

        reads_dir = piq._get_options_dir(False, options, **qr_options)
        _check_file_exists(reads_dir, "run_simulation.sh")
        _check_file_exists(reads_dir, "flux_simulator_main_expression.par")
        _check_file_exists(reads_dir, "flux_simulator_main_simulation.par")
Exemple #5
0
def test_create_reads_executes_run_simulation_script():
    with utils.temp_dir_created() as dir_path:
        options = _get_test_options(dir_path)
        qr_options = get_test_qr_options()

        reads_dir = piq._get_options_dir(False, options, **qr_options)
        os.mkdir(reads_dir)

        test_filename = "test"
        utils.write_executable_script(
            reads_dir, "run_simulation.sh", "touch " + test_filename)

        piq._create_reads(_get_logger(), options, **qr_options)
        time.sleep(0.1)

        assert os.path.exists(reads_dir + os.path.sep + test_filename)
Exemple #6
0
def test_get_options_dir_returns_correct_path_for_reads_directory():
    output_dir = "dummy"
    assert piq._get_options_dir(
        False, _get_test_options(output_dir),
        **get_test_qr_options(quant_method="quant")) == \
        output_dir + os.path.sep + "30x_50b_pe_no_bias"