nplplot {nplplot} | R Documentation |
Plotting statistics along a chromosome
Description
Plots linkage or association statistics along a chromosome, contained within a data frame or a file. Marker names are displayed along the top border.
Usage
nplplot(plotdata=NULL, filename=NULL, yline=2.0, ymin=0, ymax=3.0,
header=TRUE, yfix=FALSE, title=NULL, draw.lgnd=TRUE,
xlabl="", ylabl="", lgndx=NULL, lgndy=NULL, lgndtxt=NULL,
cex.legend = 0.7, cex.axis=0.7, tcl=1,
bw=TRUE, my.colors=NULL, ltypes=NULL, ptypes=NULL,
na.rm=TRUE, plot.width=0.0, ...)
Arguments
plotdata |
A data frame containing marker names in the first column, marker map positions in the second column, and statistical scores in column 3 onwards. |
filename |
A table format file containing the plot data as described above. |
header |
TRUE or FALSE depending on whether the plotdata or file has a header line. |
yline |
Y-value for displaying a horizontal cut-off
line. If 'yfix' is set to TRUE and Y-line falls outside of |
ymin , ymax |
Y-axis minimum and maximum values. If non-NULL
values are provided, and |
yfix |
TRUE or FALSE to denote whether plot area should be
cropped to the |
title |
Used as the subtitle of the plot. |
xlabl |
X-axis label. May interfere with the display of
the subtitle provided as the |
ylabl |
Y-axis label. |
draw.lgnd |
TRUE or FALSE denoting whether a plot legend should be displayed. |
lgndx |
X coordinate for the legend box, passed to the
|
lgndy |
Y coordinate for the legend box, passed to the
|
lgndtxt |
Vector of strings to use in the legend. |
cex.legend |
Character scaling for legend, passed as the
|
cex.axis |
Character scaling for the axis, passed to the
|
tcl |
Length of ticks for the top border, passed to the
|
bw |
TRUE or FALSE depending on whether plots should be
drawn in color. If set to FALSE, then the colors defined by
|
my.colors |
Vector of color specifications as described
in the |
ltypes |
Vector of line types for the plots. Each
non-zero line type is passed on to a |
ptypes |
Vector of characters giving the point
types, to be passed onto the |
na.rm |
TRUE or FALSE depending on whether points with
Y-coordinates set to NAs should be skipped. Setting |
plot.width |
A number giving the width of the plot in inches. This is used to decide whether some marker names should be dynamically hidden, if they are too close to each other along the top border. If set to 0, the default page-size is used to set the width. |
... |
Further graphical parameters to be passed onto the 'plot', 'lines' and 'points' commands. |
Details
The nplplot function draws multiple curves within a single plot by automatically calling 'plot', 'lines', and 'points' multiple times, thus making it easy for the user to plot many columns of results using a single plot command. It is intended for the display of linkage and association analysis results such as LOD scores and P-values. It allows the marker names to be displayed along the top border of the plot, as well as a significance threshold line.
The input plot data has to be in a specific tabular format with each column separated by white-space :
Here is an example:
Marker Position score1 score2 score3 d1s228 0.00 0.546 0.345 0.142 d1s429 1.00 0.346 0.335 0.252 d1s347 2.00 0.446 0.245 0.342
This example file contains a header, therefore the header
argument should
be set to TRUE.
Lines 2-4 contain scores at various marker positions. Missing scores can be denoted with either "." or "NA". The position column cannot have missing data. There can be any number of score columns within a file and will be plotted as separate curves within the same plot. Each file is plotted as a separate plot.
Value
TRUE or FALSE depending on whether the plot data was successfully plotted.
See Also
Examples
# plot with legend
par(omi=c(0.05, 0.05, 0.5, 0.05))
data(lods1, package="nplplot")
nplplot(plotdata=lods1, draw.lgnd=TRUE)
# plot without legend
data(lods2, package="nplplot")
nplplot(plotdata=lods2, draw.lgnd=FALSE)
# plotting from a data file
datadir <- paste(system.file("data", package="nplplot"), .Platform$file.sep, sep="")
nplplot(filename=paste(datadir, "lods2.txt.gz", sep=""))