clauswilke / PeptideBuilder

A simple Python library to generate model peptides
MIT License
79 stars 30 forks source link

Bio.PDB.Atom.coord is numpy array #6

Closed hongbo-zhu-cn closed 7 years ago

hongbo-zhu-cn commented 7 years ago

Hi, the coordinates for an atom in Bio.PDB.Atom is an instance of Numpy Array. Currently it is a mixture of vector and list. This may lead to unwanted behaviors when atom coordinates are concerned. best,

clauswilke commented 7 years ago

Thanks for this patch. Could you provide a minimal example showing how the current implementation causes unwanted behaviors? Maybe submitted separately as an issue?

clauswilke commented 7 years ago

I don't see why the change in line 98 is needed. The function calculateCoordinates does not create any coordinate vectors from scratch but rather obtains them from atoms or using the Vector constructor. Please check whether you can remove your change in line 98 and have things still work.

I agree the changes in lines 980 to 982 are needed.

hongbo-zhu-cn commented 7 years ago

Because function calculateCoordinates() returns D as an instance of Bio.PDB.Vector, which is not an array. This still causes the ValueError (I just double-checked). But now I change it to D.get_array() instead of using type conversion. This shall look neater.

clauswilke commented 7 years ago

Yes, I prefer this, thanks!