A function to count alleles by sentinel_site

count_alleles_by_sentinel_site(
  long_acquired_gene_amr_data,
  gene_family_counts_by_sentinel_site,
  drug_subclasses = NULL
)

Arguments

long_acquired_gene_amr_data

The acquired AMR data as obtained by the pivot_metadata_to_long_amr function

drug_subclasses

The desired drug subclasses to count (specifying none will count all but this may not be desired)

gene_family_counts_by_country

Counts of each subclass by sentinel_site as obtained by the count_gene_families_by_sentinel_site function

Value

allele_counts_by_sentinel_site Counts of each allele per gene_family by sentinel_site

# A tibble: 6 x 6
Sentinel Site subclass gene_family allele count proportion
<chr> <chr> <chr> <chr> <int> <dbl>
1 UCH CARBAPENEM blaGES blaGES-2 1 1
2 UCH CARBAPENEM blaKPC blaKPC-2 142 0.432
3 UCH CARBAPENEM blaKPC blaKPC-3 187 0.568
4 UCH CARBAPENEM blaNDM blaNDM-1 79 0.952
5 UCH CARBAPENEM blaNDM blaNDM-18 1 0.0120
6 UCH CARBAPENEM blaNDM blaNDM-9 3 0.0361