How chains/segments are distinguished

18 views
Skip to first unread message

fabio trovato

unread,
Apr 12, 2019, 1:01:44 PM4/12/19
to MDnalysis discussion
Hi,


I have a very simple script:

import MDAnalysis as mda
u
= mda.Universe("two_chains.pdb")
print(u,u.segments.n_segments,u.segments.segids)


and two mock pdb files (differing only for the chain names, either A,A or A,B):

ATOM 2 B XXX A 28 -5.138 -5.730 36.404 1.00 58.59
TER
ATOM
2 B XXX A 28 -5.138 -5.730 36.404 1.00 58.59
END

and 

ATOM 2 B XXX A 28 -5.138 -5.730 36.404 1.00 58.59
TER
ATOM
2 B XXX B 28 -5.138 -5.730 36.404 1.00 58.59
END

When I execute the script on the first  and second pdb I get, respectively:

<Universe with 2 atoms> 1 ['A']

and

<Universe with 2 atoms> 2 ['A' 'B']

Is this correct? I think that only the second case is correct, while in the first one MDAnalysis has the wrong behavior. It treats the first pdb as if it had 1 segment, while the first pbs has two segments for which the names happen to be the same. In the first pdb, shouldnt one expect an output like:

<Universe with 2 atoms> 2 ['A' 'A']


Best
Reply all
Reply to author
Forward
0 new messages