construct_vcf_path: VCF path

View source: R/construct_vcf_path.R

construct_vcf_pathR Documentation

VCF path

Description

Construct the save_path to VCF subset extracted by query_vcf.

Usage

construct_vcf_path(
  target_path,
  query_granges = NULL,
  locus_dir = tempdir(),
  subdir = "VCF",
  use_coord_prefix = TRUE,
  whole_vcf = FALSE
)

Arguments

target_path

Path to local VCF file or remote URL.

query_granges

GRanges object to be used for querying the target_path file. Alternatively, can be variant-level summary statistics to be converted into a GRanges object by construct_query.

locus_dir

Locus-specific folder.

subdir

Subdirectory to store VCF in.

use_coord_prefix

Add min/max genomic coordinates (e.g. "chr4-14737349-16737284") to the file name.

whole_vcf

Whether to download the entire VCF (not just a subset).

See Also

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

Examples

target_path <- system.file("extdata", "BST1.1KGphase3.vcf.bgz",
                           package = "echodata")
locus_dir <- file.path(tempdir(), echodata::locus_dir)
query_granges <- echotabix::construct_query(query_dat=echodata::BST1)

save_path <- echotabix::construct_vcf_path(query_granges = query_granges,
                                           locus_dir = locus_dir,
                                           target_path = target_path)

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