-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix output paths in map_snps_to_genes for Windows
- Loading branch information
Showing
27 changed files
with
268 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
check_genomeLocFile <- function(genome_build, | ||
path_formatted){ | ||
if (toupper(genome_build) %in% c("GRCH36")) { | ||
genomeLocFile <- get_genomeLocFile(build = "GRCH36") | ||
} else if (toupper(genome_build) %in% c("GRCH37","HG37","HG19")) { | ||
genomeLocFile <- get_genomeLocFile(build = "GRCH37") | ||
} else if (toupper(genome_build) %in% c("GRCH38","HG38")) { | ||
genomeLocFile <- get_genomeLocFile(build = "GRCH38") | ||
} else { | ||
stop("Genome build must be: 'GRCH36', `GRCH37', or 'GRCH38'") | ||
} | ||
return(genomeLocFile) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
check_n <- function(path_formatted, | ||
N){ | ||
|
||
if (is.null(N) | is.na(N)) { | ||
first_line <- readLines(path_formatted, n = 1) | ||
column_headers <- strsplit(first_line, "\t")[[1]] | ||
if ("N" %in% column_headers) { | ||
n_arg <- "ncol=N" | ||
} else { | ||
nval <- as.numeric( | ||
readline(paste( | ||
"There is no N column within the sumstats file.", | ||
"What is the N value for this GWAS?" | ||
)) | ||
) | ||
|
||
if (is.na(nval)) { | ||
stop(paste( | ||
nval, "provided but value of N for", | ||
"the GWAS must be numeric" | ||
)) | ||
} | ||
if (nval < 1000) { | ||
stop(paste( | ||
"Value of N provided is less than 1,000.", | ||
"This seems unlikely." | ||
)) | ||
} | ||
if (nval > 100000000) { | ||
stop(paste( | ||
"Value of N provided is over than 100,000,000.", | ||
"This seems unlikely." | ||
)) | ||
} | ||
n_arg <- sprintf("N=%s", nval) | ||
} | ||
} else { | ||
n_arg <- sprintf("N=%s", N) | ||
} | ||
return(n_arg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.