Learn R Programming

dlmap (version 1.13)

dlcross: Constructor, summary and plotting functions for dlcross format

Description

Reads in objects in cross format and files or objects in dlmap format and converts them to dlmap input format.

Usage

dlcross(format = c("rqtl", "dlmap", "other"), genobj, pheobj, mapobj, idname="ID", genfile, phefile, mapfile, type, step=0, fixpos=0, estmap=TRUE, ...) "plot"(x, chr, pheno.col, ...) "summary"(object, ...)

Arguments

format
See documentation for read.cross. Also supports the input of an object of class cross ("rqtl" format), "dlmap" format (described below) and continuous data for association mapping populations ("other" format)
genobj
if format="rqtl", object of class cross; if format="dlmap" or "other" data frame containing genotypes
pheobj
Data frame or matrix containing supplementary phenotypic or environmental data
mapobj
if format="other" or "dlmap", 2/3-columned data-frame containing marker names, chromosomes and marker positions
idname
Unique identifier variable name; will be used to match phenotypic and marker data
genfile
if format="dlmap" see below
mapfile
if format="dlmap" see below
phefile
if format="dlmap" see below
type
Type of experimental cross; only necessary if format="dlmap" or "other"; if not input, will be assumed that data is from unrelated individuals
step
Step size for localization stage, i.e. if step=2, grid of positions spaced 2 cM apart are considered for QTL locations. If step=0 (default) positions are only located at markers.
fixpos
Alternative to specifying a step size - if fixpos=2, 2 evenly spaced positions between each marker are considered as QTL locations. If fixpos=0 (default) positions are only located at markers.
estmap
Flag for whether to re-estimate the linkage map. Cannot be done for format="other"
...
additional arguments
x
input to plot function, object of class dlcross
chr
character string naming the subset of chromosomes to plot; if numeric, a vector of chromosome indices
pheno.col
vector of phenotypes for which to show barplots/histograms
object
input to summary function, object of class dlcross

Value

Contains the following elements:
dfMerged
Data frame to be used in dlMapping analysis
map
Original genetic map
nphe
Number of phenotypic traits
loc
A flag for whether to run the localization stage
idname
the ID name input to the function
mapp
If format is not "other", genetic map augmented by imputed genotypes at grid of positions
genCross
if format is not "other", rqtl cross object. CAUTION: if there are replicates, i.e., more phenotypic data than genotypic, this object will not contain all of the phenotypic data for the sample

Details

The main function constructs dlcross objects for input into dlmap. The format argument allows for compatibility with the cross format as supported by read.cross in R/qtl. In addition, format="dlmap" or "other" takes three files or objects in the following form.

  • genfile: First row contains an identifier variable and marker names. Following rows contain genotype values for each individual
  • phefile: First row contains names of phenotypic and environmental traits. One of these traits must be an identifier for each individual. Following rows contain values of the traits for each individual. Note: This file may contain more observations than the file containing the marker data
  • mapfile: Contains marker names, chromosome groupings and positions

If a single set of trait values is available for each genotype, then phenotypic data will be input through the arguments genobj or phefile (depending on the file format). The argument pheobj allows for input of phenotypic data on replicates or additional individuals which are not necessarily genotyped.

Choosing format="other" allows for association mapping populations to be analyzed, and in this case the data can be input as with format="dlmap", but a genetic linkage map is not required. Hence the mapfile only needs the first two columns of marker names and chromosome groupings.

The plot function plots diagnostics summarizing the data. If the type of cross is not "other", will plot the genetic map for the cross. Will also plot a histogram or barplot of the first few phenotypic variables. Will only plot a maximum of three phenotypic variables; pheno.col can be used to select which are plotted.

The summary function outputs a summary of data stored in dlcross object, including number of genotypes, number of phenotypes, number of phenotypic variables, number of chromosomes and markers per chromosome. For experimental crosses, based off of cross object summary; similar output for association mapping populations.

References

Huang, BE and George, AW. 2009. Look before you leap: A new approach to QTL mapping. TAG 119:899-911

B. Emma Huang, Rohan Shah, Andrew W. George (2012). dlmap: An R Package for Mixed Model QTL and Association Analysis. Journal of Statistical Software 50(6): 1-22. URL http://www.jstatsoft.org/v50/i06/.

See Also

plot.cross

Examples

Run this code
## Not run: 
# # load dataset
# data(BSdat)
# data(BSphe)
# 
# # convert data to dlmap format
# dl.in1 <- dlcross(format="rqtl", genobj=BSdat, idname="ID", fixpos=1)
# 
# # convert data with separate phenotypic trait file
# dl.in2 <- dlcross(format="rqtl", genobj=BSdat, pheobj=BSphe, idname="ID", step=5)
# 
# plot(dl.in2)
# summary(dl.in2)
# ## End(Not run)

Run the code above in your browser using DataLab