Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in executing certain tools (possibly oxpy related?) #22

Closed
simonecodispoti opened this issue Jul 3, 2022 · 5 comments
Closed

Comments

@simonecodispoti
Copy link

Hi all,
thank you in advance for considering this request. I think it is a real trivial issue, but I wasn't able to solve it yet. I successfully installed the oxdna_analysis_tools via pip. As described in https://github.com/lorenzo-rovigatti/oxDNA, I installed the oxpy package via:

git clone https://github.com/lorenzo-rovigatti/oxDNA.git
cd oxDNA
git checkout oxpy --
pip install .

oxDNA was already working well, but I had troubles in using the incorporated UTILS, which gave me syntax errors by calling the python interpret. Now I'm obtaining errors if I try to execute some tools, and they seem to be linked to the oxpy package. As an example, executing oat generate_force some_input last_conf.dat gives me:

INFO: No outfile name provided, defaulting to "forces.txt"
WARNING: Overwriting key `trajectory_file' (`trajectory.dat' to `last_conf.dat')
Traceback (most recent call last):
  File "/home/simone/anaconda3/bin/oat", line 10, in <module>
    sys.exit(main())
  File "/home/simone/anaconda3/lib/python3.7/site-packages/oxDNA_analysis_tools/entry.py", line 24, in main
    to_call.main()
  File "/home/simone/anaconda3/lib/python3.7/site-packages/oxDNA_analysis_tools/generate_force.py", line 46, in main
    if (not inp["use_average_seq"] or inp.get_bool("use_average_seq")) and "RNA" in inp["interaction_type"]:
AttributeError: 'oxpy.core.InputFile' object has no attribute 'get_bool'

These errors do not occur in other tools such as mean, align, backbone_flexibility or plot_energy. Are these errors due to missing dependencies?

Thank you in advance,
best regards,

Simone

@ErikPoppleton
Copy link
Collaborator

Hi Simone,

The oxDNA repo is a bit of a mess right now because we're getting ready for the official transition from the SourceForge repository to the GitHub one. It's very possible I used a function that isn't yet merged into the master branch for that script. Can you instead try checking out the joss_submission branch and following the same set of commands you did to build oxpy there?

@simonecodispoti
Copy link
Author

Thanks for the suggestion Erik!
I cloned he joss_submission branch and compiled again oxDNA, now with python bindings enabled. Everything seemed to work ok, also oxpy tests were successful. However, errors continue to pop out when I try executing tools. The previous generate_force error disappeared, but now other tools raise errors. As an example, this is the output of oat bond_analysis input_persistences trajectory.dat 2pairs.out occupancy.out:

Traceback (most recent call last):
  File "/home/simone/anaconda3/bin/oat", line 10, in <module>
    sys.exit(main())
  File "/home/simone/anaconda3/lib/python3.7/site-packages/oxDNA_analysis_tools/entry.py", line 22, in main
    to_call = import_module('oxDNA_analysis_tools.{}'.format(script))
  File "/home/simone/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/simone/anaconda3/lib/python3.7/site-packages/oxDNA_analysis_tools/bond_analysis.py", line 58, in <module>
    def bond_analysis(traj_info:TrajInfo, top_info:TopInfo, pairs:dict[int, int], inputfile:str, ncpus:int=1) -> Tuple[int, int, int, np.ndarray]:
TypeError: 'type' object is not subscriptable

This seems to be unrelated to oxpy?

Thank you for the quick response anyway!

Simone

@ErikPoppleton
Copy link
Collaborator

ErikPoppleton commented Jul 5, 2022

Hi Simone, I looked into this some more and it turns out that subscripted typing hints were a feature introduced in Python 3.8, can you try creating yourself a new conda environment with a newer version of Python and trying that? I will update the version requirements in the distribution.

@simonecodispoti
Copy link
Author

simonecodispoti commented Jul 6, 2022

Hi Erik,
I'm trying with a python 3.8 enviroment. I created the enviroment with the needed pkgs and recompiled oxDNA with python bindings. Now the problem is that oat is not able to find the oxpy library, which is located on the site-packages folder of the base enviroment. How can I get oxpy on the enviroment?

Thanks again,
Simone

@ErikPoppleton
Copy link
Collaborator

ErikPoppleton commented Jul 6, 2022

Hi Simone,

While in the environment, just navigate back to the oxDNA directory and run make install again. If that doesn't work, it's because the Cmake command used to build oxDNA sometimes finds the wrong version of Python. The fix for this is covered in this section of the oxDNA documentation. The Python interpreter can be found by running which python in the command line and the include directory is usually in a directory close to the interpreter (not at my computer right now so can't look up exactly where it is for me). Hopefully within the next few days we will finish the merge of oat into the main oxDNA repo so installing two packages won't be a problem anymore

I'm going to close this now, but feel free to reply or open a new issue if you run into anything else. The new version hasn't been used by very many people yet so finding all the bugs I missed during testing is very appreciated.

Best,

Erik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants