Learn R Programming

qtl2pattern (version 1.2.1)

genoprob_to_patternprob: Collapse genoprob according to pattern

Description

Collapse genoprob according to pattern

Usage

genoprob_to_patternprob(probs1, sdp, alleles = FALSE)

Value

object of class calc_genoprob

Arguments

probs1

object of class calc_genoprob

sdp

SNP distribution pattern

alleles

use allele string if TRUE

Author

Brian S Yandell, brian.yandell@wisc.edu

Examples

Run this code
dirpath <- "https://raw.githubusercontent.com/rqtl/qtl2data/master/DOex"

# Read DOex example cross from 'qtl2data'
DOex <- subset(qtl2::read_cross2(file.path(dirpath, "DOex.zip")), chr = "2")

# \donttest{
# Download genotype probabilities
tmpfile <- tempfile()
download.file(file.path(dirpath, "DOex_genoprobs_2.rds"), tmpfile, quiet=TRUE)
pr <- readRDS(tmpfile)
unlink(tmpfile)

# Convert genotype probabilities to pattern probabilities for pattern 1.
pattern_pr <- genoprob_to_patternprob(pr, 7, TRUE)

str(pr)
str(pattern_pr)
# }

Run the code above in your browser using DataLab