A function that converts from the ancestrymap format to the
lfmm format.
Usage
ancestrymap2lfmm(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 ancestrymap format.
output.file
A character string containing a path to the output file,
a genotypic matric in the lfmm format.
By default, the name of the output file is the same name
as the input file with a .lfmm 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 matric in the lfmm format.
# Creation of a file called "example.ancestrymap"
# containing 4 SNPs for 3 individuals.
data("example_ancestrymap")
write.table(example_ancestrymap,"example.ancestrymap",
col.names = FALSE, row.names = FALSE, quote = FALSE)
# Conversion from the ancestrymap format ("example.ancestrymap")
# 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 file: "example.lfmm".
output = ancestrymap2lfmm("example.ancestrymap")
# Conversion from the ancestrymap format (example.ancestrymap)
# to the geno format with the output file called plop.lfmm.
# Create file: "plop.lfmm".
output = ancestrymap2lfmm("example.ancestrymap", "plop.lfmm")
# As force = false and the file "example.lfmm" already exists,
# nothing happens.
output = ancestrymap2lfmm("example.ancestrymap", force = FALSE)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(LEA)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/LEA/ancestrymap2lfmm.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ancestrymap2lfmm
> ### Title: Convert from 'ancestrymap' to 'lfmm' format
> ### Aliases: ancestrymap2lfmm
> ### Keywords: conversion
>
> ### ** Examples
>
> # Creation of a file called "example.ancestrymap"
> # containing 4 SNPs for 3 individuals.
> data("example_ancestrymap")
> write.table(example_ancestrymap,"example.ancestrymap",
+ col.names = FALSE, row.names = FALSE, quote = FALSE)
>
> # Conversion from the ancestrymap format ("example.ancestrymap")
> # 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 file: "example.lfmm".
> output = ancestrymap2lfmm("example.ancestrymap")
- number of detected individuals: 3
- number of detected loci: 4
>
> # Conversion from the ancestrymap format (example.ancestrymap)
> # to the geno format with the output file called plop.lfmm.
> # Create file: "plop.lfmm".
> output = ancestrymap2lfmm("example.ancestrymap", "plop.lfmm")
- number of detected individuals: 3
- number of detected loci: 4
>
> # As force = false and the file "example.lfmm" already exists,
> # nothing happens.
> output = ancestrymap2lfmm("example.ancestrymap", force = FALSE)
>
>
>
>
>
> dev.off()
null device
1
>