snps_permutation: SNP-level permutations

Description Usage Arguments Value See Also Examples

Description

Performs SNP-level circular genomic permutations. In each permutation,
the complete set of SNP association p-values are permuted by rotation
with respect to the SNPs' genomic locations.
Once these 'simulated' p-values are assigned,the proportion of SNPs per
set above a pre-defined threshold is calculated

Usage

1
2
3
snps_permutation(ordered_alldata = "", pers_ids = "", ntraits = "", 
nper = 100, threshold = 0.05, seed=10,saveto = "workspace", 
gs_locs = "",envir ="")

Arguments

ordered_alldata

Return variable from "genome_order". Ordered genome and trait p-values

gs_locs

Return variable from "genome_order". SNP indexes

pers_ids

Return variable "per_ors" from "read2_paths". SNP indexes

ntraits

Traits INDEX to be analysed. Index according to "ordered_alldata".
Trait Columns index must start at 7. Example: ntraits=c(7:9), ntraits=7

nper

Number of permutations.Example: nper=1000

threshold

Threshold to be set by the hypergeometric test. threshold=0.05

seed

Set number for random sampling

saveto

Save permutation results to "workspace" OR "directory"

envir

R environment to save the Permutations to when saveto is set to "workspace"

Value

Returns "Permus_genesetsname" variables or files (permutation datasets).

See Also

genes_permutation

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
data(demo,SNPsAnnotation)
all_data <- read_pvals(data_name=demo,snps_ann=SNPsAnnotation)
genome_results <-genome_order(all_data=all_data)
	# Results from genome_order
	ordered_alldata <- genome_results$ordered_alldata
	gs_locs <- genome_results$gs_locs

# Create new environment to save the permutations to:
gper.env <- new.env()

data(RHSA164843,RHSA446343,RHSA8876384,RHSA8964572,RHSA109582,RHSA1474244,envir=gper.env)

paths_res <- read2_paths(ordered_alldata=ordered_alldata,gs_locs=gs_locs,
sets_from="workspace",sets_prefix="RHSA",level="snp",envir=gper.env)
		pers_ids <- paths_res$per_ors
		pathways<- paths_res$pathways

		
# SNP permutations
snps_permutation(ordered_alldata=ordered_alldata,pers_ids=pers_ids,
ntraits=c(7,9),nper=10,saveto="workspace",threshold=0.05,
gs_locs=gs_locs,envir = gper.env)

# Get results						
results <- get_results(res_pattern="Permus",level="snp",
from="workspace",threshold=0.05,envir = gper.env)

genomicper documentation built on May 8, 2021, 9:06 a.m.