importVCF: importVCF

View source: R/importVCF.R

importVCFR Documentation

importVCF

Description

Import a VCF function

Usage

importVCF(
  file,
  na.seq = "./.",
  simplify = TRUE,
  getInfo = TRUE,
  formatFields = NULL
)

Arguments

file

The file name

na.seq

The missing value definition

simplify

Logical

getInfo

Logical

formatFields

Vector with names

Details

This function imports a VCF file.

In case the logicl flag 'phased' is set to TRUE then the genotypes are expected to be in the format 0|0, otherwise they are expected to be like 0/1 . If the flag simplify is set genotypes like 0/2 or 1/2 will be set to 0,1,2 coding and multi-alternatives are ignored.

If you would like to extract in addition to the genotype information further any other data from th vcf file formatted in the FORMAT field, you can specify their names in the formatFields option. Currently, it only accepts a single value.

The example file was downloaded from here:

ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/pilot_data/release/2010_07/exon/snps/

Value

A vcf object

Author(s)

Daniel Fischer

Examples


 # Define here the location on HDD for the example file
   fpath <- system.file("extdata","example.vcf", package="GenomicTools.fileHandler")
 # Import the example vcf file  
   importVCF(fpath)


fischuu/GenomicTools.fileHandler documentation built on Feb. 15, 2025, 1:11 p.m.