addID {vcfR} | R Documentation |
Populate the ID column of VCF data
Description
Populate the ID column of VCF data by concatenating the chromosome, position and optionally an index.
Usage
addID(x, sep = "_")
Arguments
x |
an object of class vcfR or chromR. |
sep |
a character string to separate the terms. |
Details
Variant callers typically leave the ID column empty in VCF data. However, the VCF data may potentially include variants with IDs as well as variants without. This function populates the missing elements by concatenating the chromosome and position. When this concatenation results in non-unique names, an index is added to force uniqueness.
Examples
data(vcfR_test)
head(vcfR_test)
vcfR_test <- addID(vcfR_test)
head(vcfR_test)
[Package vcfR version 1.15.0 Index]