index_tabular: Tabix-index file: table

View source: R/index_tabular.R

index_tabularR Documentation

Tabix-index file: table

Description

Convert summary stats file to tabix format.

Usage

index_tabular(
  path,
  chrom_col = "CHR",
  start_col = "BP",
  end_col = start_col,
  overwrite = TRUE,
  remove_tmp = TRUE,
  verbose = TRUE
)

Arguments

path

Path to GWAS summary statistics file.

chrom_col

Name of the chromosome column in sumstats_dt (e.g. "CHR").

start_col

Name of the starting genomic position column in sumstats_dt (e.g. "POS","start").

end_col

Name of the ending genomic position column in sumstats_dt (e.g. "POS","end"). Can be the same as start_col when sumstats_dt only contains SNPs that span 1 base pair (bp) each.

overwrite

A logical(1) indicating whether dest should be over-written, if it already exists.

remove_tmp

Remove the temporary uncompressed version of the file (.tsv).

verbose

Print messages.

Value

Path to tabix-indexed tabular file

Source

Borrowed function from echotabix.

See Also

Other tabix: index_vcf()

Examples

sumstats_dt <- MungeSumstats::formatted_example() 
path <- tempfile(fileext = ".tsv")
MungeSumstats::write_sumstats(sumstats_dt = sumstats_dt, save_path = path)
indexed_file <- MungeSumstats::index_tabular(path = path)

neurogenomics/MungeSumstats documentation built on July 17, 2024, 3:14 p.m.