Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
48a20d4
add feature: force_chainids_to_segids to PDBParser
yuyuan871111 Mar 6, 2025
1039838
Merge branch 'MDAnalysis:develop' into develop
yuyuan871111 Mar 13, 2025
a86a184
PDBParser segid column 73-76
yuyuan871111 Mar 13, 2025
01d5c8d
update authors and document for PDB
yuyuan871111 Mar 13, 2025
e2707e4
add warning, test function, format to flake8 with darker and black
yuyuan871111 Mar 14, 2025
c2e0765
update document
yuyuan871111 Mar 14, 2025
4e638e2
Merge branch 'develop' into pdbparser_chainid_segid
yuyuan871111 Mar 14, 2025
9472cf5
update doc
yuyuan871111 Mar 16, 2025
c9afea7
guess segments by ids
yuyuan871111 Mar 16, 2025
806f514
fix the import conflict
yuyuan871111 Mar 16, 2025
3247dae
fix typo and dtype
yuyuan871111 Mar 16, 2025
4fe0a4c
update doc and test
yuyuan871111 Mar 17, 2025
861928a
cover more codes with tests and fix bugs
yuyuan871111 Mar 17, 2025
18b7e85
add warnings, change to set_groups to make it easy understand
yuyuan871111 Mar 19, 2025
141fd4c
test_set_groups: add test for atoms.resids
yuyuan871111 Mar 19, 2025
ee64ffc
update doc
yuyuan871111 Mar 19, 2025
da9b84f
increase test coverage
yuyuan871111 Mar 19, 2025
efba1f3
update the docs and simplify the codes
yuyuan871111 Mar 20, 2025
a594aaf
Merge branch 'develop' into pdbparser_chainid_segid
yuyuan871111 Mar 22, 2025
729c00a
fix with code review
yuyuan871111 Mar 30, 2025
c43a115
fix with code review
yuyuan871111 Mar 30, 2025
9dca86a
fix typos
yuyuan871111 Mar 30, 2025
324a51e
Merge branch 'develop' into pdbparser_chainid_segid
yuyuan871111 Mar 30, 2025
42261eb
Merge branch 'develop' into pdbparser_chainid_segid
yuyuan871111 Mar 31, 2025
93d38c8
formatting
yuyuan871111 Mar 31, 2025
96ac6f5
PDB note less
yuyuan871111 Mar 31, 2025
51eaa80
update with code review and update doc
yuyuan871111 Mar 31, 2025
4797dea
fix test fails, move force_segids_to_chainids test from coordinates's…
yuyuan871111 Mar 31, 2025
c8941ac
Update universe.py
yuyuan871111 Mar 31, 2025
f9f3aa1
remove redundant 'else'
yuyuan871111 Apr 1, 2025
31c7796
fix bug in test
yuyuan871111 Apr 1, 2025
9be6f99
replacefor loop with assert_equal
yuyuan871111 Apr 7, 2025
3d822f7
add CHANGELOG
yuyuan871111 Apr 11, 2025
9c438a4
Merge branch 'develop' into pdbparser_chainid_segid
yuyuan871111 Apr 11, 2025
82b8c98
update docs
yuyuan871111 Apr 12, 2025
83d009d
update docs
yuyuan871111 Apr 12, 2025
f4f5228
Update package/MDAnalysis/topology/PDBParser.py
yuyuan871111 Apr 13, 2025
c0fd273
fix with review
yuyuan871111 Apr 13, 2025
ba66fdb
add test in test_pdb
yuyuan871111 Apr 14, 2025
eaf052c
fix typo
yuyuan871111 Apr 14, 2025
f3d2eaf
enhance test coverage
yuyuan871111 Apr 14, 2025
6b61cd9
more general version for set groups
yuyuan871111 Apr 14, 2025
d4a4a3f
prune redundant codes in pdbparser
yuyuan871111 Apr 14, 2025
44e659b
add test no affect customattrs
yuyuan871111 Apr 14, 2025
060b3ef
add test no affect customattrs
yuyuan871111 Apr 14, 2025
de73b17
Merge branch 'develop' into pdbparser_chainid_segid
orbeckst Apr 16, 2025
dd47aa8
Update testsuite/MDAnalysisTests/core/test_universe.py
yuyuan871111 Apr 16, 2025
d1dbade
Merge branch 'develop' into pdbparser_chainid_segid
yuyuan871111 Apr 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ Chronological list of authors
- Tanish Yelgoe
2025
- Joshua Raphael Uy
- Yu-Yuan (Stuart) Yang

External code
-------------
Expand Down
3 changes: 2 additions & 1 deletion package/MDAnalysis/coordinates/PDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ class PDBReader(base.ReaderBase):
47 - 54 Real(8.3) z Orthogonal coordinates for Z in Angstroms.
55 - 60 Real(6.2) occupancy Occupancy.
61 - 66 Real(6.2) tempFactor Temperature factor.
67 - 76 String segID (unofficial CHARMM extension ?)
67 - 72 - - (not in the official PDB format)
73 - 76 String segID (unofficial CHARMM extension ?)
77 - 78 LString(2) element Element symbol, right-justified.
79 - 80 LString(2) charge Charge on the atom.
============= ============ =========== =============================================
Expand Down
10 changes: 7 additions & 3 deletions package/MDAnalysis/topology/PDBParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
-------
MDAnalysis Topology object
"""
top = self._parseatoms()
top = self._parseatoms(**kwargs)

try:
bonds = self._parsebonds(top.ids.values)
Expand All @@ -229,7 +229,7 @@

return top

def _parseatoms(self):
def _parseatoms(self, **kwargs):
"""Create the initial Topology object"""
resid_prev = 0 # resid looping hack

Expand Down Expand Up @@ -302,7 +302,7 @@
occupancies.append(float_or_default(line[54:60], 0.0))
tempfactors.append(float_or_default(line[60:66], 1.0)) # AKA bfactor

segids.append(line[66:76].strip())
segids.append(line[72:76].strip())

# Warn about wrapped serials
if self._wrapped_serials:
Expand All @@ -313,6 +313,10 @@
if not any(segids):
segids = chainids

# If force_chainids_to_segids is set, use chainids as segids
if "force_chainids_to_segids" in kwargs.keys() and kwargs["force_chainids_to_segids"]:
segids = chainids

Check warning on line 318 in package/MDAnalysis/topology/PDBParser.py

View check run for this annotation

Codecov / codecov/patch

package/MDAnalysis/topology/PDBParser.py#L318

Added line #L318 was not covered by tests
Comment thread
yuyuan871111 marked this conversation as resolved.

n_atoms = len(serials)

attrs = []
Expand Down
Loading