class_docstr: High-level API for creating images of pileups of reads and reference bases.
  
  This class provides a higher-level and more natural API for constructing
  images at a candidate variant call site. Given a DeepVariantCall, which
  contains the candidate variant call along with key supplementary information,
  this class provides create_pileup_images() that will do all of the necessary
  fetching of reads and reference bases from readers and pass those off to the
  lower-level PileupImageEncoder to construct the image Tensor.
  
  for dv_call in candidates:
    allele_and_images = pic.create_pileup_images(dv_call)
    ...
  
  A quick note on how we deal with multiple alt alleles:
  
  Suppose variant has ref and two alt alleles. Assuming the sample is diploid,
  we have the following six possible genotypes:
  
    ref/ref   => 0/0
    ref/alt1  => 0/1
    alt1/alt1 => 1/1
    ref/alt2  => 0/2
    alt1/alt2 => 1/2
    alt2/alt2 => 2/2
  
  In DeepVariant we predict the genotype count (0, 1, 2) for a specific set of
  alternate alleles. If we only had a single alt, we'd construct an image for
  ref vs. alt1:
  
    image1 => ref vs. alt1 => determine if we are 0/0, 0/1, 1/1
  
  If we add a second image for alt2, we get:
  
    image2 => ref vs. alt2 => determine if we are 0/0, 0/2, 2/2
  
  but the problem here is that we don't have a good estimate for the het-alt
  state 1/2. So we construct a third image contrasting ref vs. either alt1 or
  alt2:
  
    image3 => ref vs. alt1 or alt2 => determines 0/0, 0/{1,2}, {1,2}/{1,2}
  
  Given the predictions for each image:
  
    image1 => p00, p01, p11
    image2 => p00, p02, p22
    image3 => p00, p0x, pxx where x is {1,2}
  
  we calculate our six genotype likelihoods as:
  
    0/0 => p00 [from any image]
    0/1 => p01 [image1]
    1/1 => p11 [image1]
    0/2 => p02 [image2]
    2/2 => p22 [image2]
    1/2 => pxx [image3]
  
  The function create_pileup_images() returns all of the necessary images, along
  with the alt alleles used for each image.
class_docstr_tok: ["High-level","API","for","creating","images","of","pileups","of","reads","and","reference","bases",".","This","class","provides","a","higher-level","and","more","natural","API","for","constructing","images","at","a","candidate","variant","call","site",".","Given","a","DeepVariantCall",",","which","contains","the","candidate","variant","call","along","with","key","supplementary","information",",","this","class","provides","create_pileup_images","(",")","that","will","do","all","of","the","necessary","fetching","of","reads","and","reference","bases","from","readers","and","pass","those","off","to","the","lower-level","PileupImageEncoder","to","construct","the","image","Tensor",".","for","dv_call","in","candidates",":","allele_and_images","=","pic.create_pileup_images","(","dv_call",")","...","A","quick","note","on","how","we","deal","with","multiple","alt","alleles",":","Suppose","variant","has","ref","and","two","alt","alleles",".","Assuming","the","sample","is","diploid",",","we","have","the","following","six","possible","genotypes",":","ref\/ref","=",">","0\/0","ref\/alt1","=",">","0\/1","alt1\/alt1","=",">","1\/1","ref\/alt2","=",">","0\/2","alt1\/alt2","=",">","1\/2","alt2\/alt2","=",">","2\/2","In","DeepVariant","we","predict","the","genotype","count","(","0",",","1",",","2",")","for","a","specific","set","of","alternate","alleles",".","If","we","only","had","a","single","alt",",","we","'d","construct","an","image","for","ref","vs.","alt1",":","image1","=",">","ref","vs.","alt1","=",">","determine","if","we","are","0\/0",",","0\/1",",","1\/1","If","we","add","a","second","image","for","alt2",",","we","get",":","image2","=",">","ref","vs.","alt2","=",">","determine","if","we","are","0\/0",",","0\/2",",","2\/2","but","the","problem","here","is","that","we","do","n't","have","a","good","estimate","for","the","het-alt","state","1\/2",".","So","we","construct","a","third","image","contrasting","ref","vs.","either","alt1","or","alt2",":","image3","=",">","ref","vs.","alt1","or","alt2","=",">","determines","0\/0",",","0\/","{","1,2","}",",","{","1,2","}","\/","{","1,2","}","Given","the","predictions","for","each","image",":","image1","=",">","p00",",","p01",",","p11","image2","=",">","p00",",","p02",",","p22","image3","=",">","p00",",","p0x",",","pxx","where","x","is","{","1,2","}","we","calculate","our","six","genotype","likelihoods","as",":","0\/0","=",">","p00","[","from","any","image","]","0\/1","=",">","p01","[","image1","]","1\/1","=",">","p11","[","image1","]","0\/2","=",">","p02","[","image2","]","2\/2","=",">","p22","[","image2","]","1\/2","=",">","pxx","[","image3","]","The","function","create_pileup_images","(",")","returns","all","of","the","necessary","images",",","along","with","the","alt","alleles","used","for","each","image","."]
docstr: Gets attributes from self._options as though they are our attributes.
docstr_tok: ["Gets","attributes","from","self._options","as","though","they","are","our","attributes","."]
code: def __getattr__(self, attr):
      """Gets attributes from self._options as though they are our attributes."""
      return self._options.__getattribute__(attr)
  
imports: import itertools
  from typing import Iterable, List, Optional, Tuple
  from absl import logging
  import numpy
  from deepvariant import dv_constants
  from deepvariant import sample
  from deepvariant.protos import deepvariant_pb2
  from deepvariant.python import pileup_image_native
  from third_party.nucleus.io import fasta
  from third_party.nucleus.io import sam
  from third_party.nucleus.protos import reads_pb2
  from third_party.nucleus.protos import variants_pb2
  from third_party.nucleus.util import ranges
label_desc: Use image node_id 2 for calling the PileupImageCreator obj's underlying member method code with example usage: obj.__getattr__(attr) and returns: self