How to extract pdb data in Matlab

  • MATLAB
  • Thread starter MiloBoots
  • Start date
  • Tags
    Data Matlab
In summary, the conversation is about extracting coordinates of different elements in a PDB data file. The person has been able to extract the coordinates for all atoms in 3 arrays, but wants to have separate arrays for each element (e.g. oxygen, nitrogen). They are seeking help with creating a script to filter through the file and output the different arrays of coordinates for each element.
  • #1
MiloBoots
2
0
Hey

I want to be able to extract the coordinates of different elements in a PDB data file. I have been able to extract the coordinates for all the atoms in 3 arrays in the x, y, z directions. However, I would like to have the x, y, z coordinates for each element separate. So an array for the positions of oxygen, an array for nitrogen etc.

For example, I use the line:Z=[gflstruct.Model.Atom.Z] to get the Z axis coordinates and similarly for X and Y.

I am struggling to come up with a script to run which filters through the pdb file and outputs the different arrays of coordinates for each element.

Thankyou
 
Physics news on Phys.org

Related to How to extract pdb data in Matlab

1. How do I load a PDB file in Matlab?

To load a PDB file in Matlab, you can use the pdbread function. This function reads the contents of a PDB file and returns a structure array containing the data. You can also use the pdbread function to specify specific fields of interest to load from the PDB file.

2. How can I access specific data from a PDB file in Matlab?

To access specific data from a PDB file in Matlab, you can use the getpdb function. This function allows you to retrieve specific data fields from the PDB structure array. You can also use the getpdb function to retrieve data for specific atoms, residues, or chains.

3. Can I manipulate PDB data in Matlab?

Yes, you can manipulate PDB data in Matlab using various functions such as pdbwrite, pdbfilter, and pdbselect. These functions allow you to write PDB data to a file, filter data based on specific criteria, and select specific data for further analysis.

4. How do I visualize PDB data in Matlab?

To visualize PDB data in Matlab, you can use the pdbplot function. This function allows you to plot the atomic coordinates of a PDB structure, including bonds and atoms. You can also customize the plot by specifying colors and labels for different atoms, residues, or chains.

5. Is there a way to convert PDB data to other formats in Matlab?

Yes, you can convert PDB data to other formats in Matlab using the pdbwrite function. This function allows you to specify the output format, including PDB, XYZ, or CML. You can also specify the file name and location for the converted data.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
564
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
Back
Top