Learn R Programming

ARTP (version 2.0.5)

ARTP_pathway: Gene and pathway p-values using ARTP

Description

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

Usage

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.

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.

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.

  • inspect.snp.n The number of candidate truncation points to inspect the top SNPs in a gene. The default is 1.

  • inspect.snp.percent A value x between 0 and 1 such that a truncation point will be defined at every x percent of the top SNPs. The default is 0 so that the truncation points will be 1:inspect.snp.n.

  • inspect.gene.n The number of candidate truncation points to inspect the top genes in the pathway. The default is 10.

  • inspect.gene.percent A value x between 0 and 1 such that a truncation point will be defined at every x percent of the top genes. The default is 0.05.

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

See Also

runPermutations

Examples

Run this code
# NOT RUN {
  # 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)

# }

Run the code above in your browser using DataLab