The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
LinkageMapView Examples
Lisa A. Ouellette
2018-01-21
Introduction
The LinkageMapView package produces linkage group maps and QTL maps from a variety of inputs. The output is a portable document format (PDF) and publication ready.
There are many options for customizing the maps which will be reviewed in this vignette.
PDF options
The following PDF options can be specified and will be passed through to the PDF device.
- pdf.family - the font family for all text. Default is “Helvetica”.
- pdf.fg - the foreground color (lines and text). Default is “black”.
- pdf.bg - the background color. Default is “transparent”.
- pdf.pointsize - default is 12.
- pdf.title - the title for a PDF ONLY appears in the metadata and does not appear in the output itself. See main.
- pdf.width - width of the output file in inches.
- pdf.height - height of the output file in inches.
Note that pdf.width and pdf.height will be calculated automatically if they are not specified.
Continuing with the hyper cross object loaded above from the qtl package:
outfile = file.path(tempdir(), "hyper.pdf")
lmv.linkage.plot(hyper,outfile,mapthese=c(1,4,6,15))
#> Required pdf.width = 13.686
#> Required pdf.height = 4.23313333333333
#> Using pdf.width = 14
#> Using pdf.height = 5
Position and Locus Format Options
If more than one locus name appears at the same position, the label is indented slightly to catch your eye. The parameter maxcolsfordups determines how many loci names will print on one line before going to subsequent lines. The default is 3. When multiple lines are required for all the labels at the same position, the labels are joined by a vertical line.
The roundpos parameter, which defaults to 1, specifies how many positions after the decimal point should be printed for the locus position.
Another parameter for handling multiple loci at the same position, is dupnbr. If TRUE, only the first locus name at a position will print with, “## more” afterwards, indicating the number of duplicate locus names at that position:
outfile = file.path(tempdir(), "hyper_dupnbr.pdf")
lmv.linkage.plot(hyper,outfile,mapthese=c(1,4,6,15),dupnbr = TRUE)
#> Required pdf.width = 12.8381666666667
#> Required pdf.height = 4.0656
#> Using pdf.width = 13
#> Using pdf.height = 5
There is another parameter, showonly, which can be used to specify the locus names to be printed. All other locus names and positions will not be printed. The next example will demonstrate the use of the showonly parameter along with loci and position formatting options. By default the positions print to the left of the linkage group and so the position format options begin with an ‘l’. And by default the loci print to the right of the linkage group and so the loci format options begin with an ‘r’:
- lcex - Default is par(“cex”)
- lcol - Default is par(“col”)
- lfont - Default is par(“font”)
- rcex - Default is par(“cex”)
- rcol - Default is par(“col”)
- rfont - Default is par(“font”)
See help for par, ?par
, for a full description of these defaults.
In this example we will show only one locus per linkage group. The positions and locus will be printed at twice the normal magnification (lcex=2 and rcex=2), the positions will be green, the loci red, and the position font will be bold (2) and the loci font will be italic (3).
outfile = file.path(tempdir(), "hyper_showonly.pdf")
lmv.linkage.plot(hyper,outfile,mapthese=c(1,4,6,15),lcol="green",lcex=2,lfont=2,
rcol="red",rcex=2,rfont=3,
showonly=c("D1Mit123","D4Mit80","D6Mit135","D15Mit156"))
#> Required pdf.width = 16.0066666666667
#> Required pdf.height = 2.0552
#> Using pdf.width = 17
#> Using pdf.height = 3
Lines are still drawn across the linkage group to indicate all locus positions even though the labels are not shown. Note that the color of the line across the linkage group and to the loci name defaults to the color of the loci name. This default can be changed with rsegcol=FALSE which indicates the line across the linkage group and to the loci name should be the pdf.fg color instead.
Main Title and Linkage Group Titles
The main parameter is used for a title for the entire drawing and defaults to NULL. By default, each linkage group name is printed above the linkage group. To turn off linkage group names printing use prtlgtitles=FALSE. You can override the linkage group names to be printed by using the lgtitles parameter. The magnification, font and color of the linkage group titles and the main title can be adjusted with the following parameters:
- cex.lgtitle - Default is par(“cex.main”)
- cex.main - Default is par(“cex.main”)
- col.lgitle - Default is par(“col.main”)
- col.main - Default is par(“col.main”)
- font.lgtitle - Default is par(“font.main”)
- font.main - Default is par(“font.main”)
outfile = file.path(tempdir(), "hyper_titles.pdf")
lmv.linkage.plot(hyper,outfile,mapthese=c(1,4,6,15),col.lgtitle = "blue",cex.lgtitle=2,
col.main = "red",main="Overall Title for the Output Map")
#> Required pdf.width = 13.686
#> Required pdf.height = 4.23313333333333
#> Using pdf.width = 14
#> Using pdf.height = 5
Density Maps and Ruler Customization
The last example will illustrate producing a density map. There is a helper function, ?lmvdencolor
which you may use to provide your own color palette, window size and color bias. In this example the defaults are accepted and the denmap=TRUE parameter is specified. In addition, this example customizes the ruler (y axis).
## do a density map with default colors and customize the axis
data(oat)
## draw tickmarks at each cM from 0 to largest position of linkage groups to be drawn
maxpos <- floor(max(oat$Position[oat$Group == "Mrg01" | oat$Group == "Mrg02"]))
at.axis <- seq(0, maxpos)
## put labels on ruler at every 10 cM
axlab <- vector()
for (lab in 0:maxpos) {
if (!lab %% 10) {
axlab <- c(axlab, lab)
}
else {
axlab <- c(axlab, NA)
}
}
outfile = file.path(tempdir(), "oat_denmap.pdf")
lmv.linkage.plot(oat,outfile,mapthese=c("Mrg01","Mrg02"),denmap=TRUE, cex.axis = 1, at.axis = at.axis, labels.axis = axlab)
#> Required pdf.width = 2.5668
#> Required pdf.height = 10.5916666666671
#> Using pdf.width = 3
#> Using pdf.height = 11
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.