clustering.py
def assignGroup(dists, ligandsim, t, t2, ligandt, explore, names):
    '''group targets that are less than t away from each other and what's in explore'''
    group = set(explore)
    while explore:
        frontier = set()
        for i in explore:
            for j in range(dists.shape[1]):
                if j not in group:
                    #add to the group if protein is close by threshold t (these are distances - default 0.5)
                    #also add if the ligands are more similar (not distance) than ligandt and 
                    #the protein is closer than t2 (default 0.8 - meaning more than 20% similar)
                    if dists[i][j] < t or (ligandsim[i][j] > ligandt and dists[i][j] < t2):
                        group.add(j)
                        frontier.add(j)                
                                        
        explore = frontier
    return group
group targets that are less than t away from each other and what's in explore
group targets that are less than t away from each other and what's in explore
group targets that are less than t away from each other and what ' s in explore
def assignGroup(dists, ligandsim, t, t2, ligandt, explore, names):
    group = set(explore)
    while explore:
        frontier = set()
        for i in explore:
            for j in range(dists.shape[1]):
                if j not in group:
                    if dists[i][j] < t or (ligandsim[i][j] > ligandt and dists[i][j] < t2):
                        group.add(j)
                        frontier.add(j)                
        explore = frontier
    return group
def assignGroup ( dists , ligandsim , t , t2 , ligandt , explore , names ) : group = set ( explore ) while explore : frontier = set ( ) for i in explore : for j in range ( dists . shape [ 1 ] ) : if j not in group : if dists [ i ] [ j ] < t or ( ligandsim [ i ] [ j ] > ligandt and dists [ i ] [ j ] < t2 ) : group . add ( j ) frontier . add ( j ) explore = frontier return group
group targets that are less than t away from each other and what's in explore
group targets that are less than t away from each other and what ' s in explore
'''group targets that are less than t away from each other and what's in explore''' #add to the group if protein is close by threshold t (these are distances - default 0.5) #also add if the ligands are more similar (not distance) than ligandt and  #the protein is closer than t2 (default 0.8 - meaning more than 20% similar)
dists
ligandsim
t
t2
ligandt
explore
names