STAtoCross: Convert STA to Cross

View source: R/createSTA.R

STAtoCrossR Documentation

Convert STA to Cross


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.


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



An object of class STA.


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


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


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


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.


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


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


## 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 Jan. 11, 2023, 5:15 p.m.