text: user734: DeepVariant is a pipeline to call genetic variants from DNA sequencing data.
  A major step, before feeding the CNN, is to translate these DNA sequences into images. It's unclear why and how Google constructs the RGB images from the DNA data. Obviously, DNA is a string over an alphabet with the characters: {A, T, C, G}.
  It is even hard to understand how the mapping works based on the source code of their unit tests.
  In their figure from the paper: A is Red, C is Green, G is blue, and T is Yellow (G+R), but this is still unclear how they construct the 3xNxN image.
  
  
  EDIT from google's blog:
  
  In this article we will show the six channels in a row, but in
  DeepVariant they are encoded as six layers in the third dimension,
  giving each tensor a shape of (100, 221, 6) corresponding to (height,
  width, channels). The variant in question is always in the center of
  each pileup image, here marked with a small line at the top.
  Channels are shown in greyscale below in the following order:
  Read base: different intensities represent A, C, G, and T.
  Base quality: set by the sequencing machine. White is higher quality.
  Mapping quality: set by the aligner. White is higher quality.
  Strand of alignment: Black is forward; white is reverse.
  Read supports variant: White means the read supports the given
  alternate allele, grey means it does not.
  Base differs from ref: White means the base is different from the
  reference, dark grey means the base matches the reference.
  
  
  
  user174: Actually the paper has made it clear how they did it. You just have to read the supplementary materials closer.
  
  In their figure from the paper: A is Red, C is Green, G is blue, and T
  is Yellow (G+R), but this is still unclear how they the 3xNxN image.
  
  In RGB, each dimension is an NxN image. Since you have three dimensions, so it's 3xNxN. The red dimension was used to encode the nucleotide bases. The green dimension was used to encode quality scores. Finally, the blue dimension was used to encode the strand information.
  
  Obviously, DNA is a string over an alphabet with the characters: {A,
  T, C, G}.
  
  This is easy. Lot's of ways. You could do a one-hot encoding or what DeepVariant used:
  def get_base_color(base):
      base_to_color = {'A': 250, 'G': 180, 'T': 100, 'C': 30}
      return base_to_color.get(base, 0)
  
  
original_text: 734: <p><a href="https://github.com/google/deepvariant/" rel="nofollow noreferrer">DeepVariant</a> is a pipeline to call genetic variants from DNA sequencing data.</p>
  <p>A major step, before feeding the CNN, is to translate these DNA sequences into images. It's unclear why and how Google <a href="https://www.biorxiv.org/content/10.1101/092890v6" rel="nofollow noreferrer">constructs the RGB images</a> from the DNA data. Obviously, DNA is a string over an alphabet with the characters: {A, T, C, G}.</p>
  <p>It is even hard to understand how the <a href="http://ai.googleblog.com/2017/12/deepvariant-highly-accurate-genomes.html" rel="nofollow noreferrer">mapping</a> works based on the source code of their <a href="https://github.com/google/deepvariant/blob/r0.10/deepvariant/pileup_image_test.py" rel="nofollow noreferrer">unit tests</a>.</p>
  <p>In their figure from the paper: A is Red, C is Green, G is blue, and T is Yellow (G+R), but this is still unclear how they construct the <code>3xNxN</code> image.</p>
  <p><a href="https://i.stack.imgur.com/d9NPSm.pnge" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d9NPSm.pnge" alt="enter image description here" /></a></p>
  <hr />
  <p>EDIT from <a href="https://google.github.io/deepvariant/posts/2020-02-20-looking-through-deepvariants-eyes/" rel="nofollow noreferrer">google's blog</a>:</p>
  <blockquote>
  <p>In this article we will show the six channels in a row, but in
  DeepVariant they are encoded as six layers in the third dimension,
  giving each tensor a shape of (100, 221, 6) corresponding to (height,
  width, channels). The variant in question is always in the center of
  each pileup image, here marked with a small line at the top.</p>
  <p>Channels are shown in greyscale below in the following order:</p>
  <p>Read base: different intensities represent A, C, G, and T.</p>
  <p>Base quality: set by the sequencing machine. White is higher quality.</p>
  <p>Mapping quality: set by the aligner. White is higher quality.</p>
  <p>Strand of alignment: Black is forward; white is reverse.</p>
  <p>Read supports variant: White means the read supports the given
  alternate allele, grey means it does not.</p>
  <p>Base differs from ref: White means the base is different from the
  reference, dark grey means the base matches the reference.</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/MoGCs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MoGCs.png" alt="enter image description here" /></a></p>
   174: <p>Actually the paper has made it clear how they did it. You just have to read the supplementary materials closer.</p>
  <blockquote>
  <p>In their figure from the paper: A is Red, C is Green, G is blue, and T
  is Yellow (G+R), but this is still unclear how they the 3xNxN image.</p>
  </blockquote>
  <p>In RGB, each dimension is an NxN image. Since you have three dimensions, so it's 3xNxN. The red dimension was used to encode the nucleotide bases. The green dimension was used to encode quality scores. Finally, the blue dimension was used to encode the strand information.</p>
  <blockquote>
  <p>Obviously, DNA is a string over an alphabet with the characters: {A,
  T, C, G}.</p>
  </blockquote>
  <p>This is easy. Lot's of ways. You could do a one-hot encoding or what DeepVariant used:</p>
  <pre><code>def get_base_color(base):
      base_to_color = {'A': 250, 'G': 180, 'T': 100, 'C': 30}
      return base_to_color.get(base, 0)
  </code></pre>
  