selection by protein chain id?

440 views
Skip to first unread message

Yogesh Sharma

unread,
Jul 24, 2020, 5:43:34 PM7/24/20
to MDnalysis discussion
hi,
I am here with this basic question. I have a protein tetramer with different chain ids but same residue ids within chains. for example resid 6 in all chain refers to same amino acid. so i cant use select_atoms to select residues in a single chain (it will select residues in all chains i guess) how can i select atoms on the basis of chain id A,B,C,D

Achain=u.select_atoms("resid 15-256")               
Achain.write("XXXX.pdb")

Tamas Hegedus

unread,
Jul 25, 2020, 9:02:43 AM7/25/20
to mdnalysis-...@googlegroups.com
Achain=u.select_atoms("resid 15-256 and segid A")
See https://www.mdanalysis.org/docs/documentation_pages/selections.html
--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/6f4375e3-e8e4-4f08-80a9-93299b20dd4ao%40googlegroups.com.

YAGYA CHAUDHARY

unread,
May 22, 2021, 3:33:56 PM5/22/21
to MDnalysis discussion

Hi,
I want to select two chains together to form a group. I am using LID_ca = u.select_atoms('name CA and segid A and segid B'), but this is not working.

Please suggest how to select two chains altogether.

Regards
Yagya

Kacey Clark

unread,
May 22, 2021, 10:02:42 PM5/22/21
to mdnalysis-...@googlegroups.com
Hi,

Have you tried u.select_atoms('name CA and (segid A or segid B)')? That way you are selecting things that have segid A or segid B, so you will get both groups.

Best,
Kacey

YAGYA CHAUDHARY

unread,
May 23, 2021, 3:36:14 AM5/23/21
to mdnalysis-...@googlegroups.com
Thank you. This works for me.

You received this message because you are subscribed to a topic in the Google Groups "MDnalysis discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mdnalysis-discussion/JjhRcC8Steg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/CADJ2gBjgsck4sqsW%2BWUpG0FLb1mP7eEOUjdDKNtWrV%2Be6z8Chw%40mail.gmail.com.

Lily Wang

unread,
May 25, 2021, 12:08:15 PM5/25/21
to mdnalysis-...@googlegroups.com
Hi Yagya,

The selection language uses logical conjunctions (https://en.wikipedia.org/wiki/Logical_conjunction). This means that LID_ca = u.select_atoms('name CA and segid A and segid B’) tells MDAnalysis to select all atoms named “CA", in a single chain that is named “A” and “B” at the same time. You can chain segids together, which is an implied “or”:

LID_ca = u.select_atoms('name CA and segid A B’)

Or you can be more explicit:

LID_ca = u.select_atoms('name CA and (segid A or segid B)’)

Hope that helps.

Cheers,
Lily

Reply all
Reply to author
Forward
0 new messages