readVID | R Documentation |
Generate variant ID automatically, or based on a bim file.
readVID(bim, opt = NULL, vfr = NULL, vto = NULL)
bim |
prefix or name of a PLINK file, or data frame from a BIM file. |
opt |
option (def=1: the 2nd column in BIM file). |
vfr |
variant-wise, from where to read? (index/proportion, def=1). |
vto |
varinat-wise, to where then stop? (index/proportion, def=P). |
The option (opt
) can be:
1 = the 2nd column in pfx.bim (default),
2 = formated as %CHR(02d):%BPS(09d),
3 = formated as %CHR(02d):%BPS(09d)_AL1(s)_AL2(s)
0 = nothing
-1 = numbering of variants, decimal
-2 = numbering of variants, zero-padded, fixed length decimal
-3 = numbering of variants, zero-padded, fixed length hexedemical
or, a vector of IDs to use.
a vector of variant ID
# read variant ID
pfx <- file.path(system.file("extdata", package="plinkFile"), "m20")
# opt=1: 2nd column in the BED file (default)
vid <- readVID(pfx, 1); head(vid); tail(vid)
# opt=2: format by position
vid <- readVID(pfx, 2); head(vid); tail(vid)
# opt=3: format by position and alleles
vid <- readVID(pfx, 3); head(vid); tail(vid)
# opt=-1: number sequence
vid <- readVID(pfx, -1); head(vid); tail(vid)
# opt=-2: number sequence, fixed length, decimal
vid <- readVID(pfx, -2); head(vid); tail(vid)
# opt=-3: number sequence, fixed length, hexidemical
vid <- readVID(pfx, -3); head(vid); tail(vid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.