top_snps {qtl2} | R Documentation |
Create table of top snp associations
Description
Create a table of the top snp associations
Usage
top_snps(
scan1_output,
snpinfo,
lodcolumn = 1,
chr = NULL,
drop = 1.5,
show_all_snps = TRUE
)
Arguments
scan1_output |
Output of |
snpinfo |
Data frame with SNP information with the following
columns (the last three are generally derived with
|
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. |
Value
Data frame like the input snpinfo
with just the selected
subset of rows, and with an added column with the LOD score.
See Also
index_snps()
, genoprob_to_snpprob()
, scan1snps()
, plot_snpasso()
Examples
## Not run:
# load example DO data from web
file <- paste0("https://raw.githubusercontent.com/rqtl/",
"qtl2data/main/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)
# query function for grabbing info about variants in region
dbfile <- system.file("extdata", "cc_variants_small.sqlite", package="qtl2")
query_variants <- create_variant_query_func(dbfile)
# SNP association scan, keep information on all SNPs
out_snps <- scan1snps(apr, DOex$pmap, DOex$pheno, query_func=query_variants,
chr=2, start=97, end=98, keep_all_snps=TRUE)
# table with top SNPs
top_snps(out_snps$lod, out_snps$snpinfo)
# top SNPs among the distinct subset at which calculations were performed
top_snps(out_snps$lod, out_snps$snpinfo, show_all_snps=FALSE)
# top SNPs within 0.5 LOD of max
top_snps(out_snps$lod, out_snps$snpinfo, drop=0.5)
## End(Not run)