Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug reg long coordinates #90

Merged
merged 1 commit into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 <mail@sebastianraschka.com>"
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