ensemble_hic/analysis_functions.py
def load_sr_samples(samples_folder, replica_id, n_samples,
                    dump_interval, burnin, interval=1):
    """Loads results for a single replica resulting from a Replica Exchange
    simulation.

    :param samples_folder: directory in which samples are stored
    :type samples_folder: str ending with a slash ("/")

    :param replica_id: number of replica of interest, 1-based indexing
    :type replica_id: int

    :param n_samples: number of samples
    :type n_samples: int

    :param dump_interval: number of MCMC steps after which samples are written
    :type dump_interval: int

    :param burnin: number of MCMC samples discarded as burnin
    :type burnin: int (multiple of dump_interval)

    :param interval: return only every interval-th sample
    :type interval: int

    :returns: an array of MCMC samples
    :rtype: :class:`numpy.ndarray`
    """

    samples = []
    for j in xrange((burnin / dump_interval) * dump_interval,
                    n_samples - dump_interval, dump_interval):
        path = samples_folder + 'samples_replica{}_{}-{}.pickle'
        samples += np.load(path.format(replica_id, j, j+dump_interval), allow_pickle=True)

    start = burnin * (burnin < dump_interval) + (burnin > dump_interval) * (burnin % dump_interval)
    
    return np.array(samples[start::interval])
Loads results for a single replica resulting from a Replica Exchange
    simulation.

    :param samples_folder: directory in which samples are stored
    :type samples_folder: str ending with a slash ("/")

    :param replica_id: number of replica of interest, 1-based indexing
    :type replica_id: int

    :param n_samples: number of samples
    :type n_samples: int

    :param dump_interval: number of MCMC steps after which samples are written
    :type dump_interval: int

    :param burnin: number of MCMC samples discarded as burnin
    :type burnin: int (multiple of dump_interval)

    :param interval: return only every interval-th sample
    :type interval: int

    :returns: an array of MCMC samples
    :rtype: :class:`numpy.ndarray`
    
Loads results for a single replica resulting from a Replica Exchange
simulation.
Loads results for a single replica resulting from a Replica Exchange simulation .
def load_sr_samples(samples_folder, replica_id, n_samples,
                    dump_interval, burnin, interval=1):
    samples = []
    for j in xrange((burnin / dump_interval) * dump_interval,
                    n_samples - dump_interval, dump_interval):
        path = samples_folder + 'samples_replica{}_{}-{}.pickle'
        samples += np.load(path.format(replica_id, j, j+dump_interval), allow_pickle=True)
    start = burnin * (burnin < dump_interval) + (burnin > dump_interval) * (burnin % dump_interval)
    return np.array(samples[start::interval])
def load_sr_samples ( samples_folder , replica_id , n_samples , dump_interval , burnin , interval = 1 ) : samples = [ ] for j in xrange ( ( burnin / dump_interval ) * dump_interval , n_samples - dump_interval , dump_interval ) : path = samples_folder + 'samples_replica{}_{}-{}.pickle' samples += np . load ( path . format ( replica_id , j , j + dump_interval ) , allow_pickle = True ) start = burnin * ( burnin < dump_interval ) + ( burnin > dump_interval ) * ( burnin % dump_interval ) return np . array ( samples [ start : : interval ] )
Loads results for a single replica resulting from a Replica Exchange
simulation.
Loads results for a single replica resulting from a Replica Exchange simulation .
"""Loads results for a single replica resulting from a Replica Exchange
    simulation.

    :param samples_folder: directory in which samples are stored
    :type samples_folder: str ending with a slash ("/")

    :param replica_id: number of replica of interest, 1-based indexing
    :type replica_id: int

    :param n_samples: number of samples
    :type n_samples: int

    :param dump_interval: number of MCMC steps after which samples are written
    :type dump_interval: int

    :param burnin: number of MCMC samples discarded as burnin
    :type burnin: int (multiple of dump_interval)

    :param interval: return only every interval-th sample
    :type interval: int

    :returns: an array of MCMC samples
    :rtype: :class:`numpy.ndarray`
    """
an array of MCMC samples
an array of MCMC samples
:class:`numpy.ndarray`
samples_folder
directory in which samples are stored
directory in which samples are stored
replica_id
number of replica of interest, 1-based indexing
number of replica of interest 1 - based indexing
n_samples
number of samples
number of samples
dump_interval
number of MCMC steps after which samples are written
number of MCMC steps after which samples are written
burnin
number of MCMC samples discarded as burnin
number of MCMC samples discarded as burnin
interval
return only every interval-th sample
return only every interval - th sample