code: def group_batches_joint(samples):
      
      def _caller_batches(data):
          jointcaller = tz.get_in(("config", "algorithm", "jointcaller"), data)
          batch = tz.get_in(("metadata", "batch"), data) if jointcaller else None
          return jointcaller, batch
      def _prep_data(data, items):
          for r in ["callable_regions", "variant_regions"]:
              data[r] = list(set(filter(lambda x: x is not None,
                                        [tz.get_in(("config", "algorithm", r), d) for d in items])))
          data["work_bams"] = [dd.get_align_bam(x) or dd.get_work_bam(x) for x in items]
          data["vrn_files"] = [x["vrn_file"] for x in items]
          return data
      return _group_batches_shared(samples, _caller_batches, _prep_data)
docs: Perform grouping by batches for joint calling/squaring off.