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

Problem with visualizing the ligand with gromacs file #152

Closed
yousefymohammad opened this issue Sep 6, 2023 · 5 comments
Closed

Problem with visualizing the ligand with gromacs file #152

yousefymohammad opened this issue Sep 6, 2023 · 5 comments

Comments

@yousefymohammad
Copy link

Hi,
I am using the Gromacs file (xtc and tpr file) for prolif. once I selected the ligand, it detect correctly the ligand and its whole atom. however when I want to visualize using this command"# create a molecule from the MDAnalysis selection
ligand_mol = plf.Molecule.from_mda(ligand_selection)

display

plf.display_residues(ligand_mol, size=(400, 200))".
I am giving this error: AttributeError: No hydrogen atom could be found in the topology, but the converter requires all hydrogens to be explicit. You can use the parameter NoImplicit=False when using the converter to allow implicit hydrogens and disable inferring bond orders and charges. You can also use force=True to ignore this error.
could you please help how to fix the issue?

@cbouy
Copy link
Member

cbouy commented Sep 6, 2023

Hi,

It's a bit hard to tell without more info. What is the selection command that you are using to create ligand_selection?
And what is the output of ligand_selection.elements?

@yousefymohammad
Copy link
Author

Hi,
thanks for your reply. the problem was fixed. I just share what I did.
regarding the selection command I am using "ligand_selection = u.select_atoms("resname G13". in beginning I thought that my be the hydrogen is implicit and it can not detect, I check it and it is explicit. it shows all of the hydrogens with this command "ligand_selection.names". however in the next step it can not visualize the ligand. I used this two line to guess the the element and add it to the topology attribute:
gess_elements = guess_types(u.atoms.names)
u.add_TopologyAttr('elements', gess_elements)

@cbouy
Copy link
Member

cbouy commented Sep 7, 2023

Great, thank you for posting the solution here!

@cbouy cbouy closed this as completed Sep 7, 2023
@cbouy
Copy link
Member

cbouy commented Sep 7, 2023

If you run fp.plot_lignetwork? it should display some help on that: there are 2 parameters that are of interest for you here: kind and threshold.

By default the plot aggregates interactions from all frames and filters the less frequent ones with a threshold.

You can also switch to plotting a single frame (kind="frame") and specify which frame to display (frame=frame number).

@yousefymohammad
Copy link
Author

thanks a lot :)

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