Getting number of residues from a PDB contain only a fragment

Hi, I used this Python code to get the number of residues: model = run(session, 'open %s' % input_model)[0] print(model.chains[0].num_residues) It works when the input_model is a complete pdb file. However, when the input_model only contain part of the structure of the full pdb but retains the full sequence information, the code above always return the num_residues of the full structure, not the input_model only. Is there any way to get this done? Best, Huy

Hi Huy, Yes, use 'num_existing_residues' instead of 'num_residues'. --Eric Eric Pettersen UCSF Computer Graphics Lab
On Aug 16, 2023, at 7:06 AM, huybk81--- via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi,
I used this Python code to get the number of residues:
model = run(session, 'open %s' % input_model)[0] print(model.chains[0].num_residues)
It works when the input_model is a complete pdb file. However, when the input_model only contain part of the structure of the full pdb but retains the full sequence information, the code above always return the num_residues of the full structure, not the input_model only.
Is there any way to get this done?
Best, Huy _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
participants (2)
-
Eric Pettersen
-
huybk81@gmail.com