shnitsel.geo.analogs ==================== .. py:module:: shnitsel.geo.analogs Functions --------- .. autoapisummary:: shnitsel.geo.analogs._find_atom_pairs shnitsel.geo.analogs._substruct_match_to_submol shnitsel.geo.analogs.list_analogs shnitsel.geo.analogs._combine_compounds_unstacked shnitsel.geo.analogs._combine_compounds_stacked shnitsel.geo.analogs.combine_analogs Module Contents --------------- .. py:function:: _find_atom_pairs(mol, atoms) .. py:function:: _substruct_match_to_submol(mol, substruct_match) .. py:function:: list_analogs(ensembles, smarts = '', vis = False) Extract a common moiety from a selection of ensembles :param ensembles: An ``Iterable`` of ``xr.DataArray``s, each containing the geometries of an ensemble of trajectories for a different compound; they :param smarts: A SMARTS-string indicating the moiety to cut out of each compound; in each case, the match returned by :py:func:`rdkit.Chem.Mol.GetSubstrucMatch` (not necessarily the only possible match) will be used; if no SMARTS is provided, a minimal common submol will be extracted using ``rdFMCS.FindMCS`` :param optional: A SMARTS-string indicating the moiety to cut out of each compound; in each case, the match returned by :py:func:`rdkit.Chem.Mol.GetSubstrucMatch` (not necessarily the only possible match) will be used; if no SMARTS is provided, a minimal common submol will be extracted using ``rdFMCS.FindMCS`` :param vis: Whether to display a visual indication of the match :param optional: Whether to display a visual indication of the match :rtype: An ``Iterable`` of ``xr.DataArray``s .. py:function:: _combine_compounds_unstacked(compounds, names=None, concat_kws=None) .. py:function:: _combine_compounds_stacked(compounds, names=None, concat_kws=None) .. py:function:: combine_analogs(ensembles, smarts = '', names = None, vis = False, *, concat_kws = None) Combine ensembles for different compounds by finding the moieties they have in common :param ensembles: An ``Iterable`` of ``xr.DataArray``s, each containing the geometries of an ensemble of trajectories for a different compound; these trajectories should all be in the same format, i.e.: - all stacked (with 'frames' dimension indexed by'trajid' and 'time' MultiIndex levels) - all unstacked (with independent 'trajid' and 'time' dimensions) :param smarts: A SMARTS-string indicating the moiety to cut out of each compound; in each case, the match returned by :py:func:`rdkit.Chem.Mol.GetSubstrucMatch` (not necessarily the only possible match) will be used; if no SMARTS is provided, a minimal common submol will be extracted using ``rdFMCS.FindMCS`` :param names: An ``Iterable`` of ``Hashable`` to identify the compounds; these values will end up in the ``compound`` coordinate, by default None :param vis: Whether to display a visual indication of the match, by default False :param concat_kws: Keyword arguments for internal calls to ``xr.concat`` :returns: * *An xr.Dataset of trajectories, with a MultiIndex level identifying each* * *trajectory by its compound name (or index, if no names were provided)* * *and trajid* :raises ValueError: If the ensembles provided are in a mixture of formats (i.e. some have trajectories stacked, others unstacked)