plot_snpasso2: Plot SNP association

Description Usage Arguments

Description

Modified version of qtl2's plot_snpasso() function to allow plotting of the haplotype's QTL peak (assuming the region is set around the peak) and to easily identify which gene the SNP with the highest LOD score overlap. A solid black vertical line represents the haplotype's QTL peak, while a solid violet-red line represents the SNP with the highest LOD score. An optional parameter, haplo_peak_drop, will plot dashed black lines to indicate the region where the haplotype's LOD score is within a certain drop of its QTL peak. If this paramter is given values, two violet-red lines may be plotted. One violet-red line is the SNP with the maximum LOD score within the QTL peak drop region and the second violet-red line is the SNP with the maximum LOD outside of the QTL peak drop region (only if the SNP inside the region does not have the overall maximum LOD score). Multiple lines may be plotted if multiple SNPs have the maximum LOD score. A second optional parameter, haplo_scan, allows plotting of the scan1() output around the genomic interval after the scan1 object is filtered with scan1_snpasso_rng().

Usage

1
2
3
4
5
plot_snpasso2(scan1output, snpinfo, max_peak, haplo_peak_drop = NULL,
  haplo_scan = NULL, genes = NULL, lodcolumn = 1,
  show_all_snps = TRUE, chr = NULL, add = FALSE, drop_hilit = NA,
  col_hilit = "violetred", col = "darkslateblue", gap = 25,
  minlod = 0, ...)

Arguments

scan1output

Output of scan1() using SNP probabilities derived by genoprob_to_snpprob().

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 - 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

max_peak

Numeric value in Mbps of the location of the haplotype's QTL peak. This can be obtained from max_scan1() 'pos' column.

haplo_peak_drop

A vector of length two containing the range of Mbps that have LOD scores within the QTL peak drop. This vector should be the output from lod_drop_rng().

haplo_scan

A dataframe containing the haplotype's LOD score and position around the genomic interval. The first column should contain the haplotype's LOD score, while the second column should be titled 'pos' and contain the Mbps positions. This dataframe should be the output from scan1_snpasso_rng().

genes

Optional data frame containing gene information for the region, with columns start and stop in Mbp, strand (as "-", "+", or NA), and Name. If included, a two-panel plot is produced, with SNP associations above and gene locations below.

lodcolumn

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

show_all_snps

If TRUE, expand to show all SNPs.

chr

Vector of character strings with chromosome IDs to plot.

add

If TRUE, add to current plot (must have same map and chromosomes).

drop_hilit

SNPs with LOD score within this amount of the maximum SNP association will be highlighted.

col_hilit

Color of highlighted points

col

Color of other points

gap

Gap between chromosomes.

minlod

Minimum LOD to display. (Mostly for GWAS, in which case using minlod=1 will greatly increase the plotting speed, since the vast majority of points would be omittted.

...

Additional graphics parameters.


duytpm16/qtl2utils documentation built on May 13, 2019, 6:08 p.m.