query_vcf_seqminer: Query VCF: 'seqminer'

View source: R/query_vcf_seqminer.R

query_vcf_seqminerR Documentation

Query VCF: seqminer

Description

Query a subset of a VCF file (remote or local) using tabix.read.table. Advantages of seqminer:

  • Does not rely on Rsamtools or Rhtslib, which are very outdated and prone to breaking.

Disadvantages of rtracklayer:

  • Unable to query a subset of samples, unlike scanVcf.

  • Unable to return results as a structured CollapsedVCF object.

Usage

query_vcf_seqminer(
  target_path,
  target_genome = "GRCh37",
  query_granges,
  samples = character(),
  query_save = FALSE,
  save_path = NULL,
  verbose = TRUE
)

Arguments

target_path

Path to local VCF file or remote URL.

target_genome

Genome build of the VCF file.

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.

samples

[Optional] Sample names to subset the VCF by. If this option is used, the GRanges object will be converted to a ScanVcfParam for usage by readVcf.

query_save

Whether to save the results of the query on disk. Note: Writing to disk can take some time.

save_path

File path to save query subset to (as VCF).

verbose

Print messages.

Value

A variant x sample data.frame

Source

seqminer::readVCFToListByRange and seqminer::readVCFToMatrixByRange do not work and instead cause Rstudio to crash.

query_dat <- echodata::BST1[seq(1, 50), ] target_path <- paste( "ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/release/20110521/", "ALL.chr4.phase1_release_v3.20101123.snps_indels_svs.genotypes.vcf.gz", sep="/" ) vcf <- echotabix:::query_vcf_rtracklayer( target_path = target_path, query_granges = query_dat)


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