frag_pele/Growing/add_fragment_from_pdbs.py
def compute_centroid(molecule):
    """
    Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the
    molecule.
    :param molecule: ProDy molecule object.
    :return: centroid of the molecule, tuple(X,Y,Z).
    """
    coords = molecule.getCoords()
    x = []
    y = []
    z = []
    for coord in coords:
        x.append(float(coord[0]))
        y.append(float(coord[1]))
        z.append(float(coord[2]))
    centroid = (np.mean(x),  np.mean(y), np.mean(z))
    return centroid

    Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the
    molecule.
    :param molecule: ProDy molecule object.
    :return: centroid of the molecule, tuple(X,Y,Z).
    
Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the
molecule.
Given a ProDy molecule the function extract the coordinates of their atoms and compute the centroid of the molecule .
def compute_centroid(molecule):
    coords = molecule.getCoords()
    x = []
    y = []
    z = []
    for coord in coords:
        x.append(float(coord[0]))
        y.append(float(coord[1]))
        z.append(float(coord[2]))
    centroid = (np.mean(x),  np.mean(y), np.mean(z))
    return centroid
def compute_centroid ( molecule ) : coords = molecule . getCoords ( ) x = [ ] y = [ ] z = [ ] for coord in coords : x . append ( float ( coord [ 0 ] ) ) y . append ( float ( coord [ 1 ] ) ) z . append ( float ( coord [ 2 ] ) ) centroid = ( np . mean ( x ) , np . mean ( y ) , np . mean ( z ) ) return centroid
Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the
molecule.
Given a ProDy molecule the function extract the coordinates of their atoms and compute the centroid of the molecule .
"""
    Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the
    molecule.
    :param molecule: ProDy molecule object.
    :return: centroid of the molecule, tuple(X,Y,Z).
    """
centroid of the molecule, tuple(X,Y,Z).
centroid of the molecule tuple ( X Y Z ) .
molecule
ProDy molecule object.
ProDy molecule object .