synbreed (version 0.12-9)

read.vcf2list: Read data of a vcf-file to a matrix

Description

Function for easily read genomic data in vcf-Format to a list, which contains the map information and the marker information.

Usage

read.vcf2list(file, FORMAT = "GT", coding = c("allele", "ref"), IDinRow = TRUE, cores=1)

Arguments

file

character. The name of the file which the data are to be read from.

FORMAT

character. The default is "GT". If there are more formats in your vcf-file you can decide which one you like to have in your output matrix.

coding

This option has only an effect with FORMAT="GT". allele gives you back the alles as defined as REF and ALT in your vcf-file. ref gives you back "0" for the reference allele and "1" for the alternative allele.

IDinRow

logical. Default is TRUE, this means the genotypes are in the rows and the markers in the column. For FALSE it is the other way round.

cores

numeric. Specifies the number of cores for parallel computing.

Value

A list with a matrix (matrix) containing a representation of the genotypic data in the file and a map of classes GenMap and data.frame.

See Also

write.vcf, read.vcf2matrix

Examples

Run this code
# NOT RUN {
library(synbreedData)
data(maize)
maize$info$map.unit <- "kb"
maize <- codeGeno(maize)
write.vcf(maize, "maize.vcf")
genInfo <- read.vcf2list("maize.vcf")
# }

Run the code above in your browser using DataLab