ensemble_hic/setup_functions.py
def make_priors(nonbonded_prior_params, backbone_prior_params,
                sphere_prior_params, n_beads, n_structures):
    """
    Sets up all structural prior distributions

    :param nonbonded_prior_params: settings for the non-bonded prior
                                   as specified in a config file
    :type nonbonded_prior_params: dict

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

    :param sphere_prior_params: settings for a possible sphere prior
                                as specified in a config file
    :type sphere_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: a dictionary with keys being the names of the
              structural prior distributions and values
              the prior objects themselves
    :rtype: dict of :class:`binf.pdf.priors.AbstractPrior`-derived
            objects
    """
    nb_params = nonbonded_prior_params
    
    try:
        bead_radius = float(nb_params['bead_radii'])
        bead_radii = np.ones(n_beads) * bead_radius
    except:
        bead_radii = np.loadtxt(nb_params['bead_radii'],
                                dtype=float)
        
    NBP = make_nonbonded_prior(nb_params, bead_radii, n_structures)
    BBP = make_backbone_prior(bead_radii, backbone_prior_params,
                              n_beads, n_structures)
    priors = {NBP.name: NBP, BBP.name: BBP}
    if sphere_prior_params['active'] == 'True':
        SP = make_sphere_prior(sphere_prior_params, bead_radii, n_structures)
        priors.update(**{SP.name: SP})

    return priors

    Sets up all structural prior distributions

    :param nonbonded_prior_params: settings for the non-bonded prior
                                   as specified in a config file
    :type nonbonded_prior_params: dict

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

    :param sphere_prior_params: settings for a possible sphere prior
                                as specified in a config file
    :type sphere_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: a dictionary with keys being the names of the
              structural prior distributions and values
              the prior objects themselves
    :rtype: dict of :class:`binf.pdf.priors.AbstractPrior`-derived
            objects
    
Sets up all structural prior distributions
Sets up all structural prior distributions
def make_priors(nonbonded_prior_params, backbone_prior_params,
                sphere_prior_params, n_beads, n_structures):
    nb_params = nonbonded_prior_params
    try:
        bead_radius = float(nb_params['bead_radii'])
        bead_radii = np.ones(n_beads) * bead_radius
    except:
        bead_radii = np.loadtxt(nb_params['bead_radii'],
                                dtype=float)
    NBP = make_nonbonded_prior(nb_params, bead_radii, n_structures)
    BBP = make_backbone_prior(bead_radii, backbone_prior_params,
                              n_beads, n_structures)
    priors = {NBP.name: NBP, BBP.name: BBP}
    if sphere_prior_params['active'] == 'True':
        SP = make_sphere_prior(sphere_prior_params, bead_radii, n_structures)
        priors.update(**{SP.name: SP})
    return priors
def make_priors ( nonbonded_prior_params , backbone_prior_params , sphere_prior_params , n_beads , n_structures ) : nb_params = nonbonded_prior_params try : bead_radius = float ( nb_params [ 'bead_radii' ] ) bead_radii = np . ones ( n_beads ) * bead_radius except : bead_radii = np . loadtxt ( nb_params [ 'bead_radii' ] , dtype = float ) NBP = make_nonbonded_prior ( nb_params , bead_radii , n_structures ) BBP = make_backbone_prior ( bead_radii , backbone_prior_params , n_beads , n_structures ) priors = { NBP . name : NBP , BBP . name : BBP } if sphere_prior_params [ 'active' ] == 'True' : SP = make_sphere_prior ( sphere_prior_params , bead_radii , n_structures ) priors . update ( ** { SP . name : SP } ) return priors
Sets up all structural prior distributions
Sets up all structural prior distributions
"""
    Sets up all structural prior distributions

    :param nonbonded_prior_params: settings for the non-bonded prior
                                   as specified in a config file
    :type nonbonded_prior_params: dict

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

    :param sphere_prior_params: settings for a possible sphere prior
                                as specified in a config file
    :type sphere_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: a dictionary with keys being the names of the
              structural prior distributions and values
              the prior objects themselves
    :rtype: dict of :class:`binf.pdf.priors.AbstractPrior`-derived
            objects
    """
a dictionary with keys being the names of the
structural prior distributions and values
the prior objects themselves
a dictionary with keys being the names of the structural prior distributions and values the prior objects themselves
dict of :class:`binf.pdf.priors.AbstractPrior`-derived
objects
nonbonded_prior_params
settings for the non-bonded prior
as specified in a config file
settings for the non - bonded prior as specified in a config file
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
sphere_prior_params
settings for a possible sphere prior
as specified in a config file
settings for a possible sphere 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