biopandas icon indicating copy to clipboard operation
biopandas copied to clipboard

Fetching PDB and saving it to a PDB file shifts one space element type due to b-factor 3 digits

Open zehraacarsarica opened this issue 2 years ago • 0 comments

Describe the bug

The problem is that after fetching PDB and saving it to a file, it shifts one space due to the b-factor value due to 3 digits. If the saved PDB file is read it again via biopandas, some element type value is empty.

Steps/Code to Reproduce


from biopandas.pdb import PandasPdb

ppdb = PandasPdb().fetch_pdb("2e28")

ppdb.to_pdb(path="2e28.pdb",
            records=None,
            gz=False,
            append_newline=True)

ppdb.read_pdb("2e28.pdb")
print(ppdb.df['ATOM'][138:150])

Expected Results

I would expect to save the PDB file correctly without shifting one space for the element type. Also, the blank_4 column should be white space not includes numbers (see the last figure).

Actual Results

image

image

image

Versions

biopandas 0.4.1 Windows-10-10.0.22000-SP0 Python 3.10.12] Scikit-learn 1.3.0 NumPy 1.25.1 SciPy 1.11.1

zehraacarsarica avatar Jul 15 '23 21:07 zehraacarsarica