Learn R Programming

genomicper (version 1.6)

plot_results: Plot Results Circular Permutation

Description

QQ plots

Usage

plot_results(results="",by="",plot_all=TRUE, var = "", save_plot=TRUE, plot_name="", bf= FALSE , save_qq = TRUE)

Arguments

results
Results datarame from "get_results()"
by
Visualize results by "trait" OR by "set"
plot_all
plot_all = TRUE plots all the variables in the results dataframe and saves a pdf file in the working directory. Setting plot_all to FALSE plots a single variable(trait or set). The argument "var" must be declared.
var
Variable name to plot
save_plot
save_plot = TRUE saves the plots in the working directory. save_plot = FALSE the plot is visualized at the console. save_plot = FALSE can be used only when plot_all is set to FALSE. The plot displayed at the console is interactive, clicking on a point displays the points name.
plot_name
Argument used to save the file name for the plots. Default value = Results_genomicper_[set/trait]
bf
Displays the bonferroni correction
save_qq
TRUE returns the qq plot values

Value

qq
Data frame with qq plot values

See Also

get_results

Examples

Run this code
#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()

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)

results <- get_results(res_pattern="Permus",level="snp",
from="workspace",threshold=0.05,envir = gper.env)
## Not run: 
# #saves plots to working directory
# qq <- plot_results(results=results,by="set",plot_all=TRUE)
# qq <- plot_results(results=results,by="trait",plot_all=FALSE,var="trait1")
# qq <- plot_results(results=results,by="set",
# 	plot_all=FALSE,var="hsa00100",
# 	save_plot=FALSE) ## IMPORTANT: to EXIT interactive plot 
# 	## right click on the plot to stop
# ## End(Not run)

Run the code above in your browser using DataLab