Selecting multiple lipids with different head groups #81
-
Hi, I've just started using LipPyphilic, and I've been trying to select multiple lipids but with different head groups using this code :
but it doesn't work and I get this error:
But, if I use the same selection with u.select_atoms it works fine:
So my question is how does the (lipid_sel=) read the lipid selection? I thought it uses the same selection language as MDAnalysis?or is it different? Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @Saleh-OM4R thanks for trying out lipyphilic! Lipyphilic does indeed use the same selection language as MDAnalysis. The issue is that you have two selection strings that you are passing to In MDAnalysis: u.select_atoms(
'resname POPE POPC PSM BMGP and name P C11 C12',
'resname CHL1 and name O3 C3',
) will create a single atom group that contains all atoms selected by both strings. If this is indeed what you want, then you need to pass a single string to lipid_sel ='(resname POPE POPC PSM BMGP and name P C11 C12) or (resname CHL1 and name O3 C3)' If you try to pass two separate strings, then Python will assume that you are trying to pass two arguments - one to If on the other hand you want to pass 'resname POPE POPC PSM BMGP and name P C11 C12' to leaflets = AssignLeaflets(
universe=u,
lipid_sel= 'resname POPE POPC PSM BMGP and name P C11 C12',
midplane_sel='resname CHL1 and name O3 C3',
) |
Beta Was this translation helpful? Give feedback.
Hi @Saleh-OM4R thanks for trying out lipyphilic!
Lipyphilic does indeed use the same selection language as MDAnalysis. The issue is that you have two selection strings that you are passing to
lipid_sel
.In MDAnalysis:
will create a single atom group that contains all atoms selected by both strings.
If this is indeed what you want, then you need to pass a single string to
AssignLeaflets
:If you try to pass two separate strings, then Python will assume that you are trying to pass two argume…