docs: def build_variant(variant, case_obj, case_id=None, gq_treshold=None):
      """Return a Variant object
  
      Take a cyvcf2 formated variant line and return a models.Variant.
  
      If criterias are not fullfilled, eg. variant have no gt call or quality
      is below gq treshold then return None.
  
      Args:
          variant(cyvcf2.Variant)
          case_obj(Case): We need the case object to check individuals sex
          case_id(str): The case id
          gq_treshold(int): Genotype Quality treshold
      
      Return:
          formated_variant(models.Variant): A variant dictionary
      """
      variant_obj = None
  
      sv = False
      # Let cyvcf2 tell if it is a Structural Variant or not
      if variant.var_type == 'sv':
          sv = True
  
      # chrom_pos_ref_alt
      variant_id = get_variant_id(variant)
  
      ref = variant.REF
      # ALT is an array in cyvcf2
      # We allways assume splitted and normalized VCFs
      alt = variant.ALT[0]
  
      coordinates = get_coords(variant)
      chrom = coordinates['chrom']
      pos = coordinates['pos']
  
      # These are integers that will be used when uploading
      found_homozygote = 0
      found_hemizygote = 0
  
      # Only look at genotypes for the present individuals
      if sv:
          found_variant = True
      else:
          found_variant = False
          for ind_obj in case_obj['individuals']:
              ind_id = ind_obj['ind_id']
              # Get the index position for the individual in the VCF
              ind_pos = ind_obj['ind_index']
              gq = int(variant.gt_quals[ind_pos])
              if (gq_treshold and gq < gq_treshold):
                  continue
  
              genotype = GENOTYPE_MAP[variant.gt_types[ind_pos]]
  
              if genotype in ['het', 'hom_alt']:
                  LOG.debug("Found variant")
                  found_variant = True
  
                  # If variant in X or Y and individual is male,
                  # we need to check hemizygosity
                  if chrom in ['X','Y'] and ind_obj['sex'] == 1:
                      if not check_par(chrom, pos):
                          LOG.debug("Found hemizygous variant")
                          found_hemizygote = 1
  
                  if genotype == 'hom_alt':
                      LOG.debug("Found homozygote alternative variant")
                      found_homozygote = 1
  
      if found_variant:
          
          variant_obj = Variant(
              variant_id=variant_id,
              chrom=chrom,
              pos=pos,
              end=coordinates['end'],
              ref=ref,
              alt=alt,
              end_chrom=coordinates['end_chrom'],
              sv_type = coordinates['sv_type'],
              sv_len = coordinates['sv_length'],
              case_id = case_id,
              homozygote = found_homozygote,
              hemizygote = found_hemizygote,
              is_sv = sv,
              id_column = variant.ID,
          )
  
      return variant_obj