Learn R Programming

synbreed (version 0.12-9)

gpData2cross: Conversion between objects of class 'cross' and 'gpData'

Description

Function to convert an object of class gpData to an object of class cross (F2 intercross class in the package qtl) and vice versa. If not done before, function codeGeno is used for recoding in gpData2cross.

Usage

gpData2cross(gpData,...)
cross2gpData(cross)

Arguments

gpData

object of class gpData with non-empty elements for pheno, geno and map

cross

object of class cross

...

further arguments for function codeGeno. Only used in gpData2cross.

Value

Object of class cross of gpData for function gpData2cross and cross2gpData, respectively.

Details

In cross, genotypic data is splitted into chromosomes while in gpData genotypic data comprises all chromosomes because separation into chromosomes in not required for genomic prediction. Note that coding of genotypic data differs between classes. In gpData, genotypic data is coded as the number of copies of the minor allele, i.e. 0, 1 and 2. Thus, function codeGeno should be applied to gpData before using gpData2cross to ensure correct coding. In cross, coding for F2 intercross is: AA = 1, AB = 2, BB = 3. When using gpData2cross or cross2gpData, resulting genotypic data has correct format.

References

Broman, K. W. and Churchill, S. S. (2003). R/qtl: Qtl mapping in experimental crosses. Bioinformatics, (19):889-890.

See Also

create.gpData, read.cross , codeGeno

Examples

Run this code
# NOT RUN {
library(synbreedData)
# from gpData to cross
data(maize)
maizeC <- codeGeno(maize)
maize.cross <- gpData2cross(maizeC)
# descriptive statistics
summary(maize.cross)
plot(maize.cross)

# use function scanone
maize.cross <- calc.genoprob(maize.cross, step=2.5)
result <- scanone(maize.cross, pheno.col=1, method="em")
# display of LOD curve along the chromosome
plot(result)


# from cross to gpData
data(fake.f2)
fake.f2.gpData <- cross2gpData(fake.f2)
summary(fake.f2.gpData)
# }

Run the code above in your browser using DataLab