Skip to contents

Helper function for dealing with chromosome prefixes based on the selected projection.

Usage

purify_chr(projection = NULL, incoming_table = NULL)

Arguments

projection

Required parameter, needed to determine if chromosomes should be prefixed or not.

incoming_table

Required parameter, a data frame to check for prefixes.

Value

A data frame with the same columns as the incoming data frame, but with the prefixes added or removed based on the selected projection.

Details

This function accepts a data frame with a column to check for prefixes. The function will add or remove prefixes based on the selected projection. This function expects a column named "chrom" to be in the incoming data frame.

Examples

#Example 1 - Add prefixes to a data frame
my_data = data.frame(chrom = c("1", "2", "3"))

purify_chr(projection = "hg38", 
           incoming_table = my_data)
#>   chrom
#> 1  chr1
#> 2  chr2
#> 3  chr3