Skip to content

Commit

Permalink
Risk allele mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Murphy committed Sep 16, 2024
1 parent 7c1d25c commit c8b154a
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: MungeSumstats
Type: Package
Title: Standardise summary statistics from GWAS
Version: 1.13.5
Version: 1.13.6
Authors@R:
c(person(given = "Alan",
family = "Murphy",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## CHANGES IN VERSION 1.13.6

### New features
* Mappings added to mapping file for risk and non risk allele.

## CHANGES IN VERSION 1.13.3

### Bug fix
Expand Down
30 changes: 25 additions & 5 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,31 @@
#' # Most the data in the below table comes from the LDSC github wiki
#' data("sumstatsColHeaders")
#' # Make additions to sumstatsColHeaders using github version of MungeSumstats-
#' # Shown is an example of adding new A1 and A2 naming
#' a1_name <- c("NON","RISK","ALLELE")
#' a2_name <- c("RISK","ALLELE")
#' all_delims <- c("_",".",""," ","-")
#' all_uncorr_a1 <- vector(mode="list",length = length(all_delims))
#' all_corr_a1 <- vector(mode="list",length = length(all_delims))
#' all_uncorr_a2 <- vector(mode="list",length = length(all_delims))
#' all_corr_a2 <- vector(mode="list",length = length(all_delims))
#' for(i in seq_along(all_delims)){
#' delim <- all_delims[i]
#' a1 <- unlist(paste(a1_name,collapse=delim))
#' a2 <- unlist(paste(a2_name,collapse=delim))
#' all_uncorr_a1[[i]] <- a1
#' all_uncorr_a2[[i]] <- a2
#' all_corr_a1[[i]] <- "A1"
#' all_corr_a2[[i]] <- "A2"
#' }
#' se_cols <- data.frame("Uncorrected"=c(unlist(all_uncorr_a1),unlist(all_uncorr_a2)),
#' "Corrected"=c(unlist(all_corr_a1),unlist(all_corr_a2)))
#' # Or another example .....
#' # shown is an example of adding columns for Standard Error (SE)
#' #se_cols <- data.frame("Uncorrected"=c("SE","se","STANDARD.ERROR",
#' # "STANDARD_ERROR","STANDARD-ERROR"),
#' # "Corrected"=rep("SE",5))
#' #sumstatsColHeaders <- rbind(sumstatsColHeaders,se_cols)
#' se_cols <- data.frame("Uncorrected"=c("SE","se","STANDARD.ERROR",
#' "STANDARD_ERROR","STANDARD-ERROR"),
#' "Corrected"=rep("SE",5))
#' sumstatsColHeaders <- rbind(sumstatsColHeaders,se_cols)
#' #Once additions are made, order & save the new mapping dataset
#' #now sort ordering -important for logic that
#' # uncorrected=corrected comes first
Expand All @@ -27,7 +47,7 @@
#' sumstatsColHeaders$ordering,decreasing = TRUE),]
#' rownames(sumstatsColHeaders)<-1:nrow(sumstatsColHeaders)
#' sumstatsColHeaders$ordering <- NULL
#' #manually move FRWQUENCY to above MAR - github issue 95
#' #manually move FREQUENCY to above MAR - github issue 95
#' frequency <- sumstatsColHeaders[sumstatsColHeaders$Uncorrected=="FREQUENCY",]
#' maf <- sumstatsColHeaders[sumstatsColHeaders$Uncorrected=="MAF",]
#' if(as.integer(rownames(frequency))>as.integer(rownames(maf))){
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
Binary file modified data/sumstatsColHeaders.rda
Binary file not shown.
30 changes: 25 additions & 5 deletions man/sumstatsColHeaders.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c8b154a

Please sign in to comment.