code: def split_variants_by_sample(data):
      
      # not split, do nothing
      if "group_orig" not in data:
          return [[data]]
      # cancer tumor/normal
      elif (vcfutils.get_paired_phenotype(data)
              and "tumor" in [vcfutils.get_paired_phenotype(d) for d in get_orig_items(data)]):
          out = []
          for i, sub_data in enumerate(get_orig_items(data)):
              if vcfutils.get_paired_phenotype(sub_data) == "tumor":
                  cur_batch = tz.get_in(["metadata", "batch"], data)
                  if cur_batch:
                      sub_data["metadata"]["batch"] = cur_batch
                  sub_data["vrn_file"] = data["vrn_file"]
              else:
                  sub_data.pop("vrn_file", None)
              out.append([sub_data])
          return out
      # joint calling or population runs, do not split back up and keep in batches
      else:
          out = []
          for sub_data in get_orig_items(data):
              cur_batch = tz.get_in(["metadata", "batch"], data)
              if cur_batch:
                  sub_data["metadata"]["batch"] = cur_batch
              sub_data["vrn_file_batch"] = data["vrn_file"]
              sub_data["vrn_file"] = data["vrn_file"]
              out.append([sub_data])
          return out
docs: Split a multi-sample call file into inputs for individual samples.
  
      For tumor/normal paired analyses, do not split the final file and attach
      it to the tumor input.