Comments (5)
Dear Jen,
If I understand you correctly, you would like to see something like a SMILES or SMARTS for a given environment. This is currently not stored in the DB, so there is no direct way to access it.
A workaround could be that for a given rule_environment, you extract one sample pair and display this, together with the radius (as integer). If the from_smiles and to_smiles are known, the environment for a given radius can then be inferred from looking at the pair.
Please note that the environment is grouped via the Morgan fingerprint, rooted at the attachment atom. The Morgan Fingerprint for each atom amongst others features the number of neighboring atoms. Therefore, a radius 1 Fingerprint in reality is more a kind of radius 1.5 fingerprint. For this reason, if you wanted to depict the Morgan Fingerprint environment as a SMILES, this would get be rather complicated.
Does this answer your question?
from mmpdb.
Hi Christian,
Thanks for the reply. Yes, I would like to see the SMILES or SMARTS for a given environment. Good to know there is a workaround. I think it should work.
I will give a try to extract one example pair/or all pairs (if possible) from a given rule_environment. Would you mind give an example of how to do that? Is there any existing functions in the package I can use?
Thanks,
Jen
from mmpdb.
Hi Jen,
there is no existing function that does exactly what you ask. But if you are coding already anyway, and you know the rule_environment_id for which you want to see a pair, you could try something like this:
sql = """
SELECT pair.id,
lhs_compound.clean_smiles, rhs_compound.clean_smiles,
lhs_compound.public_id, rhs_compound.public_id
FROM pair,
compound as lhs_compound, compound as rhs_compound
WHERE pair.rule_environment_id = ?
AND pair.compound1_id = lhs_compound.id
AND pair.compound2_id = rhs_compound.id
LIMIT 1
"""
c = cursor.execute(sql, (environment_id, ))
Disclaimer: The concept of the statement should work, but I have not tested it and my python has gotten a little rusty lately, you may need to fix some of the commas etc. Please let me know if this works.
from mmpdb.
Hi Christians,
Thank you so much for the details. I will code the query and try to grab the pair information. I will keep you posted how it works.
Best, Jen
from mmpdb.
Hi Christian, It works as expected!
Thanks, Jen.
from mmpdb.
Related Issues (20)
- Use SQLAlchemy to work with the database HOT 1
- organize command-line processing and move to click HOT 4
- Remove vendered use of peewee HOT 1
- Use importlib.resources instead of __file__ HOT 1
- Can we specify the environmental radius when generating the mmpdb? HOT 11
- Which "cut-smarts" patterns (i.e. fragmentation parameters) are used by default for Transform function? HOT 1
- mmpdb transform behaves unexpectedly HOT 5
- Error when using "--out mmpa" HOT 4
- [docs] README.md: create installation guide HOT 5
- AttributeError: module '__main__' has no attribute '__spec__'
- Support for CXSMILES HOT 4
- Obtain list of matched pairs with common core from an ID. HOT 4
- Automatically get MMPs for a given data set HOT 4
- Turning on --property flag leading to a smaller number of transformed structures
- Unexpected generated molecule with double cuts MMPDB HOT 4
- Possible SQL injection vulnerability HOT 2
- Release the latest version into PyPI? HOT 2
- How to solve "sqlite3.OperationalError: database is locked" error?
- Error of "sqlite3.OperationalError: database is locked" HOT 1
- How to use SQL to get the table of all rules in the mmpdb file, as well as the number of pairs, and statistics for each rule?
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 mmpdb.