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, 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

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
# library(genomicper)
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
data(hsa00100,hsa00120,hsa00130,hsa00140,hsa00190,hsa02010)	
paths_res <- read2_paths(ordered_alldata=ordered_alldata,gs_locs=gs_locs,
sets_from="workspace",sets_prefix="hsa",level="snp",envir=.GlobalEnv)
		pers_ids <- paths_res$per_ors
		pathways<- paths_res$pathways

# Create new environment to save the permutations to:
gper.env <- new.env()
		
# 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)

Example output

[1] "Arguments set:"
demo
SNPsAnnotation
[1] "workspace"
[1] "Number of SNPs without location and removed:0"
[1] "Arguments set:"
[1] "Ordered dataset: ordered_alldata"
[1] "Gene Annotations:  gs_locs"
[1] "Gene-sets Location:  workspace"
[1] "Gene-sets prefix:  hsa"
[1] "Annotation level:  snp"
[1] "Arguments"
[1] "Ordered dataset: ordered_alldata"
[1] "Indexes of SNP Annotations:  pers_ids"
[1] "Indexes of Traits to Analyse: 7" "Indexes of Traits to Analyse: 9"
[1] "Traits: abpi"     "Traits: abpildfa"
[1] "Number of permutations:  10"
[1] "Threshold:  0.05"
[1] "Permutation Results save to:  workspace"
[1] "hsa00140"

genomicper documentation built on May 1, 2019, 8:44 p.m.