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

Add "lipid" keyword to select_atoms #2082

mimischi opened this Issue Sep 25, 2018 · 3 comments


None yet
3 participants

mimischi commented Sep 25, 2018

Is your feature request related to a problem? Please describe.
It would be great if one could select all lipids in a Universe by a common keyword, e.g. lipid just like one can select all proteins via protein.

Describe the solution you'd like

u = mda.Universe(gro)

Additional context
VMD does have a similar, partially functional (does not recognize all lipid names) version of this.

I would like to contribute this in a PR. I guess duplicating the behavior of ProteinSelection would be the solution?

class ProteinSelection(Selection):
"""Consists of all residues with recognized residue names.
Recognized residue names in :attr:`ProteinSelection.prot_res`.
* from the CHARMM force field::
awk '/RESI/ {printf "'"'"%s"'"',",$2 }' top_all27_prot_lipid.rtf
* manually added special CHARMM, OPLS/AA and Amber residue names.
See Also
token = 'protein'
prot_res = np.array([
# CHARMM top_all27_prot_lipid.rtf
'ALA', 'ARG', 'ASN', 'ASP', 'CYS', 'GLN', 'GLU', 'GLY', 'HSD',
'HSE', 'HSP', 'ILE', 'LEU', 'LYS', 'MET', 'PHE', 'PRO', 'SER', 'THR',
'TRP', 'TYR', 'VAL', 'ALAD',
## 'CHO','EAM', # -- special formyl and ethanolamine termini of gramicidin
'HIS', 'MSE',
# from Gromacs 4.5.3 oplsaa.ff/aminoacids.rtp
'ARGN', 'ASPH', 'CYS2', 'CYSH', 'QLN', 'PGLU', 'GLUH', 'HIS1', 'HISD',
# from Gromacs 4.5.3 gromos53a6.ff/aminoacids.rtp
'ASN1', 'CYS1', 'HISA', 'HISB', 'HIS2',
# from Gromacs 4.5.3 amber03.ff/aminoacids.rtp
'HID', 'HIE', 'HIP', 'ORN', 'DAB', 'LYN', 'HYP', 'CYM', 'CYX', 'ASH',
'GLH', 'ACE', 'NME',
# from Gromacs 2016.3 amber99sb-star-ildn.ff/aminoacids.rtp
'CCYX', 'CMET', 'CME', 'ASF',

I think grabbing the residue names from (see here, click "Membrane only system") should be sufficient. They include pretty much all parameterized lipids for CHARMM36. Although I do not know how one would need to do attributions here.


This comment has been minimized.

mimischi commented Sep 25, 2018

Oh, seems like #104 is related.


This comment has been minimized.


richardjgowers commented Sep 25, 2018

@mimischi yeah sounds like it might be useful, but I can imagine a lot of reports of "it didn't select my lipids though" (how universal are the charmm36 names?). Managing this will require #104.

The way selections work, you can define the class anywhere and it gets automagically included in to the selection language, so you can play around in a notebook and get it working quickly. PR welcome!


This comment has been minimized.

mimischi commented Sep 25, 2018

Awesome, will do!

I will try to do some research how lipids are named in other force fields, if no one else knows this already :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment