aboutsummaryrefslogtreecommitdiff
path: root/_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-02-08 06:53:16 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-02-08 06:53:16 +0100
commit7db700a96cb36f233201ed88244f1a7dbfe7ebd9 (patch)
tree2b18b2d16c02de5633dc90f048fb670bba973aa4 /_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md
parent537ccd14634c1736c03d487388bd9d2278af4493 (diff)
downloadmitjafelicijan.com-7db700a96cb36f233201ed88244f1a7dbfe7ebd9.tar.gz
Tweaks
Diffstat (limited to '_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md')
-rw-r--r--_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md b/_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md
index 1de83af..6980ed1 100644
--- a/_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md
+++ b/_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md
@@ -111,6 +111,7 @@ Cytosine and thymine are pyrimidine bases, while adenine and guanine are purine
111bases. The sugar and the base together are called a nucleoside. 111bases. The sugar and the base together are called a nucleoside.
112 112
113![DNA](/assets/posts/dna-sequence/dna-basics.jpg){:loading="lazy"} 113![DNA](/assets/posts/dna-sequence/dna-basics.jpg){:loading="lazy"}
114
114*DNA (a) forms a double stranded helix, and (b) adenine pairs with thymine and 115*DNA (a) forms a double stranded helix, and (b) adenine pairs with thymine and
115cytosine pairs with guanine. (credit a: modification of work by Jerome Walker, 116cytosine pairs with guanine. (credit a: modification of work by Jerome Walker,
116Dennis Myts)* 117Dennis Myts)*
@@ -301,6 +302,7 @@ Then we encode FASTA file from previous operation to encode this data into PNG.
301After encoding into PNG format this file looks like this. 302After encoding into PNG format this file looks like this.
302 303
303![Encoded Quote in PNG format](/assets/posts/dna-sequence/quote.png){:loading="lazy"} 304![Encoded Quote in PNG format](/assets/posts/dna-sequence/quote.png){:loading="lazy"}
305
304The larger the input stream is the larger the PNG file would be. 306The larger the input stream is the larger the PNG file would be.
305 307
306Compiled basic Hello World C program with 308Compiled basic Hello World C program with
@@ -368,8 +370,8 @@ First we generate some binary sample data with dd.
368dd if=<(openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero) of=1KB.bin bs=1KB count=1 iflag=fullblock 370dd if=<(openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero) of=1KB.bin bs=1KB count=1 iflag=fullblock
369``` 371```
370 372
371
372![Sample binary file 1KB](/assets/posts/dna-sequence/sample-binary-file.png){:loading="lazy"} 373![Sample binary file 1KB](/assets/posts/dna-sequence/sample-binary-file.png){:loading="lazy"}
374
373Our freshly generated 1KB file looks something like this (its full of 375Our freshly generated 1KB file looks something like this (its full of
374garbage data as intended). 376garbage data as intended).
375 377
@@ -396,9 +398,11 @@ gzip -9 < 10MB.fa > 10MB.fa.gz
396``` 398```
397 399
398![Encode to FASTA](/assets/posts/dna-sequence/chart-speed.svg){:loading="lazy"} 400![Encode to FASTA](/assets/posts/dna-sequence/chart-speed.svg){:loading="lazy"}
401
399The speed increase that occurs when encoding to FASTA format. 402The speed increase that occurs when encoding to FASTA format.
400 403
401![File sizes](/assets/posts/dna-sequence/chart-size.svg){:loading="lazy"} 404![File sizes](/assets/posts/dna-sequence/chart-size.svg){:loading="lazy"}
405
402Size of the out file after encoding. 406Size of the out file after encoding.
403 407
404[Download CSV file with benchmarks](/assets/posts/dna-sequence/benchmarks.csv). 408[Download CSV file with benchmarks](/assets/posts/dna-sequence/benchmarks.csv).