Hi Nikhil, You absolutely can create structures completely in the Python layer, though the flow is kind of in the opposite direction: you create an AtomicStructure, use it's new_residue() method to create residues as needed and then add atoms to those residues. For creating atoms I recommend using the chimerax.atomic.struct_edit.add_atom() method, which handles a lot of bookkeeping that you might otherwise forget or not know about (rather than the low-level new_atom() method of AtomicStructure). Once you create a structure, you add it to the ChimeraX session with session.models.add([structure]). --Eric Eric Pettersen UCSF Computer Graphics Lab
On Aug 8, 2025, at 9:38 AM, nrajan53045--- via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi there,
I am new to ChimeraX and its python API. As I was looking through the documentation, I noticed there were some atomic data classes (AtomicStructure, Atom, Atoms, Residue). Say I have a PDB file with information about all the atoms in the model, am I able to simply create Atom objects from reading the PDB file and, consequently, add these Atom objects to an AtomicStructure object?
The reason I want to do this is because I want to use the fitmap function while limiting any disk IO. So, opening the file in ChimeraX (even if using the no gui offscreen functionality) would not work. I thought of simply creating objects from scratch, but I am running into errors when instantiating them.
Sorry if this is an obscure problem or if I was unclear. Thanks for your help!
Best, Nikhil _______________________________________________ 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/