Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/read.write.vcf.r
Create vcf-file for miscellaneous applications. Within the package it is used to write files for beagle usage.
1 |
gp |
|
file |
|
unphased |
|
The function writes a vcf-file. The format of the output is "GT". Other formats are not supported.
No value is returned. Function creates files
[prefix]ingput.bgl
with genotypic data in Beagle input format and
[prefix]marker.txt
with marker information used by Beagle.
Hans-Juergen Auinger
read.vcf2matrix
, read.vcf2list
,
codeGeno
1 2 3 4 5 6 7 8 9 10 11 | map <- data.frame(chr = c(1, 1, 1, 1, 1, 2, 2, 2, 2), pos = 1:9)
geno <- matrix(sample(c(0, 1, 2, NA), size = 10 * 9, replace = TRUE), nrow = 10, ncol = 9)
colnames(geno) <- rownames(map) <- paste("SNP", 1:9, sep = "")
rownames(geno) <- paste("ID", 1:10 + 100, sep = "")
gp <- create.gpData(geno = geno, map = map)
gp1 <- discard.markers(gp, rownames(map[map$chr != 1, ]))
## Not run:
write.vcf(gp1, file = "test.vcf")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.