pdbwrite
Write to file using Protein Data Bank (PDB) format
Syntax
pdbwrite(
File
, PDBStruct
)
PDBArray
= pdbwrite(File
, PDBStruct
)
Input Arguments
File | Character vector or string specifying either a file name or a path and file name for saving the PDB-formatted data. If you specify only a file name, the file is saved to the MATLAB® Current Folder. |
PDBStruct | MATLAB structure containing 3-D protein structure coordinate
data, created initially by using the getpdb or pdbread functions.Note You can edit this structure to modify its 3-D protein structure
data. The coordinate information is stored in the |
Output Arguments
PDBArray | Character array in which each row corresponds to a line in a PDB record. |
Description
pdbwrite(
writes
the contents of the MATLAB structure File
, PDBStruct
)PDBStruct
to
a PDB-formatted file (ASCII text file) whose path and file name are
specified by File
. In the output file, File
,
the atom serial numbers are preserved. The atomic coordinate records
are ordered according to their atom serial numbers.
saves
the formatted PDB record, converted from the contents of the MATLAB structure PDBArray
= pdbwrite(File
, PDBStruct
)PDBStruct
,
to PDBArray
, a character array in which
each row corresponds to a line in a PDB record.
Note
You can edit PDBStruct
to modify
its 3-D protein structure data. The coordinate information is stored
in the Model
field of PDBStruct
.
Examples
Use the
getpdb
function to retrieve structure information from the Protein Data Bank (PDB) for the green fluorescent protein with identifier1GFL
, and store the data in the MATLAB structuregflstruct
.gflstruct = getpdb('1GFL');
Find the
x
-coordinate of the first atom.gflstruct.Model.Atom(1).X ans = -14.0930
Edit the
x
-coordinate of the first atom.gflstruct.Model.Atom(1).X = -18;
Note
Do not add or remove any
Atom
fields, because thepdbwrite
function does not allow the number of elements in the structure to change.Write the modified MATLAB structure
gflstruct
to a new PDB-formatted filemodified_gfl.pdb
in theWork
folder on yourC
drive.pdbwrite('c:\work\modified_gfl.pdb', gflstruct);
Use the
pdbread
function to read the modified PDB file into a MATLAB structure, then confirm that thex
-coordinate of the first atom has changed.modified_gflstruct = pdbread('c:\work\modified_gfl.pdb') modified_gflstruct.Model.Atom(1).X ans = -18
Version History
Introduced in R2007a