Module: contacts
A module to pick contacts from a contact map in different ways. It is important to note the difference between pickInLargestCluster
and fillInLargestCluster
.
Members
- BioHelpers_FABER.contacts.fillInLargestCluster(x: ndarray, N: int) list
Picks randomly contacts in the largest clusters of a contact map x. If the largest cluster is not big enough, the largest cluster will filled completely and the second (or third or fourth a.s.o.) largest cluster will contain the remaining contacts randomly.
- Parameters:
x (np.ndarray) – Contact map
N (int) – Number of contacts to pick
- Returns:
List of choosen contacts
- Return type:
list
- BioHelpers_FABER.contacts.pickBestGauss(x: ndarray, N: int, num_it: int, var: float) list
Picks the random distribution with the best Gauss Score
- Parameters:
x (np.ndarray) – Contact map
N (int) – Number of contacts to pick
num_it (int) – Number of iterations, to find the best Gauss map
var (float) – Variance of the Gaussian distributions
- Returns:
List of choosen contacts
- Return type:
list
- BioHelpers_FABER.contacts.pickBestGaussFalse(x: ndarray, N: int, lam: float, neigh: int, num_it: int, var: float) list
Picks the random distribution with the best Gauss Score
- Parameters:
x (np.ndarray) – Contact map
N (int) – Number of contacts to pick
lam (float) – Ratio of false positive \(\lambda\)
neigh (int) – Number of off-diagonals to delete
num_it (int) – Number of iterations, to find the best Gauss map
var (float) – Variance of the Gaussian distributions
- Returns:
List of choosen contacts
- Return type:
list
- BioHelpers_FABER.contacts.pickInLargestCluster(x: ndarray, N: int) list
Picks randomly contacts in the largest clusters of a contact map x. If the largest cluster is not big enough, the second largest cluster will be added to the largest cluster and so on. The contacts will be randomly picked from this set of possible contacts.
- Parameters:
x (np.ndarray) – Contact map
N (int) – Number of contacts to pick
- Returns:
List of choosen contacts
- Return type:
list
- BioHelpers_FABER.contacts.pickMaxDistance(x: ndarray, N: int) list
Picks a random seed and from that the contact farest apart and so on
- Parameters:
x (np.ndarray) – Contact map
N (int) – Number of contacts to pick
- Returns:
List of choosen contacts
- Return type:
list
- BioHelpers_FABER.contacts.pickRandom(x: ndarray, N: int) list
Picks N unique random contacts from a given contact matrix
- Parameters:
x (np.ndarray) – Contact map
N (int) – Number of contacts to pick
- Returns:
List of randomly picked contacts
- Return type:
list
- BioHelpers_FABER.contacts.pickRandomFalse(x: ndarray, N: int, lam: float, neigh: int) list
Picks \(N-\lambda N\) unique random contacts from a given native contact matrix, combined with \(\lambda N\) false positive contacts. \(\lambda N\) will be rounded to the nearest integer.
- Parameters:
x (np.ndarray) – Contact map
N (int) – Number of contacts to pick
lam (float) – Ratio of false positive \(\lambda\)
neigh (int) – Number of off-diagonals to delete
- Returns:
List of randomly picked contacts
- Return type:
list