vcf_selectsamples: Set or query the active sample selection for a given VCF file...

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

View source: R/samples.R

Description

Set (vcf_selectsamples) or query (vcf_getselectedsamples) which individuals are included in the returned results, or get a list of selectable individuals.

Usage

1
2
3
vcf_selectsamples( vcffh, sampleslist )
vcf_getselectedsamples( vcffh )
vcf_getsamples( vcffh )

Arguments

vcffh

VCFhandle type as returned by vcf_open

sampleslist

A vector containing the identifiers of the individuals

Details

When reading variants from VCF files, it is possible to restrict the returned results to a certain subset of the available individuals (samples), e.g. members of a population or people with a certain trait. With vcf_selectsamples the currently selected subset of individuals can be set for a given VCF file. vcf_getselectedsamples returns the list of currently selected individuals and vcf_getsamples returns a list of all available identifiers in the file.

As with most other VCF functions, it is possible to call directly into the library to avoid some overhead. Use .Call("VCF_getSampleNames", vcffh ) , .Call("VCF_getSelectedSamples", vcffh ) or .Call("VCF_selectSamples", vcffh, sampleslist ), respectively. Note the different names!

Value

A vector of strings representing the sample names selected or present in the VCF file.

Author(s)

Ulrich Wittelsbuerger

See Also

vcf_open

Examples

1
2
3
4
5
6
	##
	##	Example:
	##
	vcffile <- vcf_open( system.file( "extdata" , "ex.vcf.gz" , package="WhopGenome" ) )
	allsamplenames <- vcf_getsamples( vcffile )
	vcf_selectsamples( vcffile , allsamplenames )

WhopGenome documentation built on May 1, 2019, 10:12 p.m.