Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/combineBypathway_Kai_C.R
Calculate gene and pathway p-values using the Adaptive Rank Truncated Product test
1 | ARTP_pathway(obs.file, perm.file, nperm, temp.dir, gene.list=NULL, op=NULL)
|
obs.file |
The output file |
perm.file |
The output file |
nperm |
The number of permutations in the output file |
temp.dir |
A folder to keep temporary files that will be created. |
gene.list |
A list describing the gene-SNP data. See |
op |
List of options. See |
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 |
3 | 0.2 | 20, 40, 60 |
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.
Kai Yu
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.