mdanalysis

MDAnalysis is a Python library to analyze molecular dynamics trajectories.

Github stars Tracking Chart

================================
MDAnalysis Repository README
================================, numfocus, build, cov, [*], docs, devdocs, usergroup, developergroup, anaconda, mybinder, MDAnalysis is a Python library for the analysis of computer simulations of many-body systems at the molecular scale, spanning use cases from interactions of drugs with proteins to novel materials. It is widely used in the scientific community and is written by scientists for scientists.

It works with a a wide range of popular simulation packages including Gromacs, Amber, NAMD, CHARMM, DL_Poly, HooMD, LAMMPS and many other — see the lists of supported trajectory formats_ and topology formats.
MDAnalysis also includes widely used analysis algorithms in the MDAnalysis.analysis
module.

.. _numfocus-fiscal-sponsor-attribution:

The MDAnalysis project uses an open governance model_ and is fiscally sponsored by NumFOCUS. Consider making
a tax-deductible donation
to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.

.. image:: https://raw.githubusercontent.com/numfocus/templates/master/images/numfocus-logo.png
:height: 60px
:target: https://numfocus.org/project/mdanalysis
:align: center
:alt: NumFOCUS

This project is bound by a Code of Conduct_.

Example analysis script

.. code:: python

import MDAnalysis as mda

Load simulation results with a single line

u = mda.Universe('topol.tpr','traj.trr')

Select atoms

ag = u.select_atoms('name OH')

Atom data made available as Numpy arrays

ag.positions
ag.velocities
ag.forces

Iterate through trajectories

for ts in u.trajectory:
print(ag.center_of_mass())

There are a number of tutorials_ on the MDAnalysis homepage that explain
how to conduct RMSD calculations, Alignment and many more features of MDAnalysis.

Source code

Source code is hosted in a git repository at

https://github.com/MDAnalysis/mdanalysis

and is available under the GNU General Public License, version 2 (see
the file LICENSE_).

This is the top level of the master repository. It contains

  1. the MDAnalysis toolkit source files in the directory ::

    package/

  2. the unit tests together with any input files required for
    running those tests in the directory ::

    testsuite/

The directory maintainer contains scripts only needed for
maintaining releases and are not generally useful for the user or the
typical developer.

(For more details on the directory layout see Issue 87_ on the
MDAnalysis issue tracker.)

Guide for Developers

To setup a development environment and run the testsuite you can use this
guide_. If you are a new developer who would like to start contributing to
MDAnalysis as a start you can increase our code coverage, the guides explain how
to find uncovered code.

.. Footnotes

.. [*] build: Unit testing is for the whole package; coverage is
shown for the core library modules and the analysis modules.

.. _NumFOCUS: https://numfocus.org/
.. _open governance model: https://www.mdanalysis.org/about/#governance
.. _tax-deductible donation: https://numfocus.org/donate-to-mdanalysis
.. _Code of Conduct: https://www.mdanalysis.org/pages/conduct/
.. _trajectory formats: https://docs.mdanalysis.org/documentation_pages/coordinates/init.html#id1
.. _topology formats: https://docs.mdanalysis.org/documentation_pages/topology/init.html#supported-topology-formats
.. _Issue 87: https://github.com/MDAnalysis/mdanalysis/issues/87
.. _MDAnalysis: https://www.mdanalysis.org
.. _LICENSE: https://github.com/MDAnalysis/mdanalysis/blob/master/LICENSE
.. _#286: https://github.com/MDAnalysis/mdanalysis/issues/286
.. _MDAnalysis.analysis: https://docs.mdanalysis.org/documentation_pages/analysis_modules.html
.. _tutorials: https://www.mdanalysis.org/pages/learning_MDAnalysis/
.. _guide: https://github.com/MDAnalysis/mdanalysis/wiki/Guide-for-Developers

.., usergroup, image:: https://img.shields.io/badge/Google%20Group-Users-lightgrey.svg
:alt: User Google Group
:target: http://users.mdanalysis.org

.., developergroup, image:: https://img.shields.io/badge/Google%20Group-Developers-lightgrey.svg
:alt: Developer Google Group
:target: http://developers.mdanalysis.org

.., docs, image:: https://img.shields.io/badge/docs-latest-brightgreen.svg
:alt: Documentation (latest release)
:target: https://docs.mdanalysis.org

.., devdocs, image:: https://img.shields.io/badge/docs-development-yellow.svg
:alt: Documentation (development version)
:target: https://www.mdanalysis.org/mdanalysis/

.., numfocus, image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
:alt: Powered by NumFOCUS
:target: https://www.numfocus.org/

.., build, image:: https://travis-ci.com/MDAnalysis/mdanalysis.svg?branch=develop
:alt: Build Status
:target: https://travis-ci.com/MDAnalysis/mdanalysis

.., cov, image:: https://codecov.io/gh/MDAnalysis/mdanalysis/branch/develop/graph/badge.svg
:alt: Coverage Status
:target: https://codecov.io/gh/MDAnalysis/mdanalysis

.., anaconda, image:: https://anaconda.org/conda-forge/mdanalysis/badges/version.svg
:alt: Anaconda
:target: https://anaconda.org/conda-forge/mdanalysis

.., mybinder, image:: https://mybinder.org/badge.svg
:alt: My Binder
:target: https://mybinder.org/v2/gh/MDAnalysis/binder-notebook/master

Main metrics

Overview
Name With OwnerMDAnalysis/mdanalysis
Primary LanguagePython
Program languageShell (Language Count: 9)
Platform
License:Other
所有者活动
Created At2015-04-04 00:39:41
Pushed At2025-04-18 18:35:26
Last Commit At2021-08-21 18:02:12
Release Count83
Last Release Namerelease-2.9.0 (Posted on 2025-03-11 20:50:18)
First Release Namerel-0-5-0 (Posted on )
用户参与
Stargazers Count1.4k
Watchers Count41
Fork Count709
Commits Count7.2k
Has Issues Enabled
Issues Count2318
Issue Open Count429
Pull Requests Count1981
Pull Requests Open Count66
Pull Requests Close Count407
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private