cmp_contact_count_matrices
- contact_hist.cmp_contact_count_matrices(cm, natms_per_refcmp=1, natms_per_selcmp=1, dtype=int)[source]
Take a contact matrix and return all possible compound contact count matrices.
A compound is usually a chemically meaningfull subgroup of an
AtomGroup. This can e.g. be aSegment,Residue,fragmentor a singleAtom. Refer to the MDAnalysis’ user guide for an explanation of these terms. Note that in any case, onlyAtomsbelonging to the originalAtomGroupare taken into account, even if the compound might comprise additionalAtomsthat are not contained in the originalAtomGroup.- Parameters:
cm (
array_like) – (Boolean) contact matrix of shape(m, n)as e.g. generated bymdtools.structure.contact_matrix(), wheremis the number of referenceAtomsandnis the number of selectionAtoms.natms_per_refcmp (
intorarray_like, optional) – Number ofAtomsper reference compound. Can be a single integer or an array of integers. If natms_per_refcmp is a single integer, all reference compounds are assumed to contain the same number ofAtoms. In this case, natms_per_refcmp must be an integer divisor ofcm.shape[0]. If natms_per_refcmp is an array of integers, it must contain the number of referenceAtomsfor each single reference compound. In this case,numpy.sum(natms_per_refcmp)must be equal tocm.shape[0].natms_per_selcmp (
intorarray_like, optional) – Same for selection compounds (natms_per_selcmp is checked againstcm.shape[1]).dtype (
dtype, optional) – Data type of the output arrays.
- Returns:
ccm_refatm_selcmp (
numpy.ndarray) – Contact count matrix indicating how many contacts exsit between a referenceAtomand a selection compound.ccm_refcmp_selatm (
numpy.ndarray) – Same for reference compounds and selectionAtoms.ccm_refcmp_selcmp (
numpy.ndarray) – Same for reference and selection compounds.
See also
mdtools.structure.cmp_contact_count_matrix()Take an
Atomcontact matrix and sum the contacts of allAtomsbelonging to the same compound.