@@ -384,7 +384,7 @@ def _manage_timedep_ploting_and_saving_options(ctc_grp,
384
384
fname = _path .join (fn .output_dir , iname )
385
385
ifig .axes [0 ].set_title ("%s" % title ) # TODO consider firstname lastname
386
386
ifig .savefig (fname , bbox_inches = "tight" , dpi = fn .graphic_dpi )
387
- _plt .close (ifig )
387
+ # _plt.close(ifig)
388
388
print (fname )
389
389
390
390
# even if no figures were produced or saved, we can still save the trajs
@@ -1692,18 +1692,45 @@ def sites(site_inputs,
1692
1692
1693
1693
Parameters
1694
1694
----------
1695
- site_inputs : dict or list of dicts
1695
+ site_inputs : dict or path to file, or list thereof
1696
1696
Site(s) to compute. A site can be either
1697
1697
a path to a site file in json format or
1698
1698
directly a site dictionary. A site dictionary
1699
1699
is something like
1700
1700
1701
- >>> {"name":"site ",
1702
- >>> "pairs":{"AAresSeq":["GLU30-ARG40 ",
1703
- >>> "LYS31-W70 "]}}
1701
+ >>> {"name": "interesting contacts ",
1702
+ >>> "pairs": {"AAresSeq": ["L394-K270 ",
1703
+ >>> "D381-Q229 "]}}
1704
1704
1705
1705
Any site containing a residue that can't be
1706
1706
found in the topology will be discarded.
1707
+ The list in "pairs" can be specified as:
1708
+ * 'AAresSeq':
1709
+ >>> {"name": "interesting contacts",
1710
+ >>> "pairs": {"AAresSeq": ["L394-K270",
1711
+ >>> "D381-Q229"]}}
1712
+ The 'AAresSeq' definitions are transferable to
1713
+ another system where the same aminoacids are
1714
+ present, regardless of their actual zero-indexing.
1715
+ * 'residx':
1716
+ >>> {"name": "interesting contacts",
1717
+ >>> "pairs": {"residx":[[353,972],
1718
+ >>> [340,956]]}}
1719
+ The 'pairs' definitions are only transferable
1720
+ across systems as long both systems share the same
1721
+ zero-indexing scheme.
1722
+ * 'consensus'
1723
+ >>> {"name": "interesting contacts",
1724
+ >>> "pairs": {"consensus": ["G.H5.26-6.32x32",
1725
+ >>> "G.H5.13-5.68x68"]}}
1726
+ The 'consensus' definitions are transferable to
1727
+ another system, even if the selected aminoacids are
1728
+ different. Please note, in order
1729
+ to use 'consenus' definitions, you need
1730
+ to pass at least one (or more) of the `GPCR_UniProt`,
1731
+ `CGN_UniProt` or `KLIFS_string` arguments, else
1732
+ there is no way to know to which residues the labels
1733
+ belong to.
1707
1734
See :obj:`mdciao.sites` for more info on
1708
1735
the site format.
1709
1736
trajectories : str, :obj:`mdtraj.Trajectory` or lists thereof
@@ -1758,28 +1785,28 @@ def sites(site_inputs,
1758
1785
(allows for object re-use when in API mode)
1759
1786
See :obj:`mdciao.nomenclature` for more info and references.
1760
1787
KLIFS_string : str or :obj:`mdciao.nomenclature.LabelerKLIFS`, default is None
1761
- String for kinase KLIFS nomenclature. First, try to locate a local
1762
- file that directly has the `KLIFS_string` as a name. If that fails, then
1763
- combine the filename-format expected by :obj:`mdciao.nomenclature.LabelerKLIFS`
1764
- with `KLIFS_string` to construct a filename and check again.
1765
- If that doesn't work, then go online to contact the KLIFS database.
1766
-
1767
- For the online lookup in the KLIFS database, the string
1768
- has to be formatted "key:value", which ultimately leads to a given KLIFS entry.
1769
- Acceptable keys and values for `KLIFS_string` are:
1770
- * "UniProtAC", e.g. "UniProtAC:P31751"
1771
- * "kinase_ID", e.g. "kinase_ID:2"
1772
- * "structure_ID", e.g. "structure_ID:1904", e.g. "P31751",
1773
- Please check the documentation on :obj:`mdciao.nomenclature.LabelerKLIFS`
1774
- for a more elaborate explanation on when to pick one of these key:value
1775
- pairs.
1776
-
1777
- Finally, if `KLIFS_string` is an :obj:`mdciao.nomenclature.LabelerKLIFS`,
1778
- use this object directly (allows for object re-use when in API mode).
1779
- See :obj:`mdciao.nomenclature` for more info and references. Alos, please note
1780
- the difference between UniProt Accession Code
1781
- and UniProt entry name as explained
1782
- `here <https://www.uniprot.org/help/difference%5Faccession%5Fentryname>`_ .
1788
+ String for kinase KLIFS nomenclature. First, try to locate a local
1789
+ file that directly has the `KLIFS_string` as a name. If that fails, then
1790
+ combine the filename-format expected by :obj:`mdciao.nomenclature.LabelerKLIFS`
1791
+ with `KLIFS_string` to construct a filename and check again.
1792
+ If that doesn't work, then go online to contact the KLIFS database.
1793
+
1794
+ For the online lookup in the KLIFS database, the string
1795
+ has to be formatted "key:value", which ultimately leads to a given KLIFS entry.
1796
+ Acceptable keys and values for `KLIFS_string` are:
1797
+ * "UniProtAC", e.g. "UniProtAC:P31751"
1798
+ * "kinase_ID", e.g. "kinase_ID:2"
1799
+ * "structure_ID", e.g. "structure_ID:1904", e.g. "P31751",
1800
+ Please check the documentation on :obj:`mdciao.nomenclature.LabelerKLIFS`
1801
+ for a more elaborate explanation on when to pick one of these key:value
1802
+ pairs.
1803
+
1804
+ Finally, if `KLIFS_string` is an :obj:`mdciao.nomenclature.LabelerKLIFS`,
1805
+ use this object directly (allows for object re-use when in API mode).
1806
+ See :obj:`mdciao.nomenclature` for more info and references. Alos, please note
1807
+ the difference between UniProt Accession Code
1808
+ and UniProt entry name as explained
1809
+ `here <https://www.uniprot.org/help/difference%5Faccession%5Fentryname>`_ .
1783
1810
fragments : str, list, None, default is "lig_resSeq+"
1784
1811
Topology fragments. There exist several input modes:
1785
1812
@@ -1918,6 +1945,7 @@ def sites(site_inputs,
1918
1945
ctc_idxs_small , site_maps = _mdcsites .sites_to_res_pairs (sites , refgeom .top ,
1919
1946
fragments = fragments_as_residue_idxs ,
1920
1947
default_fragment_index = default_fragment_index ,
1948
+ consensus_maps = [consensus_maps if len (consensus_maps )> 0 else None ][0 ],
1921
1949
fragment_names = fragment_names )
1922
1950
if None in ctc_idxs_small :
1923
1951
print ("Some definitions of the 'site_inputs' contain one or more residues not found in the input topology." )
@@ -2186,7 +2214,7 @@ def _res_resolver(res_range, top, fragments, midstring=None, GPCR_UniProt=None,
2186
2214
2187
2215
res_idxs_list = _mdcu .residue_and_atom .rangeexpand_residues2residxs (res_range , fragments , top ,
2188
2216
pick_this_fragment_by_default = None ,
2189
- additional_resnaming_dicts = consensus_maps ,
2217
+ additional_resnaming_dicts = [ consensus_maps if len ( consensus_maps ) > 0 else None ][ 0 ] ,
2190
2218
** rangeexpand_residues2residxs_kwargs ,
2191
2219
)
2192
2220
0 commit comments