Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frame_to_CG_freud system #83

Open
marjanalbooyeh opened this issue Feb 27, 2024 · 1 comment
Open

Add frame_to_CG_freud system #83

marjanalbooyeh opened this issue Feb 27, 2024 · 1 comment
Assignees

Comments

@marjanalbooyeh
Copy link
Contributor

marjanalbooyeh commented Feb 27, 2024

Add a function to cmeutils that takes in a gsd snapshot of an atomistic system and the CG mapping (obtained from grits), and it creates a freud system based on the CG beads. The resulting freud system is used in cmeutils functions that calculate structural properties such as rdf, order parameter, MSD, etc.

This function needs to calculate COM positions for the snapshot based on the mapping. We already have a similar function called [frame_to_freud_system](https://github.com/cmelab/cmeutils/blob/master/cmeutils/gsd_utils.py#L13).

The benefit of having a function like that is that we can skip coarse graining the whole trajectory with grits and go straight to calculating our desired properties from the aa trajectories. Another benefit of this function is that it allows us to try on different mappings or smiles patterns for calculating properties.

@chrisjonesBSU
Copy link
Member

chrisjonesBSU commented Feb 27, 2024

The benefit of having a function like that is that we can skip coarse graining the whole trajectory with grits and go straight to calculating our desired properties from the aa trajectories. Another benefit of this function is that it allows us to try on different mappings or smiles patterns for calculating properties.

To add some examples for why this would be cool.

For a lot of structural analysis (RDFs, order parameters, structure factors, diffraction patterns) and dynamic analysis (MSD) we may want the measurements done on a coarse-grained representation of the system. Right now, like Marjan mentioned, we have to create the entire CG trajectory then pass that into the function (e.g. calculating an RDF between monomer pairs).

Instead, we could assign the mapping/bead matching directly in the cmeutils API. For example:

# RDF of pair distribution between thiophene rings of P3HT monomers, obtained from an atomistic trajectory

rdf, N = gsd_rdf(
    gsd_file="p3ht-atomistic.gsd",
    beads={"A": "c1cscc1", "B": "CCC"},
    A_type="A",
    B_type="A",
    start=-20,
    stop=-1
) 

# RDF of pair distribution between rings and  tails of P3HT monomers, obtained from an atomistic trajectory

rdf, N = gsd_rdf(
    gsd_file="p3ht-atomistic.gsd",
    beads={"A": "c1cscc1", "B": "CCC"},
    A_type="A",
    B_type="B",
    start=-20,
    stop=-1
) 


# MSD of PPS monomers obtained from an atomistic trajectory
msd = gsd_msd(gsd_file="pps-atomistic.gsd", beads={"A": "c1cc(S)ccc1"}, start=-20, stop=-1)

After talking with Marjan, the thought process is 1) use GRiTS under the hood to get the coarse-grained mapping, then make a function that takes an atomistic trajectory + a CG mapping, and creates a freud system of the CG representation, all while not having to save an entire coarse-grained trajectory file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants