Comments (6)
Hi,
You can do this with RDKit. I have added a function that does this in 'make_ligand_feats.py':
def sdf_to_smiles(input_sdf):
"""Read sdf and convert to SMILES
"""
with Chem.SDMolSupplier(input_sdf) as suppl:
for mol in suppl:
return AllChem.MolToSmiles(mol)
You can input your sdf now by changing the path in the predict.sh script.
#SMILES. Alt: --input_sdf 'path_to_input_sdf'
python3 ./src/make_ligand_feats.py --input_smiles $LIGAND_SMILES
--outdir $OUTDIR
alt:
python3 ./src/make_ligand_feats.py --input_sdf 'path to your sdf'
--outdir $OUTDIR
Best,
Patrick
from umol.
Hi,
You can do this with RDKit. I have added a function that does this in 'make_ligand_feats.py':
def sdf_to_smiles(input_sdf): """Read sdf and convert to SMILES """ with Chem.SDMolSupplier(input_sdf) as suppl: for mol in suppl: return AllChem.MolToSmiles(mol)
You can input your sdf now by changing the path in the predict.sh script. #SMILES. Alt: --input_sdf 'path_to_input_sdf' python3 ./src/make_ligand_feats.py --input_smiles $LIGAND_SMILES --outdir $OUTDIR
alt: python3 ./src/make_ligand_feats.py --input_sdf 'path to your sdf' --outdir $OUTDIR
Best,
Patrick
Thank you very much for providing this method to convert SDF to SMILES. Given that we are currently engaged in docking studies involving short peptides and proteins, I would like to inquire whether it's also possible to use PDB files of short peptides as input instead.
Appreciate your continued support and assistance.
Best regards,
ZH
from umol.
Hi,
You can do this with RDKit. I have added a function that does this in 'make_ligand_feats.py':
def sdf_to_smiles(input_sdf): """Read sdf and convert to SMILES """ with Chem.SDMolSupplier(input_sdf) as suppl: for mol in suppl: return AllChem.MolToSmiles(mol)
You can input your sdf now by changing the path in the predict.sh script. #SMILES. Alt: --input_sdf 'path_to_input_sdf' python3 ./src/make_ligand_feats.py --input_smiles $LIGAND_SMILES --outdir $OUTDIR
alt: python3 ./src/make_ligand_feats.py --input_sdf 'path to your sdf' --outdir $OUTDIR
Best,
Patrick
hmm, I just downloaded the latest 'make_ligand_feats.py' and tried to replace the input with an sdf file instead of smiles in 'predict.sh', but in the end, I got this error message,
[10:08:36] SMILES Parse Error: syntax error while parsing: ./data/test_case/0317/histamine.sdf
[10:08:36] SMILES Parse Error: Failed parsing SMILES './data/test_case/0317/histamine.sdf' for input: './data/test_case/0317/histamine.sdf'
Traceback (most recent call last):
File "/root/Umol/./src/relax/align_ligand_conformer.py", line 197, in <module>
best_conf, best_conf_pos, best_conf_err, atoms, nonH_inds, mol, best_conf_id = generate_best_conformer(pred_ligand['chain_coords'], ligand_smiles)
File "/root/Umol/./src/relax/align_ligand_conformer.py", line 70, in generate_best_conformer
m = Chem.AddHs(Chem.MolFromSmiles(ligand_smiles))
Boost.Python.ArgumentError: Python argument types in
rdkit.Chem.rdmolops.AddHs(NoneType)
did not match C++ signature:
AddHs(RDKit::ROMol mol, bool explicitOnly=False, bool addCoords=False, boost::python::api::object onlyOnAtoms=None, bool addResidueInfo=False)
The unrelaxed predicted protein can be found at ./data/test_case/0317//0317'_pred_protein.pdb' and the ligand at ./data/test_case/0317//0317'_pred_ligand.sdf'
Traceback (most recent call last):
File "/root/Umol/./src/relax/openmm_relax.py", line 1, in <module>
import openmm as mm
ModuleNotFoundError: No module named 'openmm'
/root/miniconda3/lib/python3.10/site-packages/Bio/PDB/PDBParser.py:388: PDBConstructionWarning: Ignoring unrecognized record 'END' at line 3153
warnings.warn(
The final relaxed structure can be found at ./data/test_case/0317//0317'_relaxed_plddt.pdb'
I am a newbie in this field and would like to know how to solve this problem.
Sincerely,
ZH
from umol.
Hi,
It seems that many issues are present. Running these packages locally is unfortunately not for beginners. This is why there is a Colab notebook that you can run in the web: https://colab.research.google.com/github/patrickbryant1/Umol/blob/master/Umol.ipynb
Please make sure that your sdf file contains a viable ligand that can be parsed into SMILES. There seems to be an issue for RDKit to parse it.
from umol.
Hi, It seems that many issues are present. Running these packages locally is unfortunately not for beginners. This is why there is a Colab notebook that you can run in the web: https://colab.research.google.com/github/patrickbryant1/Umol/blob/master/Umol.ipynb
Please make sure that your sdf file contains a viable ligand that can be parsed into SMILES. There seems to be an issue for RDKit to parse it.
Hello, thank you for your reply. I believe I've resolved my issue. The error occurred due to the presence of some chemically unreasonable covalent bonds in the short peptide I provided. When I perform docking using the compounds you provided or other compounds in my experiment, the prediction runs smoothly. Besides using the RDKit package for compound file conversion, I discovered the OPENBABEL website (https://www.cheminfo.org/Chemistry/Cheminformatics/FormatConverter/index.html), which offers various formats for converting structural information freely. I think the requirement I mentioned earlier of using the pdb file of the compound peptide as input can be achieved by encoding it into SMILES format using this website.
Best,
ZH
from umol.
Hi,
Great you solved the problem. Yes, OpenBabel is an alternative to RDKit. RDKit can be picky about having chemistry it understands which is probably why the error was raised.
Best of luck running Umol.
I will close this issue.
from umol.
Related Issues (20)
- When run the 'predict.sh', how to use GPU to accelerate it HOT 1
- ValueError: operands could not be broadcast together with shapes (19,19) (2861,2861) HOT 3
- Selection of the interaction sites and pLDTT score HOT 4
- colab notebook error in prediction step HOT 7
- Docker to run it HOT 9
- Error during conda env creation HOT 1
- How to output more predicted poses HOT 2
- Some question about giant Protein HOT 1
- Environment failed to resolve HOT 2
- 'Config' object has no attribute 'define_bool_state' HOT 4
- Can Umol take 1 protein and 2 small molecules at the same time? HOT 1
- ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (1313,) + inhomogeneous part. HOT 1
- Error 'bash predict.sh' HOT 1
- conda enviroment problem HOT 8
- Predict ligand positions for large protein by multiple GPUs HOT 1
- [question]: Around training the model. HOT 4
- FileNotFoundError
- Colab crashes due to error in Install dependencies step HOT 1
- RecursionError: maximum recursion depth exceeded HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umol.