Skip to content

Commit

Permalink
Merge pull request #90 from rasbt/long-coord
Browse files Browse the repository at this point in the history
fix bug reg long coordinates
  • Loading branch information
rasbt authored Sep 24, 2021
2 parents 5815592 + b08dfa8 commit 980d4f7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion biopandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
#

__version__ = '0.2.9'
__version__ = '0.3.0dev0'
__author__ = "Sebastian Raschka <[email protected]>"
7 changes: 7 additions & 0 deletions biopandas/pdb/pandas_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@ def to_pdb(self, path, records=None, gz=False, append_newline=True):
dfs[r]['OUT'] = pd.Series('', index=dfs[r].index)

for c in dfs[r].columns:
# fix issue where coordinates with four or more digits would
# cause issues because the columns become too wide
if c in {'x_coord', 'y_coord', 'z_coord'}:
for idx in range(dfs[r][c].values.shape[0]):
if len(dfs[r][c].values[idx]) > 8:
dfs[r][c].values[idx] = \
str(dfs[r][c].values[idx]).strip()
if c in {'line_idx', 'OUT'}:
pass
elif r in {'ATOM', 'HETATM'} and c not in pdb_df_columns:
Expand Down
18 changes: 18 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
The CHANGELOG for the current development version is available at
[https://github.com/rasbt/biopandas/blob/main/docs/sources/CHANGELOG.md](https://github.com/rasbt/biopandas/blob/main/docs/sources/CHANGELOG.md).

### 0.3.0dev0 (TBD)

##### Downloads

-

##### New Features

- -

##### Changes

-

##### Bug Fixes

- Fixes a bug where coordinates with more than 4 digits before the decimal point caused a column shift when saving a PDB file. (via PR [90](https://github.com/rasbt/biopandas/pull/90/files)


### 0.2.9 (08-30-2021)

Expand Down

0 comments on commit 980d4f7

Please sign in to comment.