top_snps_pattern: Top SNPs organized by allele pattern

top_snps_patternR 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 phename (see scan1)

snpinfo

Data frame with SNP information with the following columns (the last three are generally derived from with index_snps):

  • chr - Character string or factor with chromosome

  • pos - Position (in same units as in the "map" attribute in genoprobs.

  • sdp - Strain distribution pattern: an integer, between 1 and 2^n - 2 where n is the number of strains, whose binary encoding indicates the founder genotypes

  • snp_id - Character string with SNP identifier (if missing, the rownames are used).

  • index - Indices that indicate equivalent groups of SNPs.

  • intervals - Indexes that indicate which marker intervals the SNPs reside.

  • on_map - Indicate whether SNP coincides with a marker in the genoprobs

drop

include all SNPs within drop of max LOD (default 1.5)

show_all_snps

show all SNPs if TRUE

haplos

optional argument identify codes for haplotypes

object

object of class top_snps_tbl

sum_type

type of summary (one of "range","best")

...

additional parameters ignored

x

tbl of feature information from get_feature_snp

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)



byandell/qtl2pattern documentation built on Nov. 9, 2023, 7:57 p.m.