ARTP_pathway: Gene and pathway p-values using ARTP

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/combineBypathway_Kai_C.R

Description

Calculate gene and pathway p-values using the Adaptive Rank Truncated Product test

Usage

1
ARTP_pathway(obs.file, perm.file, nperm, temp.dir, gene.list=NULL, op=NULL)

Arguments

obs.file

The output file obs.outfile from runPermutations or a file with the SNP ids and p-values (see details).

perm.file

The output file perm.outfile from runPermutations or a files with the SNP ids and p-values (see details).

nperm

The number of permutations in the output file perm.outfile from runPermutations

temp.dir

A folder to keep temporary files that will be created.

gene.list

A list describing the gene-SNP data. See gene.list. If NULL, then it is assumed that all SNPs belong to the same gene. The default value is NULL.

op

List of options. See details.

Details

If the p-values are not computed using runPermutations, then the format for obs.file and perm.file should be as follows. Both files must be uncompressed, comma seperated files with the first row as the SNP ids in the same order. Row 2 of obs.file has the observed p-values, and starting from row 2 in perm.file are the permuted p-values.

A random seed should be set before calling ARTP_pathway in order to reproduce results. The randomness is due to the ranking of p-values, where ties are broken randomly.

Options list:
Below are the names for the options list op. All names have default values if they are not specified.

Assume the number of SNPs in a gene is 100. Below are examples of the truncation points for different values of inspect.snp.n and inspect.snp.percent.

inspect.snp.n inspect.snp.percent truncation points
1 0 1
1 0.05 5
1 0.25 25
1 1 100
2 0 1, 2
2 0.05 5, 10
2 0.25 25, 50
2 1 100
3 0.2 20, 40, 60

Value

The returned value is a list with names "pathway.pvalue" and "gene.table". pathway.pvalue is the ARTP p-value for the pathway. gene.table is a data frame containing the gene name, number of SNPs in the gene that were included in the analysis, and the ARTP p-value for the gene.

Author(s)

Kai Yu

See Also

runPermutations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
  # Get the file of observed p-values
 obs_file <- system.file("sampleData", "obs_pvalues.txt", package="ARTP")

 # Get the file of permutation p-values
 perm_file <- system.file("sampleData", "perm_pvalues.txt", package="ARTP")

 # Define the gene-SNP list
 gs_file <- system.file("sampleData", "gene_SNP_data.txt", package="ARTP") 
 gene.list <- list(file=gs_file, delimiter="\t", header=1, 
                   snp.var="SNP", gene.var="Gene")

 # Call the ARTP function
 nperm <- 100  # The number of permutations in perm_file
 temp.dir <- "C:/temp/"
 set.seed(123)
 # ARTP_pathway(obs_file, perm_file, nperm, temp.dir, gene.list=gene.list)

 # Now asume that all SNPs belong to the same gene
 # ARTP_pathway(obs_file, perm_file, nperm, temp.dir)

ARTP documentation built on May 2, 2019, 6:51 a.m.