def score_snapshot(snapshot, substructures, atom='CA', min_seq_separation=8):
    '\n    Assigns a set of scores for a snapshot\n    the ith score tells you what is the average distnace between pairs of residues residues that participate in the ith substructure, in this snapshto\n    If the score is close to the characteristic contact distnace, then the substructure should be mostly formed\n    '
    (coords, resis) = read_PDB(snapshot, atom)
    distances = compute_contacts_matrix(coords, mode='distances', min_seq_separation=min_seq_separation)
    length = np.shape(distances)[0]
    len_substructures = np.shape(substructures)[0]
    if (length > len_substructures):
        distances = distances[0:len_substructures, 0:len_substructures]
    nsubstructures = np.shape(substructures)[2]
    scores = np.zeros(nsubstructures)
    for s in range(nsubstructures):
        sub = substructures[:, :, s]
        participation = np.multiply(distances, sub)
        scores[s] = np.mean(participation[np.nonzero(participation)])
    return (scores, distances)
Assigns a set of scores for a snapshot
the ith score tells you what is the average distnace between pairs of residues residues that participate in the ith substructure, in this snapshto
If the score is close to the characteristic contact distnace, then the substructure should be mostly formed
def score_snapshot(snapshot, substructures, atom='CA', min_seq_separation=8):
    '\n    Assigns a set of scores for a snapshot\n    the ith score tells you what is the average distnace between pairs of residues residues that participate in the ith substructure, in this snapshto\n    If the score is close to the characteristic contact distnace, then the substructure should be mostly formed\n    '
    (coords, resis) = read_PDB(snapshot, atom)
    distances = compute_contacts_matrix(coords, mode='distances', min_seq_separation=min_seq_separation)
    length = np.shape(distances)[0]
    len_substructures = np.shape(substructures)[0]
    if (length > len_substructures):
        distances = distances[0:len_substructures, 0:len_substructures]
    nsubstructures = np.shape(substructures)[2]
    scores = np.zeros(nsubstructures)
    for s in range(nsubstructures):
        sub = substructures[:, :, s]
        participation = np.multiply(distances, sub)
        scores[s] = np.mean(participation[np.nonzero(participation)])
    return (scores, distances)