pdbread function doesn't read individual models

5 ビュー (過去 30 日間)
Carson Purnell
Carson Purnell 2022 年 5 月 11 日
編集済み: dmitry luchinskii 2022 年 7 月 8 日
The matlab pdbread function (and a similar function from a toolbox with the same codebase) appears to never correctly execute the 'ModelNum' name-value argument. I've tried many multi-model .pdb files from RCSB and some i've made myself, and it will always throw a warning "Warning: PDB file does not contain Model 1. Reading the entire file.". This is despite pymol, chimera, and chimerax recognizing the separate models immediately. I'm at a loss as to how a PDB could ever lack a model 1 in the first place, because the same thing happens for single-model pdbs. Most amusingly, the output struct actually has the correct number of separate model records!
Anyone ever encountered this behavior? Is pdbread old enough to be buggy with changes to the pdb format?

採用された回答

Carson Purnell
Carson Purnell 2022 年 6 月 17 日
Well I ended up needed to make my own pdb reader function for my purpose (generating density maps). Here's the function if anyone else wants specifically atom coordinates or the volume(s) itself many times faster than pdbread and no other pdb record information.

その他の回答 (1 件)

dmitry luchinskii
dmitry luchinskii 2022 年 7 月 8 日
編集済み: dmitry luchinskii 2022 年 7 月 8 日
Most likely you need to modify the following lines (108-109 in version R2022b):
% modelMatch = ['^MODEL \s*' num2str(modelNum) '\s'];
% h = find(~cellfun(@isempty,regexp(theLines(modelStarts),modelMatch,'once')));
modelMatch = ['MODEL \s* ' num2str(modelNum)];
h = find(~cellfun(@isempty,regexp(theLines(modelStarts),modelMatch)));
I had the same error because "h" was empty. In turn, it was empty because "modelMatch" expression was wrong (specifically there was no "\s" (space) in the end of the 'MODEL' lines in my PDB files.
Writing your own file is fine but it will not be general.
Also to speed up calculations one can use extractfeild, e.g.
X=extractfield(PDBStruct.Model.Atom,'X');
And the original pdbread file can be very useful this way.

カテゴリ

Help Center および File ExchangeGeology についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by