Skip to contents

This function calculates a genotypic frequency table for a specified HLA allele by census tracts within a given state, adjusted to the 2020 Census population data. It also provides a shapefile for visualization.

Usage

calculate_county_census_tract_allele_frequencies(
  state_abbreviation,
  query_allele
)

Arguments

state_abbreviation

A two-letter postal code representing the state.

query_allele

The HLA allele to be analyzed and plotted from NMDP data.

Value

A list containing:

us_population_race_code_percentages

A data frame with population percentages by race codes.

nmdp_freq_subset

A data frame with adjusted genotypic frequencies for the specified allele.

sf_data

Spatial data (shapefile) for the state's census tracts.

shapefile_path

The file path to the shapefile used.