<jupyter_start><jupyter_text>Lab Notebook    Course: BioE 131    Lab No: Lab 7    Submission date:         Team members: <NAME>, <NAME>      Simulating the Data<jupyter_code>import numpy as np

def b_generator(s, p):
    data = np.random.choice( [0,1], size = s, replace = True, p = [p, 1.0-p])
    data = np.packbits(data)

    return data

def DNA_generator(s):
    data = np.random.choice( ['A', 'T', 'C', 'G'], size = s, replace = True, p = [ 1.0/4.0 for _ in range(4) ] )
    #data = np.packbits(data)
    
    return data
    
def Protein_generator(s):
    data = np.random.choice( list('ARNDCEQGHILKMFPSTWYV'), size = s, replace = True, p = [1.0/20.0 for _ in range(20)] )
    #data = np.packbits(data)

    return data
    
open('zeros_100p', 'wb').write( b_generator( 8* 100 * 2**20 , 1.0))
open('zeros_90p', 'wb').write( b_generator(8* 100 * 2**20, 0.9))
open('zeros_80p', 'wb').write( b_generator(8* 100 * 2**20, 0.8))
open('zeros_70p', 'wb').write( b_generator(8* 100 * 2**20, 0.7))
open('zeros_60p', 'wb').write( b_generator(8* 100 * 2**20, 0.6))
open('zeros_50p', 'wb').write( b_generator(8* 100 * 2**20, 0.5))

open('nt_seq.fa', 'w').write( ''.join(DNA_generator(10**6) ) ) 
open('aa_seq.fa', 'w').write( ''.join(Protein_generator(10**6)))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20482866043613707, 'fraction_numerical': 0.07242990654205607, 'mean_word_length': 3.867424242424242, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '143501', 'license': 'MIT', 'n_tokens_mistral': 588, 'n_tokens_neox': 525, 'n_words': 120, 'path': 'lab07/lab7_submission.ipynb', 'repo_name': 'Jinho-Ko/BE131_JK', 'size': '1297'}