Coder Social home page Coder Social logo

mdsyn2019 / mdanalysis-coarsegraining Goto Github PK

View Code? Open in Web Editor NEW

This project forked from richardjgowers/mdanalysis-coarsegraining

0.0 1.0 0.0 326 KB

An attempt at making a special subtype of MDAnalysis.Universe which allows a mapping scheme to be applied on the fly to an atomistic trajectory.

License: GNU General Public License v2.0

Python 100.00%

mdanalysis-coarsegraining's Introduction

MDAnalysis-coarsegraining

A special subclass of MDAnalysis.Universe which allows a mapping scheme to be applied on the fly to an atomistic trajectory, giving a virtual coarse-grained representation.

Currently, load an atomistic set of results as normal, but supply a mapping scheme. The mapping scheme is a dictionary which links residue names to a list of list of indices for each bead. This should then make the CGUniverse supply positions (later velocities and forces?) according to the mapping scheme.

Potential useful for creating reference behaviour of atomistic trajectory when constructing coarse-grained models.

Requires MDAnalysis v0.19+

Simple example, three water molecules coarse-grained into 3 sites:

from cguniverse import CGUniverse

# for each resname, list of lists, each sublist becomes a bead.
# the indices refer to 
mapping = {'SOL':[[0, 1, 2]]}
cgu = CGUniverse('testdata/water.gro', mapping=mapping)

# The CGU has 3 "atoms", each representing a molecule
list(cgu.atoms)

# Each "atom" is a bead which gives the center of mass of each water molecule
cgu.atoms.positions

Multiple beads per molecule. Here octanol is split into 2 beads, the first beads has the first 11 atoms (range(11)), the second the remaining atoms.

from cguniverse import CGUniverse

mapping={'OcOH':[list(range(11)), list(range(11, 27))]}) # enough right brackets?

cgu = CGUniverse('testdata/octanol.gro', mapping=mapping)

mdanalysis-coarsegraining's People

Contributors

richardjgowers avatar

Watchers

 avatar

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.