class_docstr: Class for representing cohort-level genomic data.
  
  This class facilitates a sparse, split representation of genomic data in
  which reference block data and variant data are contained in separate
  :class:`.MatrixTable` objects.
  
  Parameters
  ----------
  reference_data : :class:`.MatrixTable`
      MatrixTable containing only reference block data.
  variant_data : :class:`.MatrixTable`
      MatrixTable containing only variant data.
class_docstr_tok: ["Class","for","representing","cohort-level","genomic","data",".","This","class","facilitates","a","sparse",",","split","representation","of","genomic","data","in","which","reference","block","data","and","variant","data","are","contained","in","separate",":","class",":","`",".MatrixTable","`","objects",".","Parameters","--","--","--","--","--","reference_data",":",":","class",":","`",".MatrixTable","`","MatrixTable","containing","only","reference","block","data",".","variant_data",":",":","class",":","`",".MatrixTable","`","MatrixTable","containing","only","variant","data","."]
docstr: Combine many VDSes with the same samples but disjoint variants.
  
  **Examples**
  
  If a dataset is imported as VDS in chromosome-chunks, the following will combine them into
  one VDS:
  
  >>> vds_paths = ['chr1.vds', 'chr2.vds']  # doctest: +SKIP
  ... vds_per_chrom = [hl.vds.read_vds(path) for path in vds_paths)  # doctest: +SKIP
  ... hl.vds.VariantDataset.union_rows(*vds_per_chrom)  # doctest: +SKIP
docstr_tok: ["Combine","many","VDSes","with","the","same","samples","but","disjoint","variants",".","*","*","Examples","*","*","If","a","dataset","is","imported","as","VDS","in","chromosome-chunks",",","the","following","will","combine","them","into","one","VDS",":",">",">",">","vds_paths","=","[","'chr1.vds","'",",","'chr2.vds","'","]","#","doctest",":","+SKIP","...","vds_per_chrom","=","[","hl.vds.read_vds","(","path",")","for","path","in","vds_paths",")","#","doctest",":","+SKIP","...","hl.vds.VariantDataset.union_rows","(","*","vds_per_chrom",")","#","doctest",":","+SKIP"]
code: def union_rows(*vdses):
      """Combine many VDSes with the same samples but disjoint variants.
  
      **Examples**
  
      If a dataset is imported as VDS in chromosome-chunks, the following will combine them into
      one VDS:
  
      >>> vds_paths = ['chr1.vds', 'chr2.vds']  # doctest: +SKIP
      ... vds_per_chrom = [hl.vds.read_vds(path) for path in vds_paths)  # doctest: +SKIP
      ... hl.vds.VariantDataset.union_rows(*vds_per_chrom)  # doctest: +SKIP
  
      """
  
      fd = hl.vds.VariantDataset.ref_block_max_length_field
      mts = [vds.reference_data for vds in vdses]
      n_with_ref_max_len = len([mt for mt in mts if fd in mt.globals])
      any_ref_max = n_with_ref_max_len > 0
      all_ref_max = n_with_ref_max_len == len(mts)
  
      # if some mts have max ref len but not all, drop it
      if all_ref_max:
          new_ref_mt = hl.MatrixTable.union_rows(*mts).annotate_globals(
              **{fd: hl.max([mt.index_globals()[fd] for mt in mts])}
          )
      else:
          if any_ref_max:
              mts = [
                  mt.drop(fd) if fd in mt.globals else mt for mt in mts
              ]
          new_ref_mt = hl.MatrixTable.union_rows(*mts)
  
      new_var_mt = hl.MatrixTable.union_rows(
          *(vds.variant_data for vds in vdses)
      )
      return hl.vds.VariantDataset(new_ref_mt, new_var_mt)
  
imports: import os
  import hail
  from hail.matrixtable import MatrixTable
  from hail.typecheck import typecheck_method
  from hail.utils.java import info, warning
  from hail.genetics import ReferenceGenome
  import json
label_desc: Use image node_id 11 for calling the VariantDataset obj's underlying member method code with example usage: obj.union_rows() and returns: hl