index: Tabix-index a file

View source: R/index.R

indexR Documentation

Tabix-index a file

Description

Tabix-index a tabular summary statistics file.

Usage

index(
  bgz_file,
  chrom_col,
  start_col,
  end_col = start_col,
  comment_char = NULL,
  force_new = TRUE,
  method = c("conda", "seqminer", "rsamtools", "variantannotation"),
  conda_env = "echoR_mini",
  verbose = TRUE
)

Arguments

bgz_file

Path to a file that has been compressed with bgzip (e.g. via run_bgzip).

chrom_col

Name of the chromosome column in the target_path file.

start_col

Name of the genomic start position column in the target_path file.

end_col

Name of the genomic end position column in the target_path file.

comment_char

Comment character denoting which row contains the column names (e.g. "#CHR" or "SNP").

force_new

Force the creation of a new bgzip file (.bgz) and a new tabix index file (.tbi).

method

Method to index tabix file with.

conda_env

Conda environments to search in. If NULL (default), will search all conda environments.

verbose

Print messages.

See Also

Other tabix functions: construct_tabix_path(), construct_vcf_path(), convert(), query_table(), query_vcf(), read_bgz(), run_bgzip()

Examples

dat <- echodata::BST1
tmp <- tempfile(fileext = ".tsv.gz")
data.table::fwrite(dat, tmp, sep="\t")
bgz_file <- echotabix::run_bgzip(target_path = tmp,
                                 chrom_col = "CHR",
                                 start_col = "POS")
tbi_file <- echotabix::index(bgz_file = bgz_file, 
                             chrom_col = "CHR", 
                             start_col = "POS")

RajLabMSSM/echotabix documentation built on Nov. 21, 2023, 8:02 a.m.