prepareplot: Prepare input data files for bedplot and genomeplot

View source: R/prepareplot.R

prepareplotR Documentation

Prepare input data files for bedplot and genomeplot

Description

The prepareplot function prepares input data files for bedplot and genomeplot functions from nplplot-formatted score files and a Mega2 annotated format map file with physical positions.

Usage

 prepareplot(prefix, chrlist=c(1:23,25), mapfile, output="both")

Arguments

prefix

Prefix of the names of R table files, e.g. “RMERLINDATA” for R table files “RMERLINDATA.01”, “RMERLINDATA.02”, etc. Using chrlist below, it automatically finds R table files with the specified prefix and chromosome-specific extensions to convert.

Alternatively, prefix may be a list of data.frames named by the chromosomes supplied in chrlist.

chrlist

List of chromosome numbers to create plots for, default 1 through 23. Chromosomes 23 and 25 produces files for the X chromosome X, 25 denoting pseudo-autosomal markers on chromosome X.

mapfile

Mega2 annnotated format map file, containing marker names and and exactly one set of physical positions. mapfile may instead be a data.frame containing the same information as the map file, viz. the marker names and physical positions.

output

Which plotting function to generate data for, “both” for both bedplot and genomeplot functions, “bed” for generating input files for bedplot function, “GG” for generating input file for genomeplot function. output is set to default “both”.

Details

mapfile example:

Chromosome   Map.h.a   Name   Map.h.m   Map.h.f   Build52.p
5            0.0       M1     0.0       0.0       144255
5            5.0       M3     2.0       7.0       144355
5            8.0       M2     4.0       12.0      144400
8            0.0       M4     0.0       0.0       144255
8            5.0       M6     2.0       7.0       144355
8            8.0       M5     4.0       12.0      144400

The names of R table files should be linkage or association analysis score files in nplplot-format with Mega2-style file names, i.e., having a common specified prefix and 01-09, 11- 24, X, or XY as suffixes. The list of suffixes are determined by the chromosome list. If this list includes 23 or X, R table files with either the “23” suffix or “X” suffix are accepted. If both files exist, the one with the “X” suffix is read in and the user warned. If the XY chromosome is chosen, R table files can have either “24” or “XY” as a suffix, with “XY” suffixed file having precedence.

The prepareplot function generates chromosome-specific formatted score files “bed.data.\#” for use by bedplot with the same suffix as the R table file. If X chromosome is chosen, the output file is named “bed.data.23”. If XY chromosome is chosen, those records on XY chromosome are included in “bed.data.23” file. The output file “bed.data.\#” contains marker names and physical positions followed by one or more score columns. The header is taken from the input score file(s).

Prepareplot generates a combined file over all chromosomes “GG.data.all” for genomeplot. For pseudo-autosomal markers denoted by chromosome XY or 24, these scores are assigned the X chromosome. The output file “GG.data.all” contains four or more columns with headings. The first, second and third columns contain chromosomes, marker names and physical positions respectively, followed by one or more score columns with score names as headers.

Value

TRUE or FALSE depending on whether runs successfully.

Examples

## Not run: prepareplot("RMERLINDATA", c(5,8), "map.all", "GG")

nplplot documentation built on May 20, 2022, 1:07 a.m.

Related to prepareplot in nplplot...