Show multiple molecules in NGLWidget

60 views
Skip to first unread message

Kevin Flandes

unread,
Oct 20, 2022, 7:03:04 PM10/20/22
to MDnalysis discussion

Hi, I want to show the residues that are interacting with that ligand. I used the comand

$   u.select_atoms ( 'resid ### '  , ' resid ###  ' , 'resname JAR ' )

resid ### are the residues which present more interactions with JAR (ligand) 

Screenshot from 2022-10-20 17-18-40.png

I show you the protein and ligand that conform the universe. Everythings run how it has to.

In the first command, it's working; showing those 2 residues and ligand.
But in the second command, where I added more residues (including those 2 that I already put in the first command) it only shows the ligand. 
Screenshot from 2022-10-20 17-21-27.png

Help me, please :)


Oliver Beckstein

unread,
Oct 20, 2022, 11:50:55 PM10/20/22
to mdnalysis-discussion
Hi Kevin,

Did you check that your new selection really contains all the atoms/residues that you expect to see there?

ag_Int = u.select_atoms(“resid 517 716”, "resname JAR”)
print(len(ag_Int)
print(ag_Int.residues)

ag_INT2 = u.select_atoms(“resid 517 716”, "resname JAR”, “resname 7171 542 629 683 682 715 519 577 605 518 544")
print(len(ag_INT2)
print(ag_INT2.residues)


Note that I consolidated your example by putting multiple resids into one “resid N1 N2 …” selection term. This will order the atoms inside the AtomGroup, if you MUST have exactly the order of residues then use your “resid N1”, “resid N2”, … approach.


If the AtomGroups contain the correct residues and atoms then this would look like a NGLViewer issue. Btw, I used to use “nv.show_mdanalysis(ag)” (see https://www.mdanalysis.org/2016/03/14/nglview/ andhttps://github.com/MDAnalysis/WorkshopMDMLEdinburgh2022/blob/main/MD/Lecture1_MDAnalysisBasics.ipynb  ) — Is there a specific reason that you do the 2-step process with MDAnalysisTrajectory() ?

Oliver



On Oct 20, 2022, at 4:01 PM, Kevin Flandes <kevinfl...@gmail.com> wrote:

Hi, I want to show the residues that are interacting with that ligand. I used the comand

$   u.select_atoms ( 'resid ### '  , ' resid ###  ' , 'resname JAR ' )

resid ### are the residues which present more interactions with JAR (ligand) 

<Screenshot from 2022-10-20 17-18-40.png>

I show you the protein and ligand that conform the universe. Everythings run how it has to.

In the first command, it's working; showing those 2 residues and ligand.
But in the second command, where I added more residues (including those 2 that I already put in the first command) it only shows the ligand. 
<Screenshot from 2022-10-20 17-21-27.png>

Help me, please :)



--
Oliver Beckstein (he/his/him)

GitHub: @orbeckst

MDAnalysis – a NumFOCUS fiscally sponsored project





Reply all
Reply to author
Forward
0 new messages