top_snps_pattern {qtl2pattern} | R Documentation |
Top SNPs organized by allele pattern
Description
Separate fine mapping scans by allele pattern.
Usage
top_snps_pattern(
scan1_output,
snpinfo,
drop = 1.5,
show_all_snps = TRUE,
haplos
)
## S3 method for class 'top_snps_pattern'
summary(object, sum_type = c("range", "best", "peak"), ...)
## S3 method for class 'top_snps_pattern'
subset(x, start_val = 0, end_val = max(x$pos), pheno = NULL, ...)
Arguments
scan1_output |
output of linear mixed model for |
snpinfo |
Data frame with SNP information with the following
columns (the last three are generally derived from with
|
drop |
include all SNPs within |
show_all_snps |
show all SNPs if |
haplos |
optional argument identify codes for haplotypes |
object |
object of class |
sum_type |
type of summary (one of "range","best") |
... |
additional parameters ignored |
x |
tbl of feature information from |
start_val , end_val |
start and end positions for subset |
pheno |
phenotype name(s) for subset |
Value
table of top_snps at maximum lod for pattern
table summary
subset of x
Author(s)
Brian S Yandell, brian.yandell@wisc.edu
Examples
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")
# Download genotype probabilities
tmpfile <- tempfile()
download.file(file.path(dirpath, "DOex_genoprobs_2.rds"), tmpfile, quiet=TRUE)
pr <- readRDS(tmpfile)
unlink(tmpfile)
# 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)
# Convert to SNP probabilities
snpinfo <- qtl2::index_snps(DOex$pmap, snpinfo)
snppr <- qtl2::genoprob_to_snpprob(pr, snpinfo)
# Scan SNPs.
scan_snppr <- qtl2::scan1(snppr, DOex$pheno)
# Collect top SNPs
top_snps_tbl <- top_snps_pattern(scan_snppr, snpinfo)
summary(top_snps_tbl)