Learn R Programming

LEA (version 1.4.0)

lfmm2geno: Convert from lfmm to geno format

Description

A function that converts from the lfmm format to the geno format.

Usage

lfmm2geno(input.file, output.file = NULL, force = TRUE)

Arguments

input.file
A character string containing a path to the input file, a genotypic matrix in the lfmm format.
output.file
A character string containing a path to the output file, a genotypic matrix in the geno format. By default, the name of the output file is the same name of the input file with a .geno extension.
force
A boolean option. If FALSE, the input file is converted only if the output file does not exist. If TRUE, convert the file anyway.

Value

output.file
A character string containing a path to the output file, a genotypic matrix in the geno format.

See Also

lfmm.data geno ancestrymap2lfmm ancestrymap2geno geno2lfmm ped2lfmm ped2geno vcf2geno

Examples

Run this code
# Creation of a file called "genotypes.lfmm" in the working directory,
# with 400 SNPs for 50 individuals.
data("tutorial")
write.lfmm(tutorial.R, "genotypes.lfmm")

# Conversion    from the lfmm format ("genotypes.lfmm") 
#               to the geno format ("genotypes.geno").
# By default,   the name of the output file is the same name 
#               as the input file with a .geno extension.
# Create file:  "genotypes.geno".
output = lfmm2geno("genotypes.lfmm")

# Conversion    from the lfmm format ("genotypes.lfmm") 
#               to the geno format with the output file called "plop.geno".
# Create file:  "plop.geno".
output = lfmm2geno("genotypes.lfmm", "plop.geno")

# As force = false and the file "genotypes.geno" already exists,
# nothing happens.
output = lfmm2geno("genotypes.lfmm", force = FALSE)

Run the code above in your browser using DataLab