Description Usage Arguments Value Author(s) See Also Examples
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.
1 2 3 |
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. |
Returns a twk
object with the loaded data.
Marcus D. R. Klarqvist <mk819@cam.ac.uk> | <https://mdrk.me>
twk_data
, twk_header
,
twk_filter
, and twk
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.