Hi Elaine,
I used the same approach as mentioned by you for the PDB files.
Thank you

On Wed, 23 Aug, 2023, 21:54 Elaine Meng, <meng@cgl.ucsf.edu> wrote:
Hi Prathvi,
In case you didn't know:

If you have a PDB file, you can just view the file contents in a text-editor and look for "RESOLUTION." 

Also if you open the PDB (or mmCIF) file in ChimeraX, the command "log metadata" will show information including resolution (if applicable) in the Log, and command "log save" will save all current Log contents to an HTML file:

<https://rbvi.ucsf.edu/chimerax/docs/user/commands/log.html#metadata>

Best,
Elaine
-----
Elaine C. Meng, Ph.D.                       
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco

> On Aug 22, 2023, at 11:08 PM, Prathvi Singh via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
>
> Thank you so much Eric for the help! I will try this out. I primarily wanted to do it for PDB files but this script can come in handy in future.
>
> On Tue, Aug 22, 2023 at 10:35 PM Eric Pettersen <pett@cgl.ucsf.edu> wrote:
> Hi Prathvi,
>       Assuming the structures were opened from mmCIF files, then the following code would write the structure names and resolutions to a file named 'resolutions.txt' on your Desktop:
>
> from chimerax.atomic import all_atomic_structures
> from chimerax.mmcif.mmcif import resolution
> from os.path import expanduser
> with open(expanduser("~/Desktop/resolutions.txt"), "wt") as f:
>       for s in all_atomic_structures(session):
>               res_info = resolution(s)
>               if res_info is None:
>                       res_info = "no resolution info"
>               print(f"{s.name} {res_info}", file=f)
>
> I've attached the above as a file named res.py.  You run the code just by opening the file with the "open" command or the File→Open dialog.  You could also extract resolution info from a PDB, but that's a lot more complicated because there's no convenient "resolution" routine to use; you have to root around in various header records to get the resolution value.  You can see code that does that here: https://github.com/RBVI/ChimeraX/blob/develop/src/bundles/pdb/src/pdb.py (lines 639-674).
>
> --Eric
>
>       Eric Pettersen
>       UCSF Computer Graphics Lab
>
>
>
>> On Aug 22, 2023, at 12:21 AM, Prathvi Singh via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
>>
>> Hi Elaine,
>>
>> Is there a way to save the resolution of a protein structure to a file using command line, either in chimeraX or chimera?
>>
>> Thanks
>>