code: def add_case(self, case_obj, vtype='snv', mode='vcf', ped_svg=None):
          
          new_case = Case(case_id=case_obj.case_id,
                          name=case_obj.name,
                          variant_source=case_obj.variant_source,
                          variant_type=vtype,
                          variant_mode=mode,
                          pedigree=ped_svg,
                          compressed=case_obj.compressed,
                          tabix_index=case_obj.tabix_index)
  
          # build individuals
          inds = [Individual(
              ind_id=ind.ind_id,
              name=ind.name,
              mother=ind.mother,
              father=ind.father,
              sex=ind.sex,
              phenotype=ind.phenotype,
              ind_index=ind.ind_index,
              variant_source=ind.variant_source,
              bam_path=ind.bam_path,
          ) for ind in case_obj.individuals]
          new_case.individuals = inds
          
          if self.case(new_case.case_id):
              logger.warning("Case already exists in database!")
          else:
              self.session.add(new_case)
              self.save()
          return new_case
docs: Load a case with individuals.
  
          Args:
              case_obj (puzzle.models.Case): initialized case model