interactionFilter.py
A filter to specify criteria for molecular interactions between a query and a target within a macromolecular structure. The filter specifies criteria for the query (e.g. a metal ion) and the target (e.g. amino acid redisudes). Interaction criteria such as distance cutoff limit the nature of interactions to be considered.
InteractionFilter(distanceCutoff=1.7976931348623157e+308, normalizedbFactorCutoff=1.7976931348623157e+308, minInteractions=1, maxInteractions=10)[source]¶Bases: object
A filter to specify criteria for molecular interactions between a query and a target
Attributes
| distanceCutoff | (float) cutoff distance for filter [default: float max] |
| normalizedbFactorCutoff | (float) normalized bFactor cutoff for filter [default: float max] |
| minInteractions | (int) minimum number of interactions [default: 1] |
| maxInteractions | (int) maximum number of interactions [default: 10] |
Methods
get_distance_cutoff() |
Get the maximum interaction distance. |
get_max_interactions() |
Returns the maximum number of interactions per atom. |
get_min_interactions() |
Returns the minimum number of interactions per atom. |
get_normalized_b_factor_cutoff() |
Gets the maximum normalized b-factor (z-score) cutoff for an atom and its interacting neighbor atoms. |
is_prohibited_target_group(group) |
Returns True if the specified group must not occur in an interactions. |
is_query_atom_name(atomName) |
Returns True if the specified atom matches the query conditions. |
is_query_element(element) |
Returns True if the specified elements matches the query conditions. |
is_query_group(group) |
Returns True if the specified group matches the query conditions. |
is_target_atom_name(atomName) |
Returns True if the specified atom matches the target conditions. |
is_target_element(element) |
Returns True if the specified elements matches the target conditions. |
is_target_group(group) |
Returns True if the specified group matches the target conditions. |
set_distance_cutoff(distanceCutoff) |
Set the distnace cutoff for interacting atoms |
set_max_interactions(maxInteractions) |
Sets the maximum number of interactions per atom. |
set_min_interactions(minInteractions) |
Sets the minimum number of interactions per atom. |
set_normalized_b_factor_cutoff(…) |
Sets the maximum noramlized b-factor cutoff. |
set_prohibited_target_groups(groups) |
Sets groups that must not appear in interactions. |
set_query_atom_names(include, atomNames) |
Set atom names to either be included or excluded in the query |
set_query_elements(include, elements) |
Sets the elements to either be included or excluded in the query. |
set_query_groups(include, groups) |
Sets groups to either be included or excluded in the query. |
set_target_atom_names(include, atomNames) |
Set atom names to either be included or excluded in the target. |
set_target_elements(include, elements) |
Sets the elements to either be included or excluded in the target. |
set_target_groups(include, groups) |
Sets groups to either be included or excluded in the target. |
get_distance_cutoff()[source]¶Get the maximum interaction distance. At least one pair of query and target atoms must be wintin in distance cutoff
| Returns: | int
|
|---|
get_max_interactions()[source]¶Returns the maximum number of interactions per atom. Atoms that interact with fewer atoms wil be discarded.
| Returns: | int
|
|---|
get_min_interactions()[source]¶Returns the minimum number of interactions per atom. Atoms that interact with fewer atoms wil be discarded.
| Returns: | int
|
|---|
get_normalized_b_factor_cutoff()[source]¶Gets the maximum normalized b-factor (z-score) cutoff for an atom and its interacting neighbor atoms.
| Returns: | float
|
|---|
is_prohibited_target_group(group)[source]¶Returns True if the specified group must not occur in an interactions.
| Parameters: | group : str
|
|---|---|
| Returns: | bool
|
is_query_atom_name(atomName)[source]¶Returns True if the specified atom matches the query conditions.
| Parameters: | atomName : str
|
|---|---|
| Returns: | bool
|
is_query_element(element)[source]¶Returns True if the specified elements matches the query conditions.
| Parameters: | element: str
Returns ——- bool
|
|---|
is_query_group(group)[source]¶Returns True if the specified group matches the query conditions.
| Parameters: | group : str
|
|---|---|
| Returns: | bool
|
is_target_atom_name(atomName)[source]¶Returns True if the specified atom matches the target conditions.
| Parameters: | atomName : str
|
|---|---|
| Returns: | bool
|
is_target_element(element)[source]¶Returns True if the specified elements matches the target conditions.
| Parameters: | element : str
|
|---|---|
| Returns: | bool
|
is_target_group(group)[source]¶Returns True if the specified group matches the target conditions.
| Parameters: | group : str
|
|---|---|
| Returns: | bool
|
set_distance_cutoff(distanceCutoff)[source]¶Set the distnace cutoff for interacting atoms
| Parameters: | distanceCutoff : float
|
|---|
set_max_interactions(maxInteractions)[source]¶Sets the maximum number of interactions per atom. Atoms that interact with fewer atoms will be discarded
| Parameters: | maxInteractions : int
|
|---|
set_min_interactions(minInteractions)[source]¶Sets the minimum number of interactions per atom. Atoms that interact with fewer atoms will be discarded
| Parameters: | minInteractions : int
|
|---|
set_normalized_b_factor_cutoff(normalizedbFactorCutoff)[source]¶Sets the maximum noramlized b-factor cutoff. This value represents a z-score (see reference below), the signed number of standard deviations by which the b-factor. High z-scores indicate either high flexibility and/or experimental error for the atoms involved in the interactions. By setting a cutoff value, not well defined interactions can be exculded.
Frequently used z-scores:
For example, to include all interactions within the 90% confidence interval, set the normalized b-factor to +1.645
| Parameters: | normalizedbFactorCutoff : float
|
|---|
References
set_prohibited_target_groups(groups)[source]¶Sets groups that must not appear in interactions. Any interactions that involves the specified groups will be excluded from the results.
| Parameters: | groups : list
|
|---|
Examples
Find Zinc interactions, but discard any interactions where the metal is involved in an interaction with water.
>>> filter = InteractionFilter()
>>> filter.set_query_groups(True, 'ZN')
>>> filter.set_prohibited_target_groups(["HOH"])
set_query_atom_names(include, atomNames)[source]¶Set atom names to either be included or excluded in the query
| Parameters: | include : bool
atom_names : list
|
|---|
Examples
Find interaction with C-alpha and C-beta atoms.
>>> filter = InteractionFilter()
>>> filter.set_query_atom_names(True, ['CA', 'CB'])
Exclude backbone atoms, but consider all other atom names: e.g, amino acid side chains.
>>> filter.set_query_atom_names(False, ['N', 'CA', 'C', 'O'])
set_query_elements(include, elements)[source]¶Sets the elements to either be included or excluded in the query. Element strings are case sensitive (e.g., “Zn” for Zinc).
| Parameters: | include : bool
elements : list
|
|---|
Examples
Only use elements O, N, S in the query groups in find polar interactions
>>> filter = InteractionFilter()
>>> filter.set_query_elements(True, ["O", "N", "S"])
Exclude non-polar elements and hydrogen in query groups and use all other elements to find interactions.
>>> elements = ['C', 'H', 'P']
>>> filter.set_query_elements(False, elements)
set_query_groups(include, groups)[source]¶Sets groups to either be included or excluded in the query. Group names must be upper case (e.g. ‘ZN’ for Zinc)
| Parameters: | include : bool
groups : list
|
|---|
Examples
Find interactions with ATP and ADP
>>> filter = InteractionFilter()
>>> filter.set_query_groups(True, ['ATP', 'ADP'])
Exclude water and heavy water and use all other groups to find interactions.
>>> groups = ["HOH", "DOD"]
>>> filter.set_query_groups(False, groups)
set_target_atom_names(include, atomNames)[source]¶Set atom names to either be included or excluded in the target.
| Parameters: | include : bool
atom_names : list
|
|---|
Examples
Find interaction with C-alpha and C-beta atoms.
>>> filter = InteractionFilter()
>>> filter.set_target_atom_names(True, ['CA', 'CB'])
Exclude backbone atoms, but consider all other atom names: e.g, amino acid side chains.
>>> filter.set_target_atom_names(False, ['N', 'CA', 'C', 'O'])
set_target_elements(include, elements)[source]¶Sets the elements to either be included or excluded in the target. Element strings are case sensitive (e.g., “Zn” for Zinc).
| Parameters: | include : bool
elements : list
|
|---|
Examples
Only use elements O, N, S in the target groups in find polar interactions
>>> filter = InteractionFilter()
>>> filter.set_target_elements(True, ["O", "N", "S"])
Exclude non-polar elements and hydrogen in target groups and use all other elements to find interactions.
>>> elements = ['C', 'H', 'P']
>>> filter.set_query_elements(False, elements)
set_target_groups(include, groups)[source]¶Sets groups to either be included or excluded in the target. Group names must be upper case (e.g. ‘ZN’ for Zinc)
| Parameters: | include : bool
groups : list
|
|---|
Examples
Find interactions with specific amino acid groups.
>>> filter = InteractionFilter()
>>> filter.set_target_groups(True, ['CYS','HIS','ASP','GLU'])
Exclude water and heavy water and use all other groups to find interactions.
>>> groups = ["HOH", "DOD"]
>>> filter.set_target_groups(False, groups)