Convert summary stats file to tabix format
index_vcf(path, verbose = TRUE)
Borrowed function from echotabix.
Path to VCF.
Print messages.
Path to tabix-indexed tabular file
Other tabix:
index_tabular()
eduAttainOkbayPth <- system.file("extdata", "eduAttainOkbay.txt",
package = "MungeSumstats")
sumstats_dt <- data.table::fread(eduAttainOkbayPth, nThread = 1)
sumstats_dt <-
MungeSumstats:::standardise_sumstats_column_headers_crossplatform(
sumstats_dt = sumstats_dt)$sumstats_dt
#> Standardising column headers.
#> First line of summary statistics file:
#> MarkerName CHR POS A1 A2 EAF Beta SE Pval
sumstats_dt <- MungeSumstats:::sort_coords(sumstats_dt = sumstats_dt)
#> Sorting coordinates.
path <- tempfile(fileext = ".tsv")
MungeSumstats::write_sumstats(sumstats_dt = sumstats_dt, save_path = path)
#> Writing in tabular format ==> /tmp/RtmpmswcRa/file148072343440.tsv
indexed_file <- MungeSumstats::index_tabular(path = path)
#> Converting full summary stats file to tabix format for fast querying...
#> Reading header.
#> Ensuring file is bgzipped.
#> Tabix-indexing file.
#> Removing temproary .tsv file.