sdp_to_pattern {qtl2pattern} | R Documentation |
Convert sdp to pattern
Description
Convert strain distribution pattern (sdp) to letter pattern.
Usage
sdp_to_pattern(sdp, haplos, symmetric = TRUE)
sdp_to_logical(sdp, haplos, symmetric = TRUE)
Arguments
sdp |
vector of sdp values |
haplos |
letter codes for haplotypes (required) |
symmetric |
make patterns symmetric if |
Value
vector of letter patterns
Author(s)
Brian S Yandell, brian.yandell@wisc.edu
Examples
dirpath <- "https://raw.githubusercontent.com/rqtl/qtl2data/master/DOex"
# Download SNP info for DOex from web and read as RDS.
tmpfile <- tempfile()
download.file(file.path(dirpath, "c2_snpinfo.rds"), tmpfile, quiet=TRUE)
snpinfo <- readRDS(tmpfile)
unlink(tmpfile)
snpinfo <- dplyr::rename(snpinfo, pos = pos_Mbp)
# Extract strain distribution pattern.
sdp <- snpinfo$sdp
# Find out how many alleles.
nallele <- ceiling(log2(max(sdp)))
out <- sdp_to_pattern(sdp, LETTERS[seq_len(nallele)])
# Show most frequent patterns.
head(rev(sort(c(table(out)))))
[Package qtl2pattern version 1.2.1 Index]