merge_maps: Merge two maps

View source: R/merge_maps.R

merge_mapsR Documentation

Merge two maps

Description

Estimates the linkage phase and recombination fraction between pre-built maps and creates a new map by merging them.

Usage

merge_maps(
  map.list,
  twopt,
  thres.twopt = 10,
  genoprob.list = NULL,
  thres.hmm = "best",
  tol = 1e-04
)

Arguments

map.list

a list of objects of class mappoly.map to be merged.

twopt

an object of class mappoly.twopt containing the two-point information for all pairs of markers present in the original maps

thres.twopt

the threshold used to determine if the linkage phases compared via two-point analysis should be considered for the search space reduction (default = 3)

genoprob.list

a list of objects of class mappoly.genoprob containing the genotype probabilities for the maps to be merged. If NULL (default), the probabilities are computed.

thres.hmm

the threshold used to determine which linkage phase configurations should be returned when merging two maps. If "best" (default), returns only the best linkage phase configuration. NOTE: if merging multiple maps, it always uses the "best" linkage phase configuration at each block insertion.

tol

the desired accuracy (default = 10e-04)

Details

merge_maps uses two-point information, under a given LOD threshold, to reduce the linkage phase search space. The remaining linkage phases are tested using the genotype probabilities.

Value

A list of class mappoly.map with two elements:

i) info: a list containing information about the map, regardless of the linkage phase configuration:

ploidy

the ploidy level

n.mrk

number of markers

seq.num

a vector containing the (ordered) indices of markers in the map, according to the input file

mrk.names

the names of markers in the map

seq.dose.p1

a vector containing the dosage in parent 1 for all markers in the map

seq.dose.p2

a vector containing the dosage in parent 2 for all markers in the map

chrom

a vector indicating the sequence (usually chromosome) each marker belongs as informed in the input file. If not available, chrom = NULL

genome.pos

physical position (usually in megabase) of the markers into the sequence

seq.ref

reference base used for each marker (i.e. A, T, C, G). If not available, seq.ref = NULL

seq.alt

alternative base used for each marker (i.e. A, T, C, G). If not available, seq.ref = NULL

chisq.pval

a vector containing p-values of the chi-squared test of Mendelian segregation for all markers in the map

data.name

name of the dataset of class mappoly.data

ph.thres

the LOD threshold used to define the linkage phase configurations to test

ii) a list of maps with possible linkage phase configuration. Each map in the list is also a list containing

seq.num

a vector containing the (ordered) indices of markers in the map, according to the input file

seq.rf

a vector of size (n.mrk - 1) containing a sequence of recombination fraction between the adjacent markers in the map

seq.ph

linkage phase configuration for all markers in both parents

loglike

the hmm-based multipoint likelihood

Author(s)

Marcelo Mollinari, mmollin@ncsu.edu

Examples


#### Tetraploid example #####
map1 <- get_submap(solcap.dose.map[[1]], 1:5)
map2 <- get_submap(solcap.dose.map[[1]], 6:15)
map3 <- get_submap(solcap.dose.map[[1]], 16:30)
full.map <- get_submap(solcap.dose.map[[1]], 1:30)
s <- make_seq_mappoly(tetra.solcap, full.map$maps[[1]]$seq.num)
twopt <- est_pairwise_rf(input.seq = s)
merged.maps <- merge_maps(map.list = list(map1, map2, map3), 
                        twopt = twopt,
                        thres.twopt = 3)
plot(merged.maps, mrk.names = TRUE)                       
plot(full.map, mrk.names = TRUE)                       
best.phase <- merged.maps$maps[[1]]$seq.ph
names.id <- names(best.phase$P)
compare_haplotypes(ploidy = 4, best.phase$P[names.id], 
                   full.map$maps[[1]]$seq.ph$P[names.id]) 
compare_haplotypes(ploidy = 4, best.phase$Q[names.id], 
                   full.map$maps[[1]]$seq.ph$Q[names.id])


mmollina/MAPPoly documentation built on March 8, 2024, 2:04 a.m.