ensemble_hic/setup_functions.py
def make_backbone_prior(bead_radii, backbone_prior_params, n_beads,
                        n_structures):
    """
    Makes the default backbone prior object.

    :param bead_radii: list of bead radii
    :type bead_radii: :class:`numpy.ndarray`

    :param backbone_prior_params: settings for the backbone prior as
                                  specified in a config file
    :type backbone_prior_params: dict

    :param n_beads: number of beads in a single structure
    :type n_beads: int

    :param n_structures: number of ensemble members
    :type n_structures: int

    :returns: the backbone prior object with parameters set as given
              in the settings
    :rtype: :class:`.BackbonePrior`
    """
    from .backbone_prior import BackbonePrior

    if 'mol_ranges' in backbone_prior_params:
        mol_ranges = backbone_prior_params['mol_ranges']
    else:
        mol_ranges = None

    if mol_ranges is None:
        mol_ranges = np.array([0, n_beads])
    else:
        mol_ranges = np.loadtxt(mol_ranges).astype(int)
    bb_ll = [np.zeros(mol_ranges[i+1] - mol_ranges[i] - 1)
             for i in range(len(mol_ranges) - 1)]
    bb_ul = [np.array([bead_radii[j] + bead_radii[j+1]
              for j in range(mol_ranges[i], mol_ranges[i+1] - 1)])
             for i in range(len(mol_ranges) - 1)]  
    BBP = BackbonePrior('backbone_prior',
                        lower_limits=bb_ll, upper_limits=bb_ul,
                        k_bb=float(backbone_prior_params['force_constant']),
                        n_structures=n_structures,
                        mol_ranges=mol_ranges
                        )

    return BBP

    Makes the default backbone prior object.

    :param bead_radii: list of bead radii
    :type bead_radii: :class:`numpy.ndarray`

    :param backbone_prior_params: settings for the backbone prior as
                                  specified in a config file
    :type backbone_prior_params: dict

    :param n_beads: number of beads in a single structure
    :type n_beads: int

    :param n_structures: number of ensemble members
    :type n_structures: int

    :returns: the backbone prior object with parameters set as given
              in the settings
    :rtype: :class:`.BackbonePrior`
    
Makes the default backbone prior object.
Makes the default backbone prior object .
def make_backbone_prior(bead_radii, backbone_prior_params, n_beads,
                        n_structures):
    from .backbone_prior import BackbonePrior
    if 'mol_ranges' in backbone_prior_params:
        mol_ranges = backbone_prior_params['mol_ranges']
    else:
        mol_ranges = None
    if mol_ranges is None:
        mol_ranges = np.array([0, n_beads])
    else:
        mol_ranges = np.loadtxt(mol_ranges).astype(int)
    bb_ll = [np.zeros(mol_ranges[i+1] - mol_ranges[i] - 1)
             for i in range(len(mol_ranges) - 1)]
    bb_ul = [np.array([bead_radii[j] + bead_radii[j+1]
              for j in range(mol_ranges[i], mol_ranges[i+1] - 1)])
             for i in range(len(mol_ranges) - 1)]  
    BBP = BackbonePrior('backbone_prior',
                        lower_limits=bb_ll, upper_limits=bb_ul,
                        k_bb=float(backbone_prior_params['force_constant']),
                        n_structures=n_structures,
                        mol_ranges=mol_ranges
                        )
    return BBP
def make_backbone_prior ( bead_radii , backbone_prior_params , n_beads , n_structures ) : from . backbone_prior import BackbonePrior if 'mol_ranges' in backbone_prior_params : mol_ranges = backbone_prior_params [ 'mol_ranges' ] else : mol_ranges = None if mol_ranges is None : mol_ranges = np . array ( [ 0 , n_beads ] ) else : mol_ranges = np . loadtxt ( mol_ranges ) . astype ( int ) bb_ll = [ np . zeros ( mol_ranges [ i + 1 ] - mol_ranges [ i ] - 1 ) for i in range ( len ( mol_ranges ) - 1 ) ] bb_ul = [ np . array ( [ bead_radii [ j ] + bead_radii [ j + 1 ] for j in range ( mol_ranges [ i ] , mol_ranges [ i + 1 ] - 1 ) ] ) for i in range ( len ( mol_ranges ) - 1 ) ] BBP = BackbonePrior ( 'backbone_prior' , lower_limits = bb_ll , upper_limits = bb_ul , k_bb = float ( backbone_prior_params [ 'force_constant' ] ) , n_structures = n_structures , mol_ranges = mol_ranges ) return BBP
Makes the default backbone prior object.
Makes the default backbone prior object .
"""
    Makes the default backbone prior object.

    :param bead_radii: list of bead radii
    :type bead_radii: :class:`numpy.ndarray`

    :param backbone_prior_params: settings for the backbone prior as
                                  specified in a config file
    :type backbone_prior_params: dict

    :param n_beads: number of beads in a single structure
    :type n_beads: int

    :param n_structures: number of ensemble members
    :type n_structures: int

    :returns: the backbone prior object with parameters set as given
              in the settings
    :rtype: :class:`.BackbonePrior`
    """
the backbone prior object with parameters set as given
in the settings
the backbone prior object with parameters set as given in the settings
:class:`.BackbonePrior`
bead_radii
list of bead radii
list of bead radii
backbone_prior_params
settings for the backbone prior as
specified in a config file
settings for the backbone prior as specified in a config file
n_beads
number of beads in a single structure
number of beads in a single structure
n_structures
number of ensemble members
number of ensemble members