pdbread function doesn't read individual models

3 visualizaciones (últimos 30 días)
Carson Purnell
Carson Purnell el 11 de Mayo de 2022
Editada: dmitry luchinskii el 8 de Jul. de 2022
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?

Respuesta aceptada

Carson Purnell
Carson Purnell el 17 de Jun. de 2022
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.

Más respuestas (1)

dmitry luchinskii
dmitry luchinskii el 8 de Jul. de 2022
Editada: dmitry luchinskii el 8 de Jul. de 2022
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.

Categorías

Más información sobre Partial Differential Equation Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by