read and write PDB files using matlab

版本 1.0.0.0 (5.0 KB) 作者: Evan
These two programs accept and output a variety of PDB file-formatted data
1.1K 次下载
更新时间 2013/8/5

查看许可证

Both programs use data structures to store information about PDBs. I find these programs useful both for dealing with PDBs and visualizing 3D point information

-- example usage: plot the atoms of 3IJU.pdb --

PDBdata = pdb2mat('3IJU.pdb'); % read in data from PDB file
plot3(PDBdata.X, PDBdata.Y, PDBdata.Z, '.'); % make a 3D plot of data

-- example usage: translate the atoms of 3IJU.pdb by 10 angstroms in x direction --

PDBdata = pdb2mat('3IJU.pdb'); % read in data from PDB file
PDBdata.X = PDBdata.X + 10; % translate coordinates
PDBdata.outfile = '3IJU_tran10angXdir.pdb'; % update file name
mat2pdb(PDBdata); % output data in PDB format

-- example usage: make a PDB with 30 atoms in random places within a 10 angstrom box --
data.X = rand(1,20)*10;
data.Y = rand(1,20)*10;
data.Z = rand(1,20)*10;
mat2pdb(data)

%% -- pdb2mat.m --
%
% It's function is simple: give it a PDB file and out comes a
% matlab-friendly data structure. In cumbersomely large PDB's (such as those that
% include solvent), this can shave off a good amount of time relative to
% many programs. Unfortunately there is no easy way to hasten the slowest
% step, which is turning strings into doubles.
%

%% -- mat2PDB.m --
%
% this function creates a PDB from coordinate data. Represent all inputs as
% a structure field for it to be read. The output format is as given in
% online documentation (as of July 2012 when writing this program)
% http://www.wwpdb.org/documentation/format33/sect9.html#ATOM

To speed up the program, comment out any lines for data not being used. Commenting one line that converts numeric data speeds the program up by roughly 7-8%.

example usage : this plots the atoms of 3IJU.pdb

atoms = fastPDBRead('3IJU.pdb')
plot3(atoms.X, atoms.Y, atoms.Z, '.');

引用格式

Evan (2025). read and write PDB files using matlab (https://ww2.mathworks.cn/matlabcentral/fileexchange/42957-read-and-write-pdb-files-using-matlab), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Biological and Health Sciences 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0