예제 #1
0
def test_forcefields(args, input_pdb, output_pqr, expected_pqr, tmp_path):
    """Basic code to run 1AFS with --whitespace for different forcefields."""
    common.run_pdb2pqr(
        args=args,
        input_pdb=input_pdb,
        output_pqr=output_pqr,
        expected_pqr=expected_pqr,
        tmp_path=tmp_path,
    )
예제 #2
0
def test_other_options(args, input_pdb, output_pqr, expected_pqr, tmp_path):
    """Basic code to run 1AFS with --whitespace."""
    common.run_pdb2pqr(
        args=args,
        input_pdb=input_pdb,
        output_pqr=output_pqr,
        expected_pqr=expected_pqr,
        tmp_path=tmp_path,
    )
예제 #3
0
def test_basic(args, input_pdb, output_pqr, expected_pqr, tmp_path):
    """Basic code to run 1AFS."""
    common.run_pdb2pqr(
        args=args,
        input_pdb=input_pdb,
        output_pqr=output_pqr,
        expected_pqr=expected_pqr,
        tmp_path=tmp_path,
    )
예제 #4
0
def test_broken_backbone(input_pdb, tmp_path):
    """Test graceful failure of optimization with missing backbone atoms."""
    args = "--log-level=INFO --ff=AMBER --drop-water"
    output_pqr = Path(input_pdb).stem + ".pqr"
    common.run_pdb2pqr(
        args=args,
        input_pdb=input_pdb,
        output_pqr=output_pqr,
        tmp_path=tmp_path,
    )
예제 #5
0
def test_basic_cif(input_pdb, tmp_path):
    """Non-regression tests on CIF-format biomolecules without ligands."""
    args = "--log-level=INFO --ff=AMBER --drop-water --apbs-input=apbs.in"
    output_pqr = Path(input_pdb).stem + ".cif"
    common.run_pdb2pqr(
        args=args,
        input_pdb=input_pdb,
        output_pqr=output_pqr,
        tmp_path=tmp_path,
    )
예제 #6
0
def test_propka_apo(input_pdb, tmp_path):
    """PROPKA non-regression tests on biomolecules without ligands."""
    args = ("--log-level=INFO --ff=AMBER --drop-water "
            "--titration-state-method=propka")
    output_pqr = Path(input_pdb).stem + ".pqr"
    common.run_pdb2pqr(
        args=args,
        input_pdb=input_pdb,
        output_pqr=output_pqr,
        tmp_path=tmp_path,
    )
예제 #7
0
def test_ligand_biomolecule(input_pdb, tmp_path):
    """PROPKA non-regression tests on biomolecules without ligands."""
    input_pdb = Path(input_pdb)
    ligand = Path("tests/data") / f"{input_pdb.stem}-ligand.mol2"
    args = f"--log-level=INFO --ff=AMBER --drop-water --ligand={ligand}"
    output_pqr = Path(input_pdb).stem + ".pqr"
    _LOGGER.debug(f"Running test in {tmp_path}")
    common.run_pdb2pqr(
        args=args,
        input_pdb=input_pdb,
        output_pqr=output_pqr,
        tmp_path=tmp_path,
    )
예제 #8
0
def test_log_output_in_pqr_location(
    capture, input_file, output_file, tmp_path
):
    """Test that a log file is generated when calling the __init__.py"""
    args = "--log-level=INFO --ff=AMBER"
    input_path = common.DATA_DIR / input_file
    output_pqr = output_file
    common.run_pdb2pqr(
        args=args,
        input_pdb=input_path,
        output_pqr=output_pqr,
        tmp_path=tmp_path,
    )

    # This match tests that the log file is output to the same location
    # as the output pqr
    capture.check_present(
        (
            "pdb2pqr.io",
            "INFO",
            f'Logs stored: {tmp_path / output_file.split(".")[0]}.log',
        )
    )