Description Usage Arguments Value Examples
View source: R/create_HapMat.R
This function creates a hapMat
data object, a required input for reconstructPP
.
1 | createHapMat(hapmat, snvNames, hapNames, posns)
|
hapmat |
A matrix of 0's and 1's, with rows representing haplotypes and columns representing single-nucleotide variants (SNVs). |
snvNames |
A vector of names of SNVs for the columns of |
hapNames |
A vector of names of haplotypes for the rows of |
posns |
A numeric vector specifying the genomic positions (e.g. in base pairs) of SNVs in the
columns of |
An object of class hapMat
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | hapmat = matrix(c(1,1,1,0,
0,0,0,0,
1,1,1,1,
1,0,0,0,
1,1,0,0,
1,0,0,1,
1,0,0,1), byrow = TRUE, ncol = 4)
snvnames = c(paste("SNV", 1:4, sep = ""))
allhaps = c("h1", "h2", "h3", "h4", "h5", "h6", "h7")
# Physical positions
posns = c(1000, 2000, 3000, 4000)
# Create hapMat data object
ex_hapMat <- createHapMat(hapmat = hapmat,
snvNames = snvnames,
hapNames = allhaps,
posns = posns)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.