Comments (3)
Is this what we already have with the mapping
parameter in CG_Compound
and CG_System
? This lets you set your atom-to-bead mapping manually without having to write a smiles string.
mapping : dict or path, default None
Either a dictionary or path to a json file of a dictionary. Dictionary
keys contain desired bead name and SMARTS string specification of that
bead and values containing list of tuples of atom indices::
mapping = {"_B...c1sccc1": [(0, 4, 3, 2, 1), ...]}
This would let you manually define your mapping if you want to use some algorithm to generate a list of lists based on known info about your molecules/beads.
So, for perylene, a simple example with made up numbers might look something like:
>>> atoms_per_mol = 20
>>> num_mols = 30
>>> mapping = {"A": []}
>>> for n in range(num_mols):
... mapping["A"].append(np.array([10, 11, 12]) + (n * atoms_per_mol))
Then your mapping dictionary looks like:
>>> mapping
{'A': [array([10, 11, 12]), array([30, 31, 32]), array([50, 51, 52]), array([70, 71, 72]), array([90, 91, 92]), array([110, 111, 112]), array([130, 131, 132]), array([150, 151, 152]), array([170, 171, 172]), array([190, 191, 192]), array([210, 211, 212]), array([230, 231, 232]), array([250, 251, 252]), array([270, 271, 272]), array([290, 291, 292]), array([310, 311, 312]), array([330, 331, 332]), array([350, 351, 352]), array([370, 371, 372]), array([390, 391, 392]), array([410, 411, 412]), array([430, 431, 432]), array([450, 451, 452]), array([470, 471, 472]), array([490, 491, 492]), array([510, 511, 512]), array([530, 531, 532]), array([550, 551, 552]), array([570, 571, 572]), array([590, 591, 592])]}
from grits.
The doc strings for the mapping
parameter are a bit confusing, I don't think you really need the smiles string, or you could at least put a place holder str
there. Nothing ends up happening with it except for setting the Bead.smarts
attribute which isn't used anywhere.
from grits.
Oh, likely! Yeah, this looks like a small docstring update would provide a lot of clarity.
from grits.
Related Issues (19)
- Add CI/tests
- clean up repo HOT 1
- switch from openbabel to rdkit HOT 2
- Improve the mapping operator HOT 1
- mappings to ring structures should not always share atoms
- Add a mapping save and load from mapping functions HOT 1
- Simulation example HOT 1
- speed up and scale up! HOT 2
- Add bead mass
- Finegraining united atom to all-atom HOT 3
- Fix visualize method
- Idea: non chemistry based grammar
- CG_System not completely populating bonding informaiton in snapshots HOT 3
- SMILES matching on UA need a better warning or different functionality
- Mapping of mass from atomistic to cg beads failing because of how pybel smarts matching works
- Update install instructions in the docs
- Add a more informative warning about mass_scale
- Move container to ghcr 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 grits.