Al-Murphy / MungeSumstats

Rapid standardisation and quality control of GWAS or QTL summary statistics
https://doi.org/doi:10.18129/B9.bioc.MungeSumstats
75 stars 16 forks source link

Standardise chromosome format #37

Closed bschilder closed 3 years ago

bschilder commented 3 years ago

There's two common formats for chromosome:

chr1 vs. 1

We need to standardise this.

bschilder commented 3 years ago

Fixed by adding the following to check_chr()

#### Remove chr prefix uppercase ####
    if(rmv_chrPrefix){
      message("Removing 'chr' prefix from CHR.")
      sumstats_dt[,CHR:=gsub("chr","",CHR,ignore.case = TRUE)]
    } 

Users can turn this off with the new rmv_chrPrefix argument in format_sumstats

bschilder commented 3 years ago

Also ensuring that input to rmv_chr is recognized regardless of the format users provide it in.

rmv_chr=c("X","Y","MT")

 ### Standardise chromosomes specified
 rmv_chr <- toupper(gsub("chr","",rmv_chr,ignore.case = TRUE))