indexVcf {VariantAnnotation} | R Documentation

## Create Index files for VCF file

### Description

Create Index file for VCF if it does not exist

### Usage

    ## S4 method for signature 'character'
    indexVcf(x, ...)
    ## S4 method for signature 'VcfFile'
    indexVcf(x, ...)
    ## S4 method for signature 'VcfFileList'
    indexVcf(x, ...)

### Arguments

`x` | Either character(), `VcfFile`, or `VcfFileList`
`...` | Additional arguments to `indexTabix`

### Details

If a character vector is given, assumes they are the path(s) to the VCF file. If the index file for that VCF file does not exist, one is created. A `VcfFile` or `VcfFileList` is returned.

If a `VcfFile` or `VcfFileList` is given, the index file is checked, if it does not exist it will crete one. If the index file was NA or missing, the path of the associated VCF file is used as the index file path. An updated `VcfFile` or `VcfFileList` is returned.

### Value

VcfFile or VcfFileList

### Author(s)

Lori Shepherd

### See Also

`VcfFile`

### Examples

    fl <- system.file("extdata", "chr7-sub.vcf.gz", package="VariantAnnotation",
                      mustWork=TRUE)
    vcf1 <- indexVcf(fl)
    vcf1

[Package VariantAnnotation version 1.26.1 Index]