Re: [AMMRL] IconNMR and Python scripts

From: Petra ROVO via groups.io <petra.rovo=ist.ac.at_at_groups.io>
Date: Mon, 4 Aug 2025 09:35:09 +0000

Dear Sameer,

Thank you for your help. It finally worked for us. In case anybody wants to
run Python scripts with IconNMR, here is what to do:


· Write your Jython/Python script and save it as e.g. ‘pythonscript.py’ in … exp/stan/nmr/py/user

· Indicate this file name in the PYNM line in the ‘eda’ window

· Keep the original ‘au_zg’ or similar au program
given under AUNM to be able to start the experiment in IconNMR

· Write a separate AU file with the two lines that Sameer gave:

XPY(“pythonscript.py”)
QUIT


· Save this new au script e.g. as ‘xpy_au’ in
… exp/stan/nmr/as/src/user

· Create a new experiment in Topspin with the pulse sequence which
you would like to add to IconNMR

· Run the Jython/Python script by typing its name into the Topspin
command line (you don’t need the .py end)

· Run your experiment in Topspin to see everything works fine.

· Save the parameters of this experiment with ‘wpar’,
save it as e.g. ‘NewPulseseq’.

· In IconNMR/Configuration, under ‘User settings/User
Manager’ add this new experiment using the parameter name you just
defined.

· In IconNMR/Configuration, go to ‘Virtual Parameters
Sets’ and add a new one where the ‘Experiment name’ and
the ‘Underlying Parameter Set’ is the parameter name you just
added to IconNMR and the ‘Command after dataset creation’
is ‘xau xpy_au’

· In the IconNMR automation window, create a new experiment,
select the newly added experiment, and press the = symbol to trigger the
Python script to run.

Our Python script shows a pop-up window where the users can give the ppm range
where they want to have their CEST presaturations. With the given starting and
ending values the script generates the FQ1LIST file and modifies the TD number too.

I hope some of you will find it helpful.

Best wishes,

Petra


> From: main_at_ammrl.groups.io On Behalf Of Sameer Al-Abdul-Wahid via groups.io
> Sent: Friday, August 1, 2025 5:37 PM
> To: main_at_ammrl.groups.io
> Subject: Re: [AMMRL] IconNMR and Python scripts

Hi Petra,

I ended up using an AU script with two lines, in TopSpin 3.6.5:

XPY(“pythonscript.py”)
QUIT

In our application, we call this AU program during the LOCK portion of the
IconNMR (to add in a VT waiting period and to run ATMA in a way that works
better for us).

Best,
Sameer


--
Sameer Al-Abdul-Wahid, Ph.D.

Manager, Nuclear Magnetic Resonance Centre http://nmr.uoguelph.ca/

University of Guelph

519-824-4120 x58914 / s.wahid_at_uoguelph.ca



> From: main_at_ammrl.groups.io on behalf of Petra ROVO via groups.io
> Date: Friday, August 1, 2025 at 11:26
> To: main_at_ammrl.groups.io
> Subject: Re: [AMMRL] IconNMR and Python scripts

Dear Clemens,

I’m trying to run a python script from iconNMR too (using Topspin 4.5),
but I could not find the right place where I should add the „x=pya”
command. I’ve tried to add it as a line in the au_zg script, or as a
command in a ’Virtual Parameter Sets’, but none of them worked. What do I miss?

Thanks for your feedback in advance.

Petra

> From: main_at_ammrl.groups.io On Behalf Of Anklin, Clemens via groups.io
> Sent: Thursday, October 3, 2024 1:35 AM
> To: main_at_ammrl.groups.io
> Subject: Re: [AMMRL] IconNMR and Python scripts

Dear Sebastian,

tghe commands "xpya" and "xpyp" will execute the jython program defined in
PYNM and PYNMP respectively

Clemens

Dear Sameer,

I had the same question, and someone told me, that Python/Jython scripts were
not considered for use in IconNMR. My workaround was to call an AU program
and run the Python script with XPY. I was also wondering about “PYNM”
and “PYNMP”, but they couldn’t be used within the automation.

Best regards,
Sebastian


--

=========================
==========================
=====================
Clemens Anklin Ph.D. Vice President
Bruker BioSpin NMR Applications & Training
15 Fortune Drive NEW Phone: 978-313-5NMR(5667)
Billerica MA 01821 twitter: _at_canklin
web: http://www.bruker.com
e-mail: clemens.anklin_at_bruker.com
===============
==========================
==========================
======



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#2667): https://urldefense.com/v3/__https://ammrl.groups=
.io/g/main/message/2667__;!!PvDODwlR4mBZyAb0!VneD3WoDic2quSaoMOTugyLHPAVlgq=
QBSIUZN4qfEFSJKWuqZ3kZVBReSZZp4vrRGS-hQYi2cHnEbMMLUXs8lO3QCxzH$
Mute This Topic: https://urldefense.com/v3/__https://groups.io/mt/108779523=
/7559972__;!!PvDODwlR4mBZyAb0!VneD3WoDic2quSaoMOTugyLHPAVlgqQBSIUZN4qfEFSJK=
WuqZ3kZVBReSZZp4vrRGS-hQYi2cHnEbMMLUXs8lA61tioN$
Group Owner: main+owner_at_ammrl.groups.io
-=-=-=-=-=-=-=-=-=-=-=-




Received on Mon Aug 04 2025 - 02:45:21 MST

This archive was generated by hypermail 2.4.0 : Mon Sep 01 2025 - 15:37:08 MST