View source: R/query_vcf_rtracklayer.R
query_vcf_rtracklayer | R Documentation |
Query a subset of a VCF file (remote or local)
using rtracklayer::import
, which is essentially just a wrapper for
scanTabix.
Advantages of rtracklayer:
None to speak of.
Disadvantages of rtracklayer:
Unable to query a subset of samples, unlike scanVcf.
Unable to return results as a structured CollapsedVCF object.
query_vcf_rtracklayer(
target_path,
target_index = paste0(target_path, ".tbi"),
query_granges,
samples = character(),
query_save = FALSE,
save_path = NULL,
verbose = TRUE
)
target_path |
Path to local VCF file or remote URL. |
target_index |
Tabix index file for |
query_granges |
GRanges object
to be used for querying the |
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. |
Raw text?
Inconsistencies with rtracklayer
BST1 <- echodata::BST1
query_dat <- 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.