Hello Yuncheng--
>
>
> 1.How to get .out files (the xplor running script) when running .py files in
> Xplor-NIH 3.6
>
>
>
> I understand that many of the scripts in xplor 3.6 are compiled based on the
> python language. The scripts have changed from .inp files to the scripts in
> bin
> and .py files in various folders. When using version 3.6, I was still
> interested in
> what happens to the scripts running in xplor at runtime. When I ran ‘xplor
> script.py” in terminal while using the tutorial, the xplor script runs were
> shown in
> terminal. (See Figure 1)
>
>
>
> I used '/xplor-nih-tutorial-2022/PSF_generation/genExtendedDNA.py' from the
> tutorial as an example. These runs do not generate an '.out' file in the
> folder. It
> was very messy and inconvenient to view them directly in terminal. This made
> the script run like a black box for me, so that I could not see what xplor
> functions
> were being called and what parameters and force fields were being used. (see
> Figure 2)
>
>
>
> In older versions, when running scripts in .inp format, xplor's runtime
> scripts
> would also be output in '.out' format. In these cases, these .out files still
> exist in
> the deprecated folder of version 3.6. The example is at location
> ‘/xplor-nih-3.6/deprecated/tutorial/generate/generate.out’. (See Figures 3
> and 4) I
> want to know if I could generate similar .out files at runtime in Xplor-NIH
> 3.6.
>
The behavior has actually not changed: when run interactively, the
output of an Xplor-NIH script goes to stdout, which is the terminal,
by default. If you would like to save it for later perusal, you can
redirect stdout using the greater-than character:
xplor script.py > script.out
or, using the tee program, observe the output *and* save to a file:
xplor script.py | tee script.out
I believe that old XPLOR scripts were frequently run like
xplor < script.inp > script.out
thus obtaining a copy of the output.
>
>
> 2. How to import xplor-NIH into jupyter-notebook
>
>
>
> The jupyter-notebook can track xplor running script and adjust the parameters
> flexibly. I tried to follow the tutorial to start xplor directly in
> jupyter-notebook,
> but it failed. The error is 'name xplor is not defined'. (See figure 6)
>
> I checked your website for the tutorial 'A beginner's tutorial for the python
> interface'. and the tutorial on 'intro-to-python' at
> '/xplor-nih-tutorial-2022/IntroToPython.ipynb'. (See Figure 5), I tried to
> add script,
> ‘import sys, import xplorNIH, import ivm’ to the first cell of the jupyter,
> but it
> failed. The error reported is ''ModuleNotFoundError: No model named
> 'xplorNIH'.
> (See Figure 6)
Are you running jupyterXplor notebook? Importing Xplor-NIH Python
modules into an external interpreter will only work if you compile
Xplor-NIH using the same version of Python as is used for jupyter
notebook. For instance, this works fine for me:
/path/to/xplor-nih-3.6/bin/jupyterXplor notebook \
/path/to/xplor-nih-tutorial-2022/IntroToPython.ipynb
Please let me know if you have further difficulties.
Charles
########################################################################
To unsubscribe from the XPLOR-NIH list, click the following link:
http://list.nih.gov/cgi-bin/wa.exe?SUBED1=XPLOR-NIH&A=1