vcfR2geno | R Documentation |
Convert VCF object/file to genotypic matrix
The object returned by vcfR2geno can be used as input in the LEA function snmf Optionally supply a character string with path where geno object will be saved This function is used in the function run_sNMFR
vcfR2geno(vcf, out = NULL)
vcf |
Character string with path to input VCF file. |
out |
Character string with path where output geno file should be saved. Default is NULL. |
Matrix with genotypes in geno format
library(misc.wrappers)
## Example 1:
# Path to VCF with SNPs
vcf.path <- file.path(system.file("extdata", package = "misc.wrappers"),"simK4.vcf.gz")
run_sNMF(x=vcf.path,format="VCF",kmax=10,reps=30,save.as="sNMF_simK4.pdf")
## Example 2: Same SNP dataset as example 1, but here we also provide Lon/Lat coordinates of individuals to geographically interpolate admixture coefficients.
vcf.path <- file.path(system.file("extdata", package = "misc.wrappers"),"simK4.vcf.gz")
coords.path <- file.path(system.file("extdata", package = "misc.wrappers"),"simK4_coords.txt")
run_sNMF(x=vcf.path,format="VCF",coords=coords.path,samplenames=NULL,kmax=10,reps=30,entropy=TRUE,project="new",iter=500,save.as="sNMF_simK4_withCoords.pdf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.