plotMarkerAxis {diemr} | R Documentation |
Add a Marker Axis with Chromosome Names to a Plot of Polarized Genotypes
Description
This function adds a marker axis with chromosome names to an existing plot of polarized genotypes. It requires that the plot is already created using plotPolarized.
Usage
plotMarkerAxis(
includedSites,
ChosenSites,
tickDist = 1e+06,
axisInfo = NULL,
...
)
Arguments
includedSites |
character. Path to a file with columns |
ChosenSites |
logical vector indicating which sites are to be included in the analysis. |
tickDist |
numeric. Indicates the spacing of physical tick marks along a chromosome. |
axisInfo |
list with user-defined tick positions and labels for marker axis. See Details. |
... |
additional arguments. |
Details
The includedSites
file should ideally be generated by
vcf2diem to ensure congruence between the plotted genotypes and
the respective metadata.
Tick mark distances within a chromosome are located at tickDist
and formated to
multiples of millions.
The optional axisInfo
argument must have five named elements with the following
information:
-
CHROMbreaks
: Numeric vector with positions defining ticks separating chromosomes. The metric for all positions is in the number of markers. -
CHROMnamesPos
: Numeric vector with positions to place the chromosome labels. -
CHROMnames
: Character vector with the names of the chromosomes. Must be the same length asCHROMnamesPos
. -
ticksPos
: Numeric vector with positions of ticks within chromosomes. -
ticksNames
: Character vector with the names to be displayed atticksPos
.
When axisInfo = NULL
, the function extracts the necessary information from the
includedSites
file.
Value
Returns an invisible axisInfo
list with the tick positions and labels
for the marker axis.
Examples
## Not run:
# Run this example in a working directory with write permissions
myo <- system.file("extdata", "myotis.vcf", package = "diemr")
vcf2diem(myo, "myo")
inds <- 1:14
fit <- diem("myo-001.txt", ChosenInds = inds, ploidy = FALSE)
gen <- importPolarized("myo-001.txt", fit$markerPolarity, inds)
h <- apply(gen, 1, function(x) pHetErrOnStateCount(sStateCount(x)))[1, ]
plotPolarized(gen, h, xlab = "")
plotMarkerAxis("myo-includedSites.txt", rep(TRUE, 11), tickDist = 100)
## End(Not run)