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.
pdbread function doesn't read individual models
조회 수: 4 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
추가 답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Partial Differential Equation Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!