Description Usage Arguments Details Value Examples
View source: R/PolyHaplotyper.R
convert a haploblock-defining data frame to a list as needed by inferHaplotypes
1 | haploblock_df2list(df, mrkcol, hbcol, sorted=TRUE)
|
df |
a data.frame with at least the following two columns |
mrkcol |
the name or number of the column with the markers |
hbcol |
the name or number of the column with the haploblocks |
sorted |
if TRUE (default) the haploblock list is sorted in alphabetical order of haploblock name (the markers within haploblocks are not sorted); if FALSE the haploblocks will be in order of first occurrence in df |
function inferHaplotypes needs a list where each item is a vector of all markers in one haploblock. This function produces such a list from a data.frame where the markers are in one column and the haploblocks in another column. The markers and haploblocks columns may be character, factor or numeric, and the columns may be indicated by name or number.
the desired list
1 2 3 4 5 | df1 <- data.frame(
marker=paste0("mrk",1:9),
block=LETTERS[c(1,2,3,2,3,1,1,2,2)],
extracol=runif(9))
haploblock_df2list(df=df1, mrkcol="marker", hbcol=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.