pos2seq: Positions to sequencing calls

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/pos2seq.R

Description

Function to retrieve variants or sequence calls of interested positions from tabix indexed files.

Usage

1
pos2seq(Pos, Seqfile, file="", tabix="tabix", region = 5000)

Arguments

Pos

A two columns data.frame or matrix includes chromosome and position for each variant (or sequence) call.

Seqfile

A tabix indexed VCF file include all variant (or sequence) calls to retrieve.

file

File path to write out the retrieved results as a plain file in VCF format.

tabix

The path of tabix function. if NULL, scanTabix function from Rsamtools will be used instead.

region

The number of positions for tabix to retrieve at the same time. Too big number will not work for tabix. The default is 5000.

Details

pos2seq requires tabix function from SAMtools. The path of tabix could be specified in the optional argument of function if it is not in the PATH system environment. More details: http://samtools.sourceforge.net/tabix.shtml.

Value

A list includes header and VCF data. The results can also be outputted as a plain text file in VCF format.

Author(s)

Qiang Hu

See Also

LoadFiltering

Examples

1
2
3
4
5
6
7
#vcffile <- system.file("extdata", "1151HZ0001.flt.vcf", package="VPA")
#vcfdata <- read.vcf(vcffile)

##extract calls from tabix indexed data
#Pos <- cbind(vcfdata$CHROM, vcfdata$POS)
#gzfile <- system.file("extdata", "1151HZ0006.vcf.gz", package="VPA")
#calls <- pos2seq(Pos, gzfile)

VPA documentation built on May 2, 2019, 4:45 p.m.