Last data update: 2014.03.03
R: Co-Information based N-Order Epistasis Detector and...
CINOEDV-package R Documentation
Co-Information based N-Order Epistasis Detector and Visualizer
Description
Detecting and visualizing nonlinear interaction effects of single nucleotide polymorphisms or epistatic interactions, especially high-order epistatic interactions, are important topics in bioinformatics because of their significant mathematical and computational challenges. We present CINOEDV (Co-Information based N-Order Epistasis Detector and Visualizer) for detecting, visualizing, and analyzing high-order epistatic interactions by introducing virtual vertices into the construction of a hypergraph. CINOEDV was developed as an alternative to existing software to build a global picture of epistatic interactions and unexpected high-order epistatic interactions, which might provide useful clues for understanding the underlying genetic architecture of complex diseases.
Details
Package: CINOEDV
Type: Package
Version: 1.0
Date: 2014-05-02
License: GPL-2
###############################
## Normal Using type ##
###############################
result <- CINOEDV_Main()
#### Please input the file name with its format (.mat) that saves SNP data.
# test.mat
#### Please input the maximum order (1/2/3/4/5), and 3 is the Recommendation Option.
# 3
#### Please input the 1 ratio threshold.
# 1
#### Please input the 2 ratio threshold.
# 0.5
#### Please input the 3 ratio threshold.
# 0.8
#### Please input the 1 number threshold.
# 10
#### Please input the 2 number threshold.
# 20
#### Please input the 3 number threshold.
# 8
#### Please select the evaluation measure (1/2/3), and 1 is the Recommendation Option.
# 1
#### Please input the name of such file with (.mat) format.
# NA
Author(s)
Junliang Shang shangjunliang110@163.com
Examples
rm(list=ls())
File1 <- system.file("extdata","test.mat",package="CINOEDV")
File2 <- system.file("extdata","test1.mat",package="CINOEDV")
File3 <- system.file("extdata","test_Name.mat",package="CINOEDV")
File4 <- system.file("extdata","test1_Name.mat",package="CINOEDV")
FileName <- c(File1,File2)
MaxOrder <- 2
RThreshold <- c(1,1)
NThreshold <- c(10,10)
measure <- 1
SNFName <- c(File3,File4)
Stra <- 1
Pop <- 100
Iter <- 10
BatCINOEDV(FileName, MaxOrder, RThreshold, NThreshold, measure, Stra, Pop, Iter, SNFName)
###################
## Second ##
###################
# Install Packages
# InstallPackage()
# Check SNP data
FileName <- system.file("extdata","test.mat",package="CINOEDV")
Data <- InputData(FileName)
pts <- Data$pts
class <- Data$class
# Check MaxOrder
MaxOrder <- 2
TestMaxOrder(as.character(MaxOrder))
MaxOrder <- as.numeric(MaxOrder)
# Check RatioThreshold
RatioThreshold <- c(1,1)
TestRatioThreshold(MaxOrder,as.character(RatioThreshold))
RatioThreshold <- as.numeric(RatioThreshold)
# Check NumberThreshold
NumberThreshold <- c(10,10)
TestNumberThreshold(MaxOrder,as.character(NumberThreshold))
NumberThreshold <- as.numeric(NumberThreshold)
# Check measure
measure <- 1
# Check SNPNameFileName
SNPNameFileName <- system.file("extdata","test_Name.mat",package="CINOEDV")
SNPNames <- TestSNPNameFile(ncol(pts),as.character(SNPNameFileName))
SNPNames <- SNPNames$SNPNames
# Define file name which is used for saving results.
SaveFileName <- "TEST_RESULT_"
# Search Strategies
Effect <- ExhaustiveSearch(pts,class,MaxOrder,measure,0)
SingleEffect <- Effect$SingleEffect
TwoEffect <- Effect$TwoEffect
ThreeEffect <- Effect$ThreeEffect
FourEffect <- Effect$FourEffect
FiveEffect <- Effect$FiveEffect
# Normalization
Effect <- NormalizationEffect(MaxOrder,SingleEffect,TwoEffect,ThreeEffect,FourEffect
,FiveEffect,SaveFileName)
SingleEffect <- Effect$SingleEffect
TwoEffect <- Effect$TwoEffect
ThreeEffect <- Effect$ThreeEffect
FourEffect <- Effect$FourEffect
FiveEffect <- Effect$FiveEffect
# SNP Name Notation
Effect <- NotationName(MaxOrder,SingleEffect,TwoEffect,ThreeEffect,FourEffect
,FiveEffect,SNPNames)
SingleEffect <- Effect$SingleEffect
TwoEffect <- Effect$TwoEffect
ThreeEffect <- Effect$ThreeEffect
FourEffect <- Effect$FourEffect
FiveEffect <- Effect$FiveEffect
# Collect Vertices and Edges
GraphData <- NetworkData(SingleEffect,TwoEffect,ThreeEffect,FourEffect,
FiveEffect,RatioThreshold,NumberThreshold)
Edges <- GraphData$edges
Vertices <- GraphData$vertices
# Construct Complete Graph
ConstructCompleteGraph(Vertices,Edges,6,SaveFileName)
# Plot Top Effects
TpEffect <- PlotTopEffects(Vertices,20,SaveFileName)
TopEffect <- TpEffect$TopEffect
CombinationEffect <- TpEffect$CombinationEffect
# Degree Analysis
Degrees <- DegreeAnalysis(Vertices,Edges,SaveFileName)
Degrees <- Degrees$Degrees
print(Degrees)
# Split subgraphs
SubgraphSNPs <- SubgraphSplit(Vertices,Edges)
SubgraphSNPs <- SubgraphSNPs$SubgroupSNPs
# heatmap Factor
HeatMapFactors <- HeatMapFactor(pts,class,factor = c(5, 8),SaveFileName,Title ="")
HeatMapFactors <- HeatMapFactors$HeatMapFactors
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(CINOEDV)
Loading required package: R.matlab
R.matlab v3.5.1 (2016-03-27) successfully loaded. See ?R.matlab for help.
Attaching package: 'R.matlab'
The following objects are masked from 'package:base':
getOption, isOpen
Loading required package: igraph
Attaching package: 'igraph'
The following objects are masked from 'package:stats':
decompose, spectrum
The following object is masked from 'package:base':
union
Loading required package: ggplot2
Loading required package: reshape2
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/CINOEDV/CINOEDV-package.Rd_%03d_medium.png", width=480, height=480)
> ### Name: CINOEDV-package
> ### Title: Co-Information based N-Order Epistasis Detector and Visualizer
> ### Aliases: CINOEDV-package CINOEDV
> ### Keywords: package
>
> ### ** Examples
>
>
> rm(list=ls())
>
> File1 <- system.file("extdata","test.mat",package="CINOEDV")
> File2 <- system.file("extdata","test1.mat",package="CINOEDV")
> File3 <- system.file("extdata","test_Name.mat",package="CINOEDV")
> File4 <- system.file("extdata","test1_Name.mat",package="CINOEDV")
>
> FileName <- c(File1,File2)
> MaxOrder <- 2
> RThreshold <- c(1,1)
> NThreshold <- c(10,10)
> measure <- 1
> SNFName <- c(File3,File4)
> Stra <- 1
> Pop <- 100
> Iter <- 10
>
> BatCINOEDV(FileName, MaxOrder, RThreshold, NThreshold, measure, Stra, Pop, Iter, SNFName)
The Maximum order : 2
The RatioThreshold : 1 1
The NumberThreshold : 10 10
The input file is : /home/ddbj/local/lib64/R/library/CINOEDV/extdata/test.mat
Samples: 4000
Cases: 2000
Controls: 2000
SNPs: 10
The SNP Name File : /home/ddbj/local/lib64/R/library/CINOEDV/extdata/test_Name.mat
#### Search Results ####
Please waiting for the search ...
Exhaustive Search !
1-order effect computing ...
elapsed
0.018
2-order effect computing ...
elapsed
0.216
#### Normalization ####
dev.new(): using pdf(file="Rplots27.pdf")
#### SNP Name Notation ####
#### Collect Vertices and Edges ####
#### Construct Complete Graph ####
dev.new(): using pdf(file="Rplots28.pdf")
#### Plot Top Effects ####
dev.new(): using pdf(file="Rplots30.pdf")
#### Degree Analysis ####
dev.new(): using pdf(file="Rplots31.pdf")
SNP Degree
[1,] "SNP5" "4"
[2,] "SNP4" "3"
[3,] "SNP7" "3"
[4,] "SNP10" "3"
[5,] "SNP8" "2"
[6,] "SNP1" "2"
[7,] "SNP6" "2"
[8,] "SNP3" "1"
[9,] "SNP2" "0"
[10,] "SNP9" "0"
#### Split subgraphs ####
dev.new(): using pdf(file="Rplots34.pdf")
The input file is : /home/ddbj/local/lib64/R/library/CINOEDV/extdata/test1.mat
Samples: 4000
Cases: 2000
Controls: 2000
SNPs: 20
The SNP Name File : /home/ddbj/local/lib64/R/library/CINOEDV/extdata/test1_Name.mat
#### Search Results ####
Please waiting for the search ...
Exhaustive Search !
1-order effect computing ...
elapsed
0.05
2-order effect computing ...
elapsed
0.944
#### Normalization ####
dev.new(): using pdf(file="Rplots37.pdf")
#### SNP Name Notation ####
#### Collect Vertices and Edges ####
#### Construct Complete Graph ####
dev.new(): using pdf(file="Rplots38.pdf")
#### Plot Top Effects ####
dev.new(): using pdf(file="Rplots39.pdf")
#### Degree Analysis ####
dev.new(): using pdf(file="Rplots40.pdf")
SNP Degree
[1,] "rs00013" "4"
[2,] "rs00005" "3"
[3,] "rs00015" "2"
[4,] "rs00002" "2"
[5,] "rs00019" "2"
[6,] "rs00016" "2"
[7,] "rs00008" "1"
[8,] "rs00011" "1"
[9,] "rs00017" "1"
[10,] "rs00020" "1"
[11,] "rs00014" "1"
[12,] "rs00010" "0"
[13,] "rs00006" "0"
[14,] "rs00001" "0"
[15,] "rs00007" "0"
#### Split subgraphs ####
dev.new(): using pdf(file="Rplots41.pdf")
############################
##### Finish #####
############################
>
>
> ###################
> ## Second ##
> ###################
>
> # Install Packages
> # InstallPackage()
>
> # Check SNP data
> FileName <- system.file("extdata","test.mat",package="CINOEDV")
> Data <- InputData(FileName)
The input file is : /home/ddbj/local/lib64/R/library/CINOEDV/extdata/test.mat
Samples: 4000
Cases: 2000
Controls: 2000
SNPs: 10
> pts <- Data$pts
> class <- Data$class
>
> # Check MaxOrder
> MaxOrder <- 2
> TestMaxOrder(as.character(MaxOrder))
The Maximum order : 2
> MaxOrder <- as.numeric(MaxOrder)
>
> # Check RatioThreshold
> RatioThreshold <- c(1,1)
> TestRatioThreshold(MaxOrder,as.character(RatioThreshold))
The RatioThreshold : 1 1
> RatioThreshold <- as.numeric(RatioThreshold)
>
> # Check NumberThreshold
> NumberThreshold <- c(10,10)
> TestNumberThreshold(MaxOrder,as.character(NumberThreshold))
The NumberThreshold : 10 10
> NumberThreshold <- as.numeric(NumberThreshold)
>
> # Check measure
> measure <- 1
>
> # Check SNPNameFileName
> SNPNameFileName <- system.file("extdata","test_Name.mat",package="CINOEDV")
> SNPNames <- TestSNPNameFile(ncol(pts),as.character(SNPNameFileName))
The SNP Name File : /home/ddbj/local/lib64/R/library/CINOEDV/extdata/test_Name.mat
> SNPNames <- SNPNames$SNPNames
>
> # Define file name which is used for saving results.
> SaveFileName <- "TEST_RESULT_"
>
> # Search Strategies
> Effect <- ExhaustiveSearch(pts,class,MaxOrder,measure,0)
Exhaustive Search !
1-order effect computing ...
elapsed
0.013
2-order effect computing ...
elapsed
0.149
> SingleEffect <- Effect$SingleEffect
> TwoEffect <- Effect$TwoEffect
> ThreeEffect <- Effect$ThreeEffect
> FourEffect <- Effect$FourEffect
> FiveEffect <- Effect$FiveEffect
>
> # Normalization
> Effect <- NormalizationEffect(MaxOrder,SingleEffect,TwoEffect,ThreeEffect,FourEffect
+ ,FiveEffect,SaveFileName)
dev.new(): using pdf(file="Rplots42.pdf")
>
> SingleEffect <- Effect$SingleEffect
> TwoEffect <- Effect$TwoEffect
> ThreeEffect <- Effect$ThreeEffect
> FourEffect <- Effect$FourEffect
> FiveEffect <- Effect$FiveEffect
>
> # SNP Name Notation
> Effect <- NotationName(MaxOrder,SingleEffect,TwoEffect,ThreeEffect,FourEffect
+ ,FiveEffect,SNPNames)
>
> SingleEffect <- Effect$SingleEffect
> TwoEffect <- Effect$TwoEffect
> ThreeEffect <- Effect$ThreeEffect
> FourEffect <- Effect$FourEffect
> FiveEffect <- Effect$FiveEffect
>
> # Collect Vertices and Edges
> GraphData <- NetworkData(SingleEffect,TwoEffect,ThreeEffect,FourEffect,
+ FiveEffect,RatioThreshold,NumberThreshold)
> Edges <- GraphData$edges
> Vertices <- GraphData$vertices
>
> # Construct Complete Graph
> ConstructCompleteGraph(Vertices,Edges,6,SaveFileName)
dev.new(): using pdf(file="Rplots43.pdf")
>
> # Plot Top Effects
> TpEffect <- PlotTopEffects(Vertices,20,SaveFileName)
dev.new(): using pdf(file="Rplots44.pdf")
> TopEffect <- TpEffect$TopEffect
> CombinationEffect <- TpEffect$CombinationEffect
>
> # Degree Analysis
> Degrees <- DegreeAnalysis(Vertices,Edges,SaveFileName)
dev.new(): using pdf(file="Rplots45.pdf")
> Degrees <- Degrees$Degrees
> print(Degrees)
SNP Degree
[1,] "SNP5" "4"
[2,] "SNP4" "3"
[3,] "SNP7" "3"
[4,] "SNP10" "3"
[5,] "SNP8" "2"
[6,] "SNP1" "2"
[7,] "SNP6" "2"
[8,] "SNP3" "1"
[9,] "SNP2" "0"
[10,] "SNP9" "0"
>
> # Split subgraphs
> SubgraphSNPs <- SubgraphSplit(Vertices,Edges)
> SubgraphSNPs <- SubgraphSNPs$SubgroupSNPs
>
> # heatmap Factor
> HeatMapFactors <- HeatMapFactor(pts,class,factor = c(5, 8),SaveFileName,Title ="")
dev.new(): using pdf(file="Rplots46.pdf")
> HeatMapFactors <- HeatMapFactors$HeatMapFactors
>
>
>
>
>
>
> dev.off()
pdf
2
>