R: Write data for a QTL experiment to a file

write.cross {qtl} | R Documentation

## Write data for a QTL experiment to a file

### Description

Data for a QTL experiment is written to a file (or files).

### Usage

    write.cross(cross, format=c("csv", "csvr", "csvs", "csvsr",
                                "mm", "qtlcart", "gary", "qtab",
                                "mapqtl", "tidy"),
                filestem="data", chr, digits=NULL, descr)

### Arguments

`cross` | An object of class `cross`. See `read.cross` for details.
`format` | Specifies whether to write the data in comma-delimited, rotated comma-delimited, Mapmaker, QTL Cartographer, Gary Churchill's, QTAB, MapQTL format.
`filestem` | A character string giving the first part of the output file names (the bit before the dot). In Windows, use forward slashes (`"/"`) or double backslashes (`"\\"`) to specify directory trees.
`chr` | A vector specifying for which chromosomes genotype data should be written. This should be a vector of character strings referring to chromosomes by name; numeric values are converted to strings. Refer to chromosomes with a preceding `-` to have all chromosomes but those considered. A logical (TRUE/FALSE) vector may also be used.
`digits` | Number of digits to which phenotype values and genetic map positions should be rounded. If NULL (the default), they are not rounded.
`descr` | Character string description; used only with `format="qtab"`.

### Details

Comma-delimited formats: a single csv file is created in the formats `"csv"` or `"csvr"`. Two files are created (one for the genotype data and one for the phenotype data) for the formats `"csvs"` and `"csvsr"`; if `filestem="file"`, the two files will be names `"file_gen.csv"` and `"file_phe.csv"`. See the help file for `read.cross` for details on these formats.

Mapmaker format: Data is written to two files. Suppose `filestem="file"`. Then `"file.raw"` will contain the genotype and phenotype data, and `"file.prep"` will contain the necessary code for defining the chromosome assignments, marker order, and inter-marker distances.

QTL Cartographer format: Data is written to two files. Suppose `filestem="file"`. Then `"file.cro"` will contain the genotype and phenotype data, and `"file.map"` will contain the genetic map information. Note that cross types are converted to QTL Cartographer cross types as follows: riself to RF1, risib to RF2, bc to B1 and f2 to RF2.

Gary's format: Data is written to six files. They are:
`"geno.data"` - genotype data;
`"pheno.data"` - phenotype data;
`"chrid.dat"` - the chromosome identifier for each marker;
`"mnames.txt"` - the marker names;
`"markerpos.txt"` - the marker positions;
`"pnames.txt"` - the phenotype names

QTAB format: See documentation.

MapQTL format: See documentation.

Tidy format: Data is written to three files, `"stem_gen.csv"`, `"stem_phe.csv"`, and `"stem_map.csv"` (where `stem` is taken from the `filestem` argument.

### Author(s)

Karl W Broman, kbroman@biostat.wisc.edu; Hao Wu; Brian S. Yandell; Danny Arends; Aaron Wolen

### See Also

`read.cross`

### Examples

    ## Not run: data(fake.bc)

    # comma-delimited format
    write.cross(fake.bc, "csv", "Data/fakebc", c(1,5,13))

    # rotated comma-delimited format
    write.cross(fake.bc, "csvr", "Data/fakebc", c(1,5,13))

    # split comma-delimited format
    write.cross(fake.bc, "csvs", "Data/fakebc", c(1,5,13))

    # split and rotated comma-delimited format
    write.cross(fake.bc, "csvsr", "Data/fakebc", c(1,5,13))

    # Mapmaker format
    write.cross(fake.bc, "mm", "Data/fakebc", c(1,5,13))

    # QTL Cartographer format
    write.cross(fake.bc, "qtlcart", "Data/fakebc", c(1,5,13))

    # Gary's format
    write.cross(fake.bc, "gary", c(1,5,13))
    ## End(Not run)

[Package qtl version 1.41-6 Index]