plotLZ: Plot Locuszoom-like graph for a location its GWAS P-value and...

Description Usage Arguments Value Author(s) See Also Examples

Description

Some additional details about this S4 generic and its methods. The extra blank line between this section and the title is critical for roxygen2 to differentiate the title from the description section.

Usage

1
2
3
plotLZ(x = "twk", interval = "ANY", snp = "data.frame",
  gmap = "list", window = "numeric", minP = "numeric",
  minR2 = "numeric", threads = "numeric", verbose = "numeric", ...)

Arguments

x

Integer representing the sorted state of the file.

interval

This parameter can be either a character string encoded as "CHR:POS" or a GenomicRanges object overlapping a single position.

snp

A data.frame with the input P-values and their positions and names. The column names "SNP", "Position", and "p" MUST exist in this data frame.

gmap

List of recombination hotspots for the species in question. The list entries MUST be data.frames having the columns "position", "COMBINED_rate.cM.Mb.", and "Genetic_Map.cM.". This data is provided for human build hg19 in rtomahawk. It can be loaded as follows: data(gmap)

window

Neighbourhood in base-pairs.

minP

Largest P-value to report.

minR2

Smallest R-squared (R2) value to report.

threads

Number of Tomahawk threads used to unpack and compute the association data.

verbose

Flag triggering verbose output (written to std::cerr). This will usually, but not always, be appropriately handled by R.

Value

Returns a twk object with the loaded data.

Author(s)

Marcus D. R. Klarqvist <mk819@cam.ac.uk> | <https://mdrk.me>

See Also

twk_data, twk_header, twk_filter, and twk

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
# This example assumes you have a Tomahawk file called "1kgp3_chr6.twk" in
# your current working directory.
twk2<-new("twk")
twk2@file.path <- "1kgp3_chr6.twk"

# Data from
# http://static.geneatlas.roslin.ed.ac.uk/gwas/allWhites/imputed/data.copy/imputed.allWhites.selfReported_n_1245.chr6.csv.gz
# http://static.geneatlas.roslin.ed.ac.uk/gwas/allWhites/snps/extended/snps.imputed.chr6.csv.gz
# This example assumes that these two files have been downloaded to your
# local Downloads directory.
library(data.table)
x<-fread("zcat ~/Downloads/imputed.allWhites.selfReported_n_1245.chr6.csv.gz", sep=" ")
snp<-fread("zcat ~/Downloads/snps.imputed.chr6.csv.gz", sep=" ")
snp<-snp[match(x$SNP,snp$SNP),]
# Transform raw P-values into negative log10-scaled space.
snp$p <- -log10(x$`PV-selfReported_n_1245`)

# Load recombination data for human hg19.
data(gmap)
z <- plotLZ(twk2, "6:20694884", snp, gmap, window = 1000000, minR2 = 0)
z
# Example using GenomicRanges class.
require(GenomicRanges)
g <- GRanges("6", IRanges(20694884, 20694884))
z <- plotLZ(twk2, g, snp, gmap, window = 1000000, minR2 = 0)
# With verbose output.
z <- plotLZ(twk2, g, snp, gmap, window = 1000000, minR2 = 0, verbose=TRUE)

mklarqvist/rtomahawk documentation built on May 16, 2019, 5:01 a.m.