From 2c8b5955e452f60c3d78c5d4477fbdf78d002dcc Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 8 Nov 2020 15:16:44 +0530 Subject: [PATCH] added another action to test --- .github/workflows/test-plip-oddt.yaml | 25 +++++++++++++++++++ tests/test-oddt-plip.py | 35 +++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/test-plip-oddt.yaml create mode 100644 tests/test-oddt-plip.py diff --git a/.github/workflows/test-plip-oddt.yaml b/.github/workflows/test-plip-oddt.yaml new file mode 100644 index 0000000..383a1e2 --- /dev/null +++ b/.github/workflows/test-plip-oddt.yaml @@ -0,0 +1,25 @@ +name: Test Curie Functions + +on: [push] + +jobs: + build: + + runs-on: ubuntu-20.04 + if: "! contains(github.event.head_commit.message, 'wip')" + strategy: + matrix: + python-version: [3.8] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + apt update && apt install python3-openbabel openbabel + python -m pip install git + python3 -m pip install git+https://github.com/navanchauhan/plip oddt + - name: Clean Test Data + run: cd tests && python test-oddt-plip.py diff --git a/tests/test-oddt-plip.py b/tests/test-oddt-plip.py new file mode 100644 index 0000000..b993516 --- /dev/null +++ b/tests/test-oddt-plip.py @@ -0,0 +1,35 @@ +from plip.basic import config +from plip.exchange.webservices import fetch_pdb +from plip.structure.preparation import create_folder_if_not_exists, extract_pdbid +from plip.structure.preparation import tilde_expansion, PDBComplex + +pdbId = "6LU7" +print("Downloading PDB:",pdbId) + +pdbfile, pdbid = fetch_pdb(pdbId.lower()) + +pdbpath = tilde_expansion('%s/%s.pdb' % (config.BASEPATH.rstrip('/'), pdbid)) +create_folder_if_not_exists(config.BASEPATH) +with open(pdbpath, 'w') as g: + g.write(pdbfile) + +print("Adding Charges") +import oddt +from oddt.docking.AutodockVina import write_vina_pdbqt +receptor = next(oddt.toolkit.readfile("pdb",pdbpath.split("./")[1])) +receptor.calccharges() +#receptor = next(oddt.toolkits.rdk.readfile("pdb",pdbpath.split("./")[1])) +#receptor.calccharges() + +print("Writing PDBQT") +path = write_vina_pdbqt(receptor,'.',flexible=False) + +smiles = 'CCC(CC)COC(=O)C(C)NP(=O)(OCC1C(C(C(O1)(C#N)C2=CC=C3N2N=CN=C3N)O)O)OC4=CC=CC=C4' + +print("Generating Strucutre") +mol = oddt.toolkit.readstring('smi', smiles) +mol.make3D() +print("Adding Charges") +mol.calccharges() + +path2 = write_vina_pdbqt(mol,'.',flexible=False) \ No newline at end of file