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
,fragment
or a singleAtom
. Refer to the MDAnalysis’ user guide for an explanation of these terms. Note that in any case, onlyAtoms
belonging to the originalAtomGroup
are taken into account, even if the compound might comprise additionalAtoms
that 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()
, wherem
is the number of referenceAtoms
andn
is the number of selectionAtoms
.natms_per_refcmp (
int
orarray_like
, optional) – Number ofAtoms
per 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 referenceAtoms
for each single reference compound. In this case,numpy.sum(natms_per_refcmp)
must be equal tocm.shape[0]
.natms_per_selcmp (
int
orarray_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 referenceAtom
and 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
Atom
contact matrix and sum the contacts of allAtoms
belonging to the same compound.