Giter VIP home page Giter VIP logo

Comments (3)

chrisjonesBSU avatar chrisjonesBSU commented on September 24, 2024

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.

chrisjonesBSU avatar chrisjonesBSU commented on September 24, 2024

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.

erjank avatar erjank commented on September 24, 2024

Oh, likely! Yeah, this looks like a small docstring update would provide a lot of clarity.

from grits.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.