Closed britesma closed 3 months ago
The PDBWriter class can take as a first argument a StructureView object.
If you change the selection at the level of the component, the component.structureView
property contains the subset corresponding to the selection.
const writer = new PdbWriter(component.structureView)
writer.download() // or writer.getData() if you prefer to get the content as a string to manipulate it
Ohhh nice, thank you very much!
But how can I maintain the atom serials ? I mean the new writer rewrites the atom serial from 1, I would like to keep them as the original .pdb. Do I need to manipulate the string as you said?
I got it, I can just pass the flag renumberSerial.
Use case: I loaded my .pdb file and after a selection on it I need to export a .pdb with that selection.
Is there an easy way that I am missing? Thank you!