STAtoCross: Convert STA to Cross

View source: R/createSTA.R

STAtoCrossR Documentation

Convert STA to Cross

Description

Convert an STA object to a cross object from package qtl. Genotypic information should be available in a .csv file.
The only way to create an object of class cross is by importing both the phenotypic and the genotypic data from external files. Therefore the phenotypic data, either the BLUEs or the BLUPs from the fitted model are first written to a temporary file. The genotypic data has to be available in a .csv file in the correct format as well, see genoFile for a description of this format. These phenotypic and genotypic files are then imported into a cross object using the read.cross function in the qtl package.

Usage

STAtoCross(
  STA,
  trial = NULL,
  traits = NULL,
  what = c("BLUEs", "BLUPs"),
  genoFile,
  genotypes = c("A", "H", "B", "D", "C"),
  ...
)

Arguments

STA

An object of class STA.

trial

A character string indicating the trial to be exported. If NULL and STA contains only one trial, that trial is exported.

traits

A character string containing the traits to be exported. If NULL, all traits for the selected trial are exported.

what

A character string containing the statistics to be exported as phenotype in the cross object. This can be either BLUEs or BLUPs.

genoFile

A character string indicating a filename containing phenotypic data. The data should be in the format required by the qtl package. The first column should contain the individuals, starting from row 4. The following columns contain markers with in the second and third row the chromosome and position on the chromosome and in the following rows the genotypes.

genotypes

A character vector specifying the genotype codes corresponding to AA, AB, BB, not BB and not AA.

...

Further arguments to be passed to the read.cross function. See read.cross.

See Also

read.cross

Other functions for STA objects: STAtoTD(), plot.STA(), report.STA(), summary.STA()

Examples

## Fit model using SpATS.
modSp <- fitTD(TD = TDHeat05,
               design = "res.rowcol",
               traits = "yield",
               what = "fixed")

## Create cross object with BLUEs from modSp using genotypic information
## from markers.csv in the package.
cross <- STAtoCross(modSp,
                    genoFile = system.file("extdata", "markers.csv",
                                           package = "statgenSTA"))


statgenSTA documentation built on Oct. 14, 2024, 9:10 a.m.