mdanalysis | Python library to analyze molecular dynamics simulations

 by   MDAnalysis Python Version: package-2.5.0 License: Non-SPDX

kandi X-RAY | mdanalysis Summary

kandi X-RAY | mdanalysis Summary

mdanalysis is a Python library typically used in Simulation applications. mdanalysis has no bugs, it has no vulnerabilities and it has high support. However mdanalysis build file is not available and it has a Non-SPDX License. You can download it from GitHub.

MDAnalysis is a Python library to analyze molecular dynamics simulations.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mdanalysis has a highly active ecosystem.
              It has 1041 star(s) with 570 fork(s). There are 40 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 424 open issues and 1644 have been closed. On average issues are closed in 95 days. There are 65 open pull requests and 0 closed requests.
              OutlinedDot
              It has a negative sentiment in the developer community.
              The latest version of mdanalysis is package-2.5.0

            kandi-Quality Quality

              mdanalysis has 0 bugs and 0 code smells.

            kandi-Security Security

              mdanalysis has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              mdanalysis code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              mdanalysis has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              mdanalysis releases are available to install and integrate.
              mdanalysis has no build file. You will be need to create the build yourself to build the component from source.
              mdanalysis saves you 50756 person hours of effort in developing the same functionality from scratch.
              It has 64209 lines of code, 6426 functions and 366 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed mdanalysis and discovered the below as its top functions. This is intended to give you an instant insight into mdanalysis implemented functionality, and help decide if they suit your requirements.
            • Compute the residuals for each ensemble
            • Run the function
            • Calculate bootstrapping samples for a given distance matrix
            • Join a sequence
            • Estimate the clustering for the given ensemble
            • Cluster multiple ensembles
            • Compute similarity between two ensemble members
            • Discrete Jensen - Shannon divergence
            • Decorator to check that a function is valid
            • Perform ensemble clustering
            • Extract a HOLE profile
            • Convert a fasta file into protein sequences
            • Generate extension
            • Parse the file
            • Parse the molecule
            • Generate streamlines for a 3D trajectory
            • Run a single frame
            • Parse mol2 file
            • Parse the ATOM lines into a dictionary
            • Parse the gmx top file
            • Write an object to a file
            • Parse the ATOM file
            • Generate streamlines
            • Write a trajectory to a file
            • Run the simulation
            • Parse the SQLite3 database
            Get all kandi verified functions for this library.

            mdanalysis Key Features

            No Key Features are available at this moment for mdanalysis.

            mdanalysis Examples and Code Snippets

            No Code Snippets are available at this moment for mdanalysis.

            Community Discussions

            QUESTION

            How to calculate center of mass of proteins using MDAnalysis?
            Asked 2022-Mar-01 at 15:49

            I'm in a bit unusual situation. There are seven different proteins stored in a single file according to their residues names. Each protein has different sequence length. Now I need to calculate the center of mass of each protein and generate a time series data.I know how to do with a single protein, but do not with multiple protein system. For single protein I can do something like this:

            ...

            ANSWER

            Answered 2022-Mar-01 at 15:49

            I would load the system from the TPR file to maintain the bond information. Then MDAnalysis can determine fragments (namely, your proteins). Then loop over the fragments to determine the COM time series:

            Source https://stackoverflow.com/questions/71295833

            QUESTION

            How to iterate efficiently through MDAnalysis trajectory and save residue attribute time series?
            Asked 2022-Jan-19 at 14:57

            I have some working code using MDAnalysis that saves the residues center of mass time series in an array, but I wonder if there is a more Pythonic or overall efficient/fast way (comprehensions, array operations...) to do it.

            ...

            ANSWER

            Answered 2022-Jan-19 at 14:57

            There are a couple of changes you could make to your code:

            • select your protein atoms outside of the for loop, rather than on each iteration
            • vectorise the center of mass calculation over residues by passing the compound='residues' argument to the center_of_mass method
            • use the ag.n_residues and u.trajectory.n_frames attributes

            Here's an update to your code that uses these suggestions:

            Source https://stackoverflow.com/questions/70772541

            QUESTION

            Can't figure how to stop dictionary keys from overwriting themselves
            Asked 2021-Dec-13 at 19:55

            I'm trying to create a dictionary and my dictionary keys keep overwriting themselves. I don't understand how I can handle this issue.

            Here's the script:

            ...

            ANSWER

            Answered 2021-Dec-13 at 19:55

            Without actually seeing a complete problem description, my guess is that your final result is that each charge_dict[name] is a dictionary with just one key. That's not because the keys "overwrite themselves". Your program overwrites them explicitly: charge_dict[resnames[i]] = {}.

            What you want is to only reset the value for that key if it is not already set. You could easily do that by first testing if resnames[i] not in charge_dict:, but the Python standard library provides an even simpler mechanism: collections.defaultdict. A defaultdict is a dictionary with an associated default value creator. So you can do the following:

            Source https://stackoverflow.com/questions/70336631

            QUESTION

            Using MDAnalysis to extract coordinates in an array from pdb
            Asked 2021-Mar-17 at 05:48

            I have a pdb file that is a subset of a much larger system. This pdb is special because I have some vectors based on this file's coordinate system. I want to draw these vectors and the basis vector of that system onto the pdb. Eventually I would like to visualize the vector and basis vectors as it moves through some MD simulation where I an update the vector position based on the trajectory over time.

            To start, I would like to read a pdb that has coordinates that define the basis vectors that further define the other vectors I want to visualize. Right now I'm using this class in MDAnalysis: https://docs.mdanalysis.org/1.0.0/_modules/MDAnalysis/coordinates/PDB.html#PDBReader

            ...

            ANSWER

            Answered 2021-Mar-17 at 05:48
            Loading data: Universe

            To get the coordinates in MDAnalysis you first load a Universe (you don't normally use the coordinate readers directly):

            Source https://stackoverflow.com/questions/66660281

            QUESTION

            Install and Import MDAnalysis on Google Colaboratory for Python? Problems
            Asked 2021-Mar-13 at 13:06

            I'm trying to install and import MDAnalysis and MDAnalysisTests libraries on Google Colaboratory, I've tried three ways but nothing works:

            1. Using default: !pip install library
            ...

            ANSWER

            Answered 2021-Mar-13 at 13:06

            You can use conda to install MDA in Colab (takes a while).

            Source https://stackoverflow.com/questions/66573883

            QUESTION

            Obtaining Radial Distribution Functions using MDAnalysis
            Asked 2021-Feb-24 at 10:47

            I am running a simple benzene simulation in GROMOS54a7. I want to calculate the RDF of the center of masses of each benzene molecule, using MDAnalysis 1.0.0.

            Is this possible? I have create the rdf for the C molecules g_cc(r) using the following code in a Jupyter Notebook:

            ...

            ANSWER

            Answered 2021-Feb-24 at 10:47

            It would be useful to make it possible to use CG groups as native atoms in order to reuse the analysis tools in MDAnalysis.

            Here is a quick fix that mimics the MDAnalysis group and presents a new positions property. The new positions provides the centre of geometry instead of the actual positions. I also overwrite the len to convey that only one bead is being used for the CG element.

            Source https://stackoverflow.com/questions/66340182

            QUESTION

            How to build a Jupyter Notebook page to access remote Molecular Dynamics results?
            Asked 2021-Jan-27 at 11:43

            I would like to know whether it is possible, and how, to host a Jupyter Notebook page somewhere remotely (so not on my machine) that a collaborator could load in their web browser to view results? There is no shared machine, all the files need to be in one central location e.g., hosted on Google Drive, and the Jupyter Notebook page must also be URL based accessible.

            First of all, I've performed MD simulations using Gromacs and the files are currently local on my machine. I then load Jupyter Notebook on my machine, import the MDAnalysis Python package and perform some analysis that depends on those trajectory files generated by Gromacs (.trr/.xtc/.pdb). I also include some short simulation trajectories using NGLViewer so I can observe the parts of a simulation.

            The problem I face is that I want my collaborator to see/interact with the analysis work and observe the simulations using NGLViewer.

            There are a few challenges involved:

            (1) How/where do I host a Jupyter Notebook remotely so my collaborator can view progress in a browser window? I'm not expecting them to make edits or run code, just observe and copy text and download figures. This is to save me from packaging (e.g., as a markdown document of some kind) incremental versions of analysis and emailing them over.

            (2) What is required for analysis code (written in Python and using the MDAnalysis package) in this remote Jupyter Notebook page to load data files that are stored remotely on e.g., Google Drive?

            (3) Similar to (2), can NGLViewer load a remote file e.g., stored on Google Drive, and display the trajectory on the site for the collaborator to observe?

            Although my question ties in python packages such as MDAnalysis, NGLViewer and the results from a third party application (Gromacs), I'm looking for a new way sharing results from multiple projects to teams in different countries, along with my own team who I can't meet in person at the moment.

            ...

            ANSWER

            Answered 2021-Jan-27 at 11:43

            You can create a Google Drive folder and add the data to it. Then share the data with all your colleagues that need to access the data.

            Finally, create a Google Colab notebook and add the code there. You can choose to allow people to edit and run the notebook or only allow them to see the results. If you only give them read permission, they will have to save a copy from the notebook into their own google drive to be allowed to edit the notebook.

            These options are all available in the menu bar from Colab.

            You can connect your google drive folder to Colab as follows:

            Source https://stackoverflow.com/questions/65917885

            QUESTION

            Adding residue IDs to a numpy array consisting of time series data of water coordinates
            Asked 2020-Jul-08 at 14:29

            I got this script for generating time series data of water molecules, and I want to add one more header row to that generated matrix with residue IDs of water molecules. Could anybody help with with reworking this script? Thanks!

            ...

            ANSWER

            Answered 2020-Jul-08 at 11:02

            Here is an adjusted code example. You might need to install the package MDAnalysisTests to run it:

            Source https://stackoverflow.com/questions/62776561

            QUESTION

            Matplotlib histogram where bins are defined range of FLOATS and colored by it?
            Asked 2020-Apr-27 at 18:12

            I do RMSF analysis and as a results I have list of floats (0.1, 0.3, etc.) and I would like to do a histogram where are bins of defined ranges of the floats. Then I want to have each range of float with corresponding color. I tried to do it with analogies of this script:

            ...

            ANSWER

            Answered 2020-Apr-27 at 18:12

            IIUC, you would want to pass bins into ax.hist:

            Source https://stackoverflow.com/questions/61465374

            QUESTION

            Time series data for water molecules from its dcd file
            Asked 2020-Mar-04 at 23:16

            I am trying to make a file which contain time series data of water molecules from dcd file. Is it possible to generate this data using any of MDAnalysis module or function? Or is there any python script to generate this file?

            I need to generate this file containing two columns (one with z coordinates of water molecules and 2nd with respective timesteps) by using DCD file as input.

            ...

            ANSWER

            Answered 2020-Mar-04 at 23:16

            You can get the (z, t) time series in a variety of ways but I am showing the most basic one here. I assume that you also have a PSF topology file in addition to your DCD trajectory file (but really, any topology and trajectory file format will work in MDAnalysis). I also assume that the water oxygen atoms are named "OW".

            I am actually not clear how you want your "z, t" data structure to look like. If you have N water molecules, then you will have N z-coordinates per time step so I don't know how this makes sense as "two columns", assuming that you want each "row" to be a different time step. Instead I will use the following data structure: the final output will be an array with shape (T, N+1) where T is the number of time steps in the trajectory and N is the number of waters. Each row of the array contains [t, z1, z2, ..., zN], i.e., time and z-coordinate of water i.

            Source https://stackoverflow.com/questions/60525516

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mdanalysis

            You can download it from GitHub.
            You can use mdanalysis like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link