-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update input for program: now only requires receptor and poses file * add test cases * clean up README / installation notes Co-authored-by: karoka <xjr,karo@gmail.com>
- Loading branch information
Showing
1,367 changed files
with
111,244 additions
and
2,032,225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: rnaposers | ||
channels: | ||
- openbabel | ||
- anaconda | ||
- schrodinger | ||
- defaults | ||
dependencies: | ||
- apbs=1.5=h1de35cc_3 | ||
- asn1crypto=1.3.0=py37_0 | ||
- blas=1.0=mkl | ||
- bzip2=1.0.8=h1de35cc_0 | ||
- ca-certificates=2020.1.1=0 | ||
- cairo=1.14.12=hc4e6be7_4 | ||
- certifi=2020.4.5.1=py37_0 | ||
- cffi=1.14.0=py37hb5b8e2f_0 | ||
- chardet=3.0.4=py37_1003 | ||
- cryptography=2.8=py37ha12b0ac_0 | ||
- dbus=1.13.12=h90a0687_0 | ||
- expat=2.2.6=h0a44026_0 | ||
- fontconfig=2.13.0=h5d5b041_1 | ||
- freemol=1.158=py37_1 | ||
- freetype=2.9.1=hb4e5f40_0 | ||
- gettext=0.19.8.1=h15daf44_3 | ||
- glew=2.0.0=0 | ||
- glib=2.63.1=hd977a24_0 | ||
- h5py=2.10.0=py37h3134771_0 | ||
- hdf5=1.10.4=hfa1e0ec_0 | ||
- icu=58.2=h4b95b61_1 | ||
- idna=2.9=py_1 | ||
- intel-openmp=2019.4=233 | ||
- joblib=0.14.1=py_0 | ||
- jpeg=9b=he5867d9_2 | ||
- libcxx=4.0.1=hcfea43d_1 | ||
- libcxxabi=4.0.1=hcfea43d_1 | ||
- libedit=3.1.20181209=hb402a30_0 | ||
- libffi=3.2.1=h0a44026_6 | ||
- libgfortran=3.0.1=2000 | ||
- libiconv=1.15=hdd342a3_7 | ||
- libopenblas=0.3.6=hdc02c5d_2 | ||
- libpng=1.6.37=ha441bb4_0 | ||
- libtiff=4.1.0=hcb84e12_0 | ||
- libxml2=2.9.9=hf6e021a_1 | ||
- llvm-openmp=4.0.1=hcfea43d_1 | ||
- mengine=1=h1de35cc_1 | ||
- mkl=2019.4=233 | ||
- mkl-service=2.3.0=py37hfbe908c_0 | ||
- mkl_fft=1.0.15=py37h5e564d8_0 | ||
- mkl_random=1.1.0=py37ha771720_0 | ||
- mpeg_encode=1=h1de35cc_1 | ||
- mtz2ccp4_px=1.0=hdc02c5d_3 | ||
- ncurses=6.2=h0a44026_0 | ||
- numpy=1.18.1=py37h7241aed_0 | ||
- numpy-base=1.18.1=py37h6575580_1 | ||
- olefile=0.46=py37_0 | ||
- openbabel=2.4.1=py37_6 | ||
- openssl=1.1.1g=h1de35cc_0 | ||
- pandas=1.0.3=py37h6c726b0_0 | ||
- pcre=8.43=h0a44026_0 | ||
- pdb2pqr=2.1.1=py37_1 | ||
- pillow=7.0.0=py37h4655f20_0 | ||
- pip=20.0.2=py37_1 | ||
- pixman=0.38.0=h1de35cc_0 | ||
- pmw=2.0.1=py37_2 | ||
- pycparser=2.20=py_0 | ||
- pymol=2.3.5=py37h95b93ae_0 | ||
- pymol-psico=3.4.1=py_0 | ||
- pyopenssl=19.1.0=py37_0 | ||
- pyqt=5.9.2=py37h655552a_2 | ||
- pysocks=1.7.1=py37_0 | ||
- python=3.7.7=hc70fcce_0_cpython | ||
- python-dateutil=2.8.1=py_0 | ||
- pytz=2019.3=py_0 | ||
- qt=5.9.7=h468cd18_1 | ||
- readline=8.0=h1de35cc_0 | ||
- requests=2.23.0=py37_0 | ||
- rigimol=1.3=2 | ||
- scikit-learn=0.22.1=py37h27c97d8_0 | ||
- scipy=1.4.1=py37h9fa6033_0 | ||
- setuptools=46.1.3=py37_0 | ||
- sip=4.19.8=py37h0a44026_0 | ||
- six=1.14.0=py37_0 | ||
- sqlite=3.31.1=h5c1f38d_1 | ||
- tk=8.6.9=x11tk0_2000 | ||
- urllib3=1.25.8=py37_0 | ||
- wheel=0.34.2=py37_0 | ||
- xz=5.2.5=h1de35cc_0 | ||
- zlib=1.2.11=h1de35cc_3 | ||
- zstd=1.3.7=h5bba6e5_0 | ||
prefix: /Users/jr/anaconda3/envs/rnaposers | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import sys | ||
import inspect | ||
from glob import glob | ||
from pymol import cmd | ||
import psico.fullinit | ||
import tempfile | ||
import os | ||
|
||
def generate_complexes(receptor, poses, complexes, ref_complex, ref_ligand_mol2): | ||
def fix_names(obj, is_ligand = False): | ||
# utility functions to fix names | ||
if is_ligand: | ||
cmd.alter("%s"%(obj), "resn = 'UNK'") | ||
cmd.alter("%s"%(obj), "chain = 'Z'") | ||
cmd.alter("%s"%(obj), "resi = '1'") | ||
else: | ||
cmd.alter("%s"%(obj), "type = 'ATOM'") | ||
cmd.alter("resn rC+C+RC and %s"%(obj), "resn = 'CYT'") | ||
cmd.alter("resn rA+A+RA and %s"%(obj), "resn = 'ADE'") | ||
cmd.alter("resn rU+U+RU and %s"%(obj), "resn = 'URA'") | ||
cmd.alter("resn rG+G+RG and %s"%(obj), "resn = 'GUA'") | ||
|
||
def split_decoys(poses, dir): | ||
# utility function to split poses | ||
for a in range(1, 1 + cmd.count_states("(%s)"%poses)): | ||
cmd.frame(a) | ||
cmd.save("%s/poses/poses_%i.pdb"%(dir, a)) | ||
|
||
# utility function to generate complexes | ||
print("[RNAPosers Debugging] Generating complexes...") | ||
|
||
# Create TemporaryDirectory to store intermediat files | ||
with tempfile.TemporaryDirectory() as tmpDir: | ||
os.system("mkdir -p %s/complex"%(tmpDir)) | ||
os.system("mkdir -p %s/poses"%(tmpDir)) | ||
|
||
# split posese | ||
cmd.delete("*") | ||
cmd.load(poses, "poses") | ||
fix_names("poses", is_ligand = True) | ||
split_decoys("poses", tmpDir) | ||
poses=range(1, 1 + cmd.count_states("(poses)")) | ||
cmd.delete("poses") | ||
|
||
# combine poses + receptor | ||
for a in poses: | ||
cmd.delete("*") | ||
cmd.load(receptor) | ||
cmd.load("%s/poses/poses_%i.pdb"%(tmpDir, a)) | ||
cmd.create("test", "all") | ||
fix_names("test", is_ligand = False) | ||
cmd.save("%s/complex/complex_%i.pdb"%(tmpDir, a),"test") | ||
|
||
# save dcd | ||
cmd.delete("*") | ||
for a in poses: | ||
cmd.load("%s/complex/complex_%i.pdb" %(tmpDir, a), "complex") | ||
psico.exporting.save_traj(filename = "%s" %complexes, selection = "complex") | ||
|
||
# generate reference files | ||
os.system("cp %s/complex/complex_1.pdb %s"%(tmpDir, ref_complex)) | ||
|
||
# XX | ||
cmd.delete("*") | ||
cmd.load("%s/complex/complex_1.pdb"%(tmpDir), "complex") | ||
cmd.extract("lig", "resn UNK") | ||
cmd.save("%s/complex/lig.pdb"%(tmpDir), "lig") | ||
|
||
os.system("obabel -ipdb %s/complex/lig.pdb -omol2 -O %s"%(tmpDir, ref_ligand_mol2)) | ||
|
||
|
||
def main(): | ||
# Input: receptor, poses | ||
# Output: complexes, ref_complex, ref_ligand_mol2 | ||
# Input | ||
inDir = "test/receptor_and_poses/input/" | ||
receptor = inDir + "receptor.mol2" | ||
poses = inDir + "poses.sd" | ||
# Output | ||
outDir = "test/receptor_and_poses/output/" # where to save your pdb, dcd and mol2 files | ||
os.system("mkdir -p %s" %outDir) | ||
complexes = outDir + "complexes.dcd" | ||
ref_complex = outDir + "complex.pdb" | ||
ref_ligand_mol2 = outDir + "lig.mol2" | ||
generate_complexes(receptor, poses, complexes, ref_complex, ref_ligand_mol2) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.