pdbwrite - Write to file using Protein Data Bank (PDB) format

Syntax

pdbwrite(File, PDBStruct)
PDBArray = pdbwrite(File, PDBStruct)

Arguments

FileString 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 Directory.

    Tip   After you save the MATLAB structure to a local PDB-formatted file, you can use the molviewer function to display and manipulate a 3-D image of the structure.

PDBStructMATLAB 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 Model field of PDBStruct.

Return Values

PDBArrayCharacter array in which each row corresponds to a line in a PDB record.

Description

pdbwrite(File, PDBStruct) writes the contents of the MATLAB structure 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.

PDBArray = pdbwrite(File, PDBStruct) saves the formatted PDB record, converted from the contents of the MATLAB structure PDBStruct, to PDBArray, a character array in which each row corresponds to a line in a PDB record.

Examples

  1. Use the getpdb function to retrieve structure information from the Protein Data Bank (PDB) for the green fluorescent protein with identifier 1GFL , and store the data in the MATLAB structure gflstruct.

    gflstruct = getpdb('1GFL');
  2. Find the x-coordinate of the first atom.

    gflstruct.Model.Atom(1).X
    
    ans =
    
      -14.0930
    
    
  3. Edit the x-coordinate of the first atom.

    gflstruct.Model.Atom(1).X = -18;

  4. Write the modified MATLAB structure gflstruct to a new PDB-formatted file modified_gfl.pdb in the Work directory on your C drive.

    pdbwrite('c:\work\modified_gfl.pdb', gflstruct);
  5. Use the pdbread function to read the modified PDB file into a MATLAB structure, then confirm that the x-coordinate of the first atom has changed.

    modified_gflstruct = pdbread('c:\work\modified_gfl.pdb')
    modified_gflstruct.Model.Atom(1).X
    
    ans =
    
       -18
    
    

See Also

Bioinformatics Toolbox™ functions: getpdb, molviewer, pdbread

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS