Learn R Programming

pedtools (version 0.9.0)

writePed: Write a pedigree to file

Description

Write a pedigree to file

Usage

writePed(x, prefix = famid(x), what = c("ped", "map", "dat", "freq"),
  merlin = FALSE, verbose = TRUE)

Arguments

x

A ped object

prefix

A character string giving the prefix of the files. For instance, if prefix = "myped" and what = c("ped", "map"), the output files are "myped.ped" and "myped.map" in the current directory. Paths to other folder may be included, e.g. prefix = "path-to-my-dir/myped". By default, the family identifier famid(x) is used. Note that if this is empty, the files become ".ped" and so on.

what

A subset of the character vector c("ped", "map", "dat" and "freq"), indicating which files should be created. All files are written in MERLIN style (but see the merlin parameter below!) By default all files are created.

merlin

A logical. If TRUE, the marker alleles are relabelled to 1,2,..., making sure that the generated files are readable by MERLIN (which does not accept non-numerical allele labels in the frequency file.) If FALSE (the default) the allele labels are unchanged. In this case, x should be exactly reproducible from the files (see examples).

verbose

A logical.

Value

A character vector with the file names.

Examples

Run this code
# NOT RUN {
tmpdir = tempdir()
x = nuclearPed(1)
x = setMarkers(x, marker(x, '3' = 1:2))
writePed(x, prefix = file.path(tmpdir, "myped"))

# }

Run the code above in your browser using DataLab