top_snps: Create table of top snp associations

Description Usage Arguments See Also Examples

View source: R/top_snps.R

Description

Create a table of the top snp associations

Usage

1
2
top_snps(scan1_output, snpinfo, lodcolumn = 1, chr = NULL, drop = 1.5,
  show_all_snps = TRUE)

Arguments

scan1_output

Output of scan1(). Should contain a component "snpinfo", as when scan1() is run with SNP probabilities produced by genoprob_to_snpprob().

snpinfo

Data frame with SNP information with the following columns (the last three are generally derived 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 - Character string with SNP identifier (if missing, the rownames are used).

  • index - Indices that indicate equivalent groups of SNPs, calculated by index_snps().

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

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

lodcolumn

Selected LOD score column to (a numeric index, or a character string for a column name). Only one value allowed.

chr

Selected chromosome; only one value allowed.

drop

Show all SNPs with LOD score within this amount of the maximum SNP association.

show_all_snps

If TRUE, expand to show all SNPs.

See Also

index_snps(), genoprob_to_snpprob(), scan1snps(), plot_snpasso() in R/qtl2plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
## Not run: 
# load example DO data from web
library(qtl2geno)
file <- paste0("https://raw.githubusercontent.com/rqtl/",
               "qtl2data/master/DOex/DOex.zip")
DOex <- read_cross2(file)

# subset to chr 2
DOex <- DOex[,"2"]

# calculate genotype probabilities and convert to allele probabilities
pr <- calc_genoprob(DOex, error_prob=0.002)
apr <- genoprob_to_alleleprob(pr)

# download snp info from web
tmpfile <- tempfile()
file <- paste0("https://raw.githubusercontent.com/rqtl/",
               "qtl2data/master/DOex/c2_snpinfo.rds")
download.file(file, tmpfile, quiet=TRUE)
snpinfo <- readRDS(tmpfile)
unlink(tmpfile)

# calculate strain distribution patterns
snpinfo$sdp <- calc_sdp(snpinfo[,-(1:4)])

# identify groups of equivalent SNPs
snpinfo <- index_snps(DOex$pmap, snpinfo)

# convert to snp probabilities
snppr <- genoprob_to_snpprob(apr, snpinfo)

# perform SNP association analysis (here, ignoring residual kinship)
out_snps <- scan1(snppr, DOex$pheno)

# table with top SNPs
top_snps(out_snps, snpinfo)

# top SNPs among the distinct subset at which calculations were performed
top_snps(out_snps, snpinfo, show_all_snps=FALSE)

# top SNPs within 0.5 LOD of max
top_snps(out_snps, snpinfo, 0.5)

## End(Not run)

rqtl/qtl2scan documentation built on May 28, 2019, 2:36 a.m.