Closed Prateek1410 closed 2 years ago
Dear all,
Update: I managed to install OAT after giving full control (permissions) to authenticated users in the security panel of the properties of the oxDNA folder on my PC, using python 3.9. Running oat config shows everything as fine except it's unable to find the package oxpy. This is despite the fact that my oxDNA installation had run smoothly and that make test_oxpy shows all tests to have been passed. This shouldn't affect the running of the scripts since oxpy is required only if I do analysis from python, right?
Warm Regards Prateek
Hi Prateek,
It is likely that the oxpy
binary installed itself somewhere off the PYTHONPATH
. I believe it defaults to ~/.local/bin/
which is not a place Python checks. You either need to add it to your PYTHONPATH
or move oxpy
to a directory where Python will look. There is more info on installation issues here and in the last section of this.
As far as what it's used for, you need oxpy
for any oat
analysis which involves calculating the oxDNA energy function. This includes output_bonds
, bond_analysis
and duplex_finder
Hi Erik,
The issue got resolved! The problem was I had compiled oxDNA using python3.8 while I had separately installed OAT and oxpy using python3.9. The error was:
ImportError: Python version mismatch: module was compiled for version 3.8, while the interpreter is running version 3.9.
So, I uninstalled OAT and deleted oxDNA and started from the beginning this time passing DPYTHON_INCLUDE_DIRS=/usr/include/python3.9
and -DPYTHON_EXECUTABLE=/usr/bin/python3.9
as cmake options as suggested by you all.
I ran all the tests listed on the page and all of them were passed except tests.sh. When I ran it using bash command, I got the following error:
Testing align...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing backbone_flexibility...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing bond_analysis...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing mean and deviations...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing centroid with indexing...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing contact_map...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing distance and clustering (this one takes a while because of the plot)...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing duplex_finder...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing duplex_angle_plotter...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing generate_force...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing minify...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing multidimensional_scaling_mean...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing output_bonds...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing pca
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing subset_trajectory...
SyntaxError: invalid syntax
AN ERROR OCCURED
Testing superimpose...
SyntaxError: invalid syntax
AN ERROR OCCURED
What could this be? Once again, thanks a lot for your help!
Warm Regards Prateek
Hi,
My best guess is you are invoking analysis/tests/test.sh
in a shell environment that uses python2
as the default python
interpreter.
By typing cat analysis/tests/test.sh
, you can see a handful of commands like this one:
python ../src/oxDNA_analysis_tools/align.py minitraj.dat aligned.dat 2>&1 >/dev/null
You can cd analysis/tests
and then run the command above. You should see the full error message.
You may be able to bypass this error using the following command.
/usr/bin/python3.9 ../src/oxDNA_analysis_tools/align.py minitraj.dat aligned.dat 2>&1 >/dev/null
Roden's suggestion is the most likely answer. You can double check your Python interpreter with which python
and python --version
Thank you Roden and Erik! Yes, it was because the default python version on my WSL is 2.7. I changed the python invocations in the test file to python3.9 and it worked. Everything came out to be ok. Weirdly though, when I changed the invocations to python3 (which is set to python3.9 itself) it didn't work as OAT and oxpy weren't found.
Also, the earlier version of bond_analysis script used to print the number of native bonds and misbonds for each configuration while it processed the trajectory to the stdout. But the current version only gives the avg number over the entire trajectory. How can I obtain per conf numbers?
For the first, if you type which python3.9
and which python3
, are the output the same?
For the second, you may want to take a look at #45. It's not exactly the same, but very close to what you need. But it also requires a bit more work to prepare the input data.
No, it gives different output: /usr/bin/python3.9 and /usr/bin/python3 respectively.
Thanks, I used the script you offered there and have posted a query regarding the same. Please have a look .
This goes beyond oxDNA stuff but more about Linux and python. No need to focus on it if you have a way to run it. But if you are interested:
You need to further verify if they are the same or not. You may type ls -l /usr/bin/python3.9
and ls -l /usr/bin/python3
. In some cases, one might see that python3 is actually pointing to python3.9. In your case, I believe there is either no pointing, or python3 is actually pointing to some other version, say, python3.8. Anyhow, you should be able to type alias python="/usr/bin/python3.9"
in your terminal, and then invoking python
should work fine from there. To avoid typing this line every time in the terminal, you can put it inside your ~/.bashrc
.
The root of all this is, OAT and oxpy is installed somewhere in your system. In my case, it is ~/.local/lib/python3.10/site-packages/oxpy
and ~/.local/bin/oat
. Your shell needs to be able to find oat
without prefixing it with the whole path. Add ~/.local/bin
in your PATH
environment variable should do the job. As for oxpy, you need to invoke a python that has ~/.local/lib/python3.10/site-packages
in the include dir. There are several ways doing so. Google for PYTHONPATH
, sys.path
should give you more details.
Will take a look and respond later in the other thread.
Greetings!
During installation of OAT it fails at building wheel for oxDNA analysis tools. The following error comes up.
Interestingly, OAT gets installed without any issue when I use python 3.8. Could you please help me with this? I posted here since I thought after the updates, all oxDNA related queries go here. Thank you for your time and consideration.
Warm Regards Prateek