Exemplo n.º 1
0
def main():
    print('generate message')
    msg_in = '01101100'
    print('encode message')
    msg_encoded = something_code_4B.encode(msg_in)
    print('convert to dna')
    dna_encoded = one_bit_3B.bin2dna(msg_encoded)
    print('seperate dna')
    dna_seperate = pre_print.pre_print(dna_encoded, a)
    print('synthesize dna')
    dna_mol_syn = printer_5.printer_dna(dna_seperate, a, b, c, d)
    print('store dna')
    dna_mol_stor = storage_6.store_dna(dna_mol_syn, e, f, b)
    print('sequence dna')
    reads = NGS_7A.dna_sequencer(dna_mol_stor, b, g, h, a)
    print('infer dna sequence')
    msg_read = two_bits_3.dna2bin(reads[0])  # here is the "מצקת"
    print('convert to binary')
    msg_decoded = repeatition_code_2A.decode(msg_read)
    mistakes_presentage = mistakes.mistake_presentage(msg_in, msg_decoded)
    with open(
            'C:\\Users\\user\\Desktop\\zohar\\Alpha\\Study\\DNA-Storage-alpha\\experiments\\results.txt',
            'w') as f:
        f.write(
            f"input: {msg_in}   output: {msg_decoded}    mistakes_presentage: {mistakes_presentage} % /n"
        )
    print('done:')
Exemplo n.º 2
0
def main(a,b,c,d,g,h,k,j,r):
    start = time.time()
    msg_in = input.create_input(j)
    msg_encoded = hamming_code_2B.encode(msg_in)
    dna_encoded = two_bits_3.bin2dna(msg_encoded[0])
    dna_seperate = pre_print.pre_print(dna_encoded[0], k)
    dna_mol_syn = printer_5.printer_dna(dna_seperate, a, b, c, d)
    reads = NGS_7A.dna_sequencer(dna_mol_syn, b, g, h, a, k)
    reads_one_str = NGS_7A.api_sequencer(reads, dna_seperate[1], dna_seperate[2],a, dna_seperate[3])
    msg_read = two_bits_3.dna2bin(reads_one_str, dna_encoded[1]) # here is the "מצקת"
    msg_decoded = hamming_code_2B.decode(msg_read, msg_encoded[1])
    mistakes_presentage = mistakes.mistake_presentage(msg_in, msg_decoded)
    num_of_oligos_generaly = len(dna_seperate[0]) * a
    num_of_nukleotides_generaly = num_of_oligos_generaly * dna_seperate[1]
    end = time.time()
    time_it_takes = end - start
    return [mistakes_presentage, time_it_takes, len(dna_encoded[0]), len(dna_seperate[0]), dna_seperate[1], num_of_oligos_generaly, num_of_nukleotides_generaly]
Exemplo n.º 3
0
def main(a, b, c, d, g, h, k, j, r):
    msg_in = input.create_input(j)
    dna = one_bit_3B.bin2dna(msg_in)
    dna_encoded = repeatition_code_4A.encode(dna, r)
    dna_seperate = pre_print.pre_print(dna_encoded, k)
    dna_mol_syn = printer_5.printer_dna(dna_seperate, a, b, c, d)
    reads = NGS_7A.dna_sequencer(dna_mol_syn, b, g, h, a, k)
    reads_one_str = NGS_7A.api_sequencer(reads, dna_seperate[1],
                                         dna_seperate[2], a, dna_seperate[3])
    msg_decoded = repeatition_code_4A.decode(reads_one_str, r)
    msg_read = one_bit_3B.dna2bin(msg_decoded)
    mistakes_presentage = mistakes.mistake_presentage(msg_in, msg_read)
    num_of_oligos_generaly = len(dna_seperate[0]) * a
    num_of_nukleotides_generaly = num_of_oligos_generaly * dna_seperate[1]
    end = time.time()
    time_it_takes = end - start
    return [
        mistakes_presentage, time_it_takes,
        len(dna_encoded),
        len(dna_seperate[0]), dna_seperate[1], num_of_oligos_generaly,
        num_of_nukleotides_generaly
    ]