def calc_stats(pav_df, samples):
  """
  Given the PAV df and a list
  of samples (column names),
  calculate pan genome stats
  """
  df = pav_df[samples]
  n_samples = len(samples)
  row_sums = df.sum(axis=1)
  tot_genes = (row_sums > 0).sum()
  core_genes = (row_sums == n_samples).sum()
  singletons = (row_sums == 1).sum()
  return tot_genes, core_genes, singletons