<jupyter_start><jupyter_text>Defining simulation parameters<jupyter_code># -------defining parameters----------
#  -- basic loop extrusion parameters
SEPARATION = 400
LIFETIME = 200
N1 = 4000   # number of monomers
M = 10 
N = N1 * M 
smcStepsPerBlock = 1  # now doing 1 SMC step per block 

trajectoryLength=100000


birthArray = np.zeros(N1, dtype=np.double) + 0.1
deathArray = np.zeros(N1, dtype=np.double) + 1. / LIFETIME
stallDeathArray = np.zeros(N1, dtype=np.double) + 1 / LIFETIME
pauseArray = np.zeros(N1, dtype=np.double)

stallList = [500, 1500, 2500, 3500]
stallLeftArray = np.zeros(N1, dtype = np.double)
stallRightARray = np.zeros(N1, dtype = np.double)
for i in stallList:
    stallLeftArray[i] = 0.8
    stallRightARray[i] = 0.8

LEFNum = N // SEPARATION
LEFTran = LEFTranslocatorDirectional(
    np.tile(birthArray,M), 
    np.tile(deathArray,M),
    np.tile(stallLeftArray,M),
    np.tile(stallRightARray,M),
    np.tile(pauseArray,M),
    np.tile(stallDeathArray,M),
    LEFNum)
folder = "trajectory"
if not os.path.exists(folder):
    os.mkdir(folder)
    
with h5py.File("trajectory/LEFPositions.h5", mode='w') as myfile:

    dset = myfile.create_dataset("positions", 
                                 shape=(trajectoryLength, LEFNum, 2), 
                                 dtype=np.int32, 
                                 compression="gzip")
    steps = 50 
    bins = np.linspace(0, trajectoryLength, steps, dtype=int)
    for st,end in zip(bins[:-1], bins[1:]):
        cur = []
        for i in range(st, end):
            LEFTran.steps(1)
            LEFs = LEFTran.getLEFs()
            cur.append(np.array(LEFs).T)
        cur = np.array(cur)
        dset[st:end] = cur
    myfile.attrs["N"] = N
    myfile.attrs["LEFNum"] = LEFNum



with h5py.File("trajectory/LEFPositions.h5", mode='r') as myfile:

    dset = myfile["positions"][:]
dset
dset.shape<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13926701570680627, 'fraction_numerical': 0.033507853403141365, 'mean_word_length': 2.73972602739726, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '619447', 'license': 'MIT', 'n_tokens_mistral': 781, 'n_tokens_neox': 708, 'n_words': 140, 'path': 'examples/loopExtrusion/extrusion_1D_translocator.ipynb', 'repo_name': 'BoettigerLab/polychrom', 'size': '1910'}