Hello,


When I need to do this kind of string transformations many times, I find that using a shell command (I mean the OS shell, not the one in ChimeraX) is less annoying than editing the pasted string every single time:


1. copy your line, in this case -9.8798 1.6928 0.0084028

2. in the shell, run the equivalent of: pbpaste | tr ' ' ',' | pbcopy

3. paste in your script, in this case you will get: -9.8798,1.6928,0.0084028


All this can be done from the keyboard (alt+tab or cmd+tab to switch windows), and once you have the command from step 2 in your shell history you can repeat it with minimal typing (up + enter).


Regarding step 2, pbpaste and pbcopy will only work on macOS. On Linux, use xclip -o and xclip -i, respectively (or alias them to the names pbpaste and pbcopy; life is too short to remember commands specific to different systems). I don't know how these commands behave on WSL on Windows, but there might be an equivalent PowerShell command if you don't want to use WSL.

You also need to adjust the tr command in the middle of the pipeline depending on which substitutions you need (or use more elaborate commands like sed).


That said, I agree that a global option for "scripting-friendly Log output" could be helpful to prepare scripts from an interactive session. But probably not the highest priority.


I hope this helps,


Guillaume


From: Kumpula, Esa-Pekka via ChimeraX-users <chimerax-users@cgl.ucsf.edu>
Sent: Tuesday, May 14, 2024 11:16:37 AM
To: Tom Goddard
Cc: chimerax-users@cgl.ucsf.edu
Subject: [chimerax-users] Re: Cofr command output in log
 

Hi Tom,

 

Thanks! While I struggle to understand the use for reading the output of cofr, I appreciate that you are keeping the needs of the majority of users in mind. I also understand that resources are probably limiting, but if it would be possible in the future, maybe there could be a toggle somewhere in the settings for “script-friendly output from reporting commands in the log”? Just to throw that idea out there.

 

I want to balance the message by saying that I really appreciate ChimeraX, it’s my main workhorse and I don’t know what I’d do without it. Thanks for keeping it running!

 

Cheers,

EP

 

From: Tom Goddard <goddard@sonic.net>
Date: Monday, 13. May 2024 at 23.11
To: Kumpula, Esa-Pekka <esa-pekka.kumpula@helsinki.fi>
Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu>
Subject: Re: [chimerax-users] Cofr command output in log

Hi EP,

 

  Putting cofr output in the log with comma's and no spaces so it could be pasted into a command script without editing would help you, but for people who want the log to be legible, probably the majority of users, it seems to make it worse.

 

  With commas

 

> cofr

Center of rotation: -9.8798,1.6928,0.0084028 front center

 

  With spaces

 

> cofr

Center of rotation: -9.8798 1.6928 0.0084028 front center

 

I'm inclined not to change it for the copy-and-paste to a script use.  Unfortunately we have to compromise to do what is best for the majority of people using ChimeraX.  The only way to customize the ChimeraX logged output is to edit the Python code.  Not sure how you envision requesting different output formats -- that does seem like a fantasy world.

 

Tom

 



On May 10, 2024, at 3:26AM, Kumpula, Esa-Pekka via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

 

Dear ChimeraX crew,

 

A minor quality-of-life improvement request: would it be possible to have the command cofr output the values as a comma-separated list instead of a whitespace separated one? I am including cofr information reatively often in my figure preparation scripts and having NOT to always replace these when copy&pasting would be a nice improvement!

 

Also, in general, can I customize the output of commands to the log (such as view matrix, cofr, zoom, clip list) within an alias for example? In a fluffy dream world, I would have an output from these that I can directly copy&paste to my scripts and get the camera positioned Just Right.

 

Cheers,

EP

 

 

--

Esa-Pekka Kumpula, PhD

Senior Postdoctoral Researcher

Laboratory of Structural Biology

Institute of Biotechnology

Helsinki Institute of Life Science HiLIFE

University of Helsinki

 

 

 

_______________________________________________
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/

 


VARNING: Klicka inte på länkar och öppna inte bilagor om du inte känner igen avsändaren och vet att innehållet är säkert.
CAUTION: Do not click on links or open attachments unless you recognise the sender and know the content is safe.


Page Title







När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy