# Creation of a file called "example.vcf"
# with 4 SNPs for 3 individuals.
data("example_vcf")
write.table(example_vcf,"example.vcf",col.names =
c("#CHROM", "POS", "ID", "REF", "ALT", "QUAL", "FILTER", "INFO",
"FORMAT", "SAMPLE0", "SAMPLE1", "SAMPLE2"),
row.names = FALSE, quote = FALSE)
# Conversion from the vcf format ("example.vcf")
# to the lfmm format ("example.lfmm").
# By default, the name of the output file is the same name
# as the input file with a .lfmm extension.
# Create files: "example.lfmm",
# "example.vcfsnp" - SNP informations,
# "example.removed" - removed lines.
output = vcf2lfmm("example.vcf")
# Conversion from the vcf format ("example.vcf")
# to the lfmm format with the output file called "plop.lfmm".
# Create files: "plop.lfmm",
# "plop.vcfsnp" - SNP informations,
# "plop.removed" - removed lines.
output = vcf2lfmm("example.vcf", "plop.lfmm")
# As force = false and the file "example.lfmm" already exists,
# nothing happens.
output = vcf2lfmm("example.vcf", force = FALSE)
Run the code above in your browser using DataLab