MDAnalysis / solvation-analysis

A comprehensive tool for analyzing liquid solvation structure.
https://solvation-analysis.readthedocs.io/en/latest/
GNU General Public License v3.0
46 stars 13 forks source link

rdf_data not initialized properly when running solute.run() #101

Open Caboomi opened 5 months ago

Caboomi commented 5 months ago

I am using ase to convert an xdatcar file to a xyz and pdb file and reading it into the mda.Universe as you can see in the pdf attached vertopal.com_5x_analysis.pdf. I am receiving an error when running solute.plot_solvation_radius('Li', solvent) as KeyError: 'Li' despite having this:

solute = Solute.from_atoms( dme_Li, {'dme_TFSI': dme_TFSI, 'dme_DOL': dme_DOL, 'dme_DME': dme_DME}, solute_name="Li", radii={"dme_TFSI": 2.6, "dme_DOL": 2.6, "dme_DME": 2.6} ) as my solute.

I think it could stem from run() not initializing rdf_data properly as it creates solute_0 ... solute_4 in my rdf_data rather than having 'Li'in the directory. My Li solute is made up of 5 Li atoms.

orionarcher commented 5 months ago

I think it could stem from run() not initializing rdf_data properly as it creates solute_0 ... solute_4 in my rdf_data rather than having 'Li'in the directory. My Li solute is made up of 5 Li atoms.

Thanks for the report. I think you are probably right about this. Could you post the input files so I can take a look?

In the meantime, you could try using rename_solutes = {"solute_0": "Li", ..., "solute_4": "Li"} as a kwarg?

Caboomi commented 5 months ago

https://drive.google.com/drive/folders/1cdZyy6Cca2IfW2qwt9HVLevLtmYS_KH9?usp=sharing

You can find the files here. Thank you for the suggestion, it worked!

Caboomi commented 4 months ago

@orionarcher Were you able to fix it?

orionarcher commented 4 months ago

Not yet but I've observed the bug in another case and it's on my TODO list.

orionarcher commented 4 months ago

Hi Caboomi. I am taking a look at this but would appreciate some help.

Would you mind sending along a minimal reproduction of the bug? In particular, could 1) you remove the calls to ase and any other code not involved in direct generation of the bug 2) specify exactly which files I should be loading.

I don't have ase set up and I'd prefer to not have to configure a whole new environment to get to the bottom of this. Thank you!