Title: | Inferring Directional Conservative Causal Core Gene Networks |
---|---|
Description: | Infers directional conservative causal core (gene) networks. It is an advanced version of the algorithm C3NET by providing directional network. Gokmen Altay (2018) <doi:10.1101/271031>, bioRxiv. |
Authors: | Gokmen Altay |
Maintainer: | Gokmen Altay <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.2.2 |
Built: | 2024-11-16 03:18:16 UTC |
Source: | https://github.com/cran/Ac3net |
Ac3net
A quick way to implement Ac3net algorithm with a single function.
Ac3net(DataOrMim, processed=FALSE, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96, cutoff=0, estmethod='pearson', pval=1, iterations=10, MTC=FALSE, MTCmethod="BH" )
Ac3net(DataOrMim, processed=FALSE, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96, cutoff=0, estmethod='pearson', pval=1, iterations=10, MTC=FALSE, MTCmethod="BH" )
DataOrMim |
It can be an adjacency matrix or data matrix. If adjacency matrix then the element at row i and column j corresponds to the correlation or mutual information between variables row i and column j. Rows and columns must have the variable names. Also the 'processed' parameter must be set to TRUE. If it is data matrix then rows are variables and columns are the samples. Rows must have the variable names. Also the 'processed' parameter is already set to FALSE as the default usage case is data matrix. |
processed |
Set to FALSE if the input is a data matrix, set to TRUE if the input is adjacency matrix. |
ratio_ |
The ratio of all the elements in the input adjacency matrix (even if the matrix is symmetric), which the user considers as significant portion. |
PCmincutoff |
The minimum absolute Pearson correlation value ( by default but can be different) where the below of is not considered as significant. |
PCmaxcutoff |
The maximum absolute Pearson correlation value ( by default but can be different) where all the above of is considered as significant. |
cutoff |
Default is 0 means inactive. If set, it must be betwen 0 and 1, and the input ise used directly as cutoff. |
estmethod |
The default method is 'pearson' assuming that the data was normalized (at least with Log-2). If the data is not normalized, its recomended setting is 'spearman'. |
pval |
Default is 1, means do not use p-values cutoff. If < 1, then the corresponding cutoff is calculated and the adjacency matrix is filtered based on this cutoff calculated by the input pval p-value. |
iterations |
Number of iterations to get null distribuiton from multiple shuffling of the data. |
MTC |
If TRUE,as the default status, the the returned p-value matrix has the adjusted p-values |
MTCmethod |
The Multiple Testing Correction method. BH is default. See R p.adjust function for options. |
Ac3net
The input can be an adjacency matrix or data matrix. If adjacency matrix then the element at row i and column j corresponds to the correlation or mutual information between variables row i and column j. Rows and columns must have the variable names. Also the 'processed' parameter must be set to TRUE. If it is data matrix then rows are variables and columns are the samples. Rows must have the variable names. Also the 'processed' parameter is already set to FALSE as the default usage case is data matrix.
If MTC is set to TRUE then it sliminates non-significants based on adjusted p-values but this process takes too long.
If MTC is set to FALSE as default then cutoff parameter is used.
If the cutoff parameter is set to a value other than 0, then it is used as cutoff directly.
If the cutoff wanted to be calculated very quicly, for comparison purposes for example, then first it is set to 0 as default and then it is calculated between minimum and maximum input cutoffs as the value that correspond to the input ratio_ parameter from top to down.
Ac3net
returns a network matrix where the first column is the variable names of the input adjacency matrix and second columns have the variables names that correspond to the absolute maximum value for the variable in the first column.
Gokmen Altay
G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018. G. Altay, F. Emmert-Streib, "Inferring the conservative causal core of gene regulatory networks", BMC Systems Biology (2010) 4:132.
Ac3net.maxmim
, Ac3net.commonlinks
,
# data(expdata) # ac3net.net <- Ac3net(DataOrMim=expdata, processed=FALSE, ratio_ = 0.002, PCmincutoff=0.6, # PCmaxcutoff=0.96, cutoff=0, estmethod='pearson', pval=1, # iterations=10, MTC=FALSE, MTCmethod="BH" )
# data(expdata) # ac3net.net <- Ac3net(DataOrMim=expdata, processed=FALSE, ratio_ = 0.002, PCmincutoff=0.6, # PCmaxcutoff=0.96, cutoff=0, estmethod='pearson', pval=1, # iterations=10, MTC=FALSE, MTCmethod="BH" )
Ac3net.commonlinks
takes two network list matrices and returns directional or undirectional common pairs between the two regarding the first two columns of the networks.
Ac3net.commonlinks(net1,net2, directed=TRUE)
Ac3net.commonlinks(net1,net2, directed=TRUE)
net1 |
A matrix that represents the links between two variables at each row. Namely, the element at row i and column 1 and the element at row i and column 2 are assumed to be paired or linked. There is no connection assumed among rows. |
net2 |
A matrix that represents the links between two variables at each row. Namely, the element at row i and column 1 and the element at row i and column 2 are assumed to be paired or linked. There is no connection assumed among rows. |
directed |
It is TRUE by default, which means there is directionality assumed from column 1 to column 2 at each matrices. Therefore common links are the directionale common links. If it is FALSE, then the pairs assumed to be undirectional and all the common pairs are taken as common. E.g. If there is A–B in net1 and B–A in net2 then they are considered as common. |
Ac3net.commonlinks
takes two network list matrices and based on the first two columns it makes comparison. If the argument directed is equal to TRUE, as in the default case, the it returns only directionally common pairs from column 1 to column 2 of the matrices. E.g. For a pair of A–>B in the first network, if there is also A–>B in the second network then it is taken as common but the opposite direction B–>A is not counted. If the argument directed is equal to FALSE, then B–>A is also counted, namely all the common pairs, with no directional considerations, is taken as common between the two network.
Ac3net.commonlinks
returns a network matrix that correspond to the common pairs between net1 and net2.
Gokmen Altay
G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018. G. Altay, F. Emmert-Streib, "Inferring the conservative causal core of gene regulatory networks", BMC Systems Biology (2010) 4:132.
# net1 # net2 # net <- Ac3net.commonlinks(net1,net2, directed=TRUE)
# net1 # net2 # net <- Ac3net.commonlinks(net1,net2, directed=TRUE)
Ac3net.cutoff
A quick way to get a very rough estimate of the cutoff value for the significants of the input adjacency matrix
Ac3net.cutoff(mim, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96)
Ac3net.cutoff(mim, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96)
mim |
An adjacency matrix, where the element at row i and column j corresponds to the correlation or mutual information between variables row i and column j. Row and columns of the matrix must have the variable names. |
ratio_ |
The ratio of all the elements in the input adjacency matrix (even if the matrix is symmetric), which the user considers as significant portion. |
PCmincutoff |
The minimum absolute Pearson correlation value ( by default but can be different) where the below of is not considered as significant. |
PCmaxcutoff |
The maximum absolute Pearson correlation value ( by default but can be different) where all the above of is considered as significant. |
Ac3net.cutoff
takes an adjacency matrix, ratio and minimum absolute Pearson correlation information. Then return a cutoff value that either correspond to the input ratio or the minimum.
Ac3net.cutoff
returns a scaler as a very rough estimate of the cutoff value for the significants of the input adjacency matrix.
Gokmen Altay
G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018. G. Altay, F. Emmert-Streib, "Inferring the conservative causal core of gene regulatory networks", BMC Systems Biology (2010) 4:132.
Ac3net.maxmim
, Ac3net.commonlinks
,
data(expdata) mim <- cor(t(expdata), method = 'pearson') cutoff <- Ac3net.cutoff(mim=mim, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96)
data(expdata) mim <- cor(t(expdata), method = 'pearson') cutoff <- Ac3net.cutoff(mim=mim, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96)
Ac3net.filtersames
The correlations of the same variables are set to zero as they are likly to have the maximum correlations already.
Ac3net.filtersames(mim)
Ac3net.filtersames(mim)
mim |
An adjacency matrix, where the element at row i and column j corresponds to the correlation or mutual information between variables row i and column j. Row and columns of the matrix must have the variable names. Row names must be available. |
Ac3net.filtersames
takes an adjacency matrix with variable names are on the rows. Then it sets 0 for the self correlations of the variables by checking their names.
Ac3net.filtersames
returns an adjacency matrix with no self dependency.
Gokmen Altay
G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018.
Ac3net.maxmim
, Ac3net.commonlinks
,
# data(expdata) # mim <- cor(t(expdata), method = 'pearson') # mim <- Ac3net.filtersames(mim)
# data(expdata) # mim <- cor(t(expdata), method = 'pearson') # mim <- Ac3net.filtersames(mim)
Ac3net.getDifferentLinks
takes two network list matrices and returns directional or undirectional different pairs between the two regarding the first two columns of the networks.
Ac3net.getDifferentLinks(net1,net2, directed=TRUE)
Ac3net.getDifferentLinks(net1,net2, directed=TRUE)
net1 |
A matrix that represents the links between two variables at each row. Namely, the element at row i and column 1 and the element at row i and column 2 are assumed to be paired or linked. There is no connection assumed among rows. |
net2 |
A matrix that represents the links between two variables at each row. Namely, the element at row i and column 1 and the element at row i and column 2 are assumed to be paired or linked. There is no connection assumed among rows. |
directed |
It is TRUE by default, which means there is directionality assumed from column 1 to column 2 at each matrices. if TRUE, then selects only the different links from A–>B with respect to net2. If it is FALSE, then the pairs assumed to be undirectional and all the dual pairs are considered as common and filtered. E.g. If there is A–B in net1 and B–A in net2 then they are considered as common and filtered out. |
Ac3net.getDifferentLinks
takes two network list matrices and based on the first two columns it makes comparison. If the argument directed is equal to TRUE, as in the default case, the it returns only directionally different pairs from column 1 to column 2 of the matrices. E.g. For a pair of A–>B in the first network, if there is also A–>B in the second network then it is taken as common and filtered out but the opposite direction B–>A is not counted. If the argument directed is equal to FALSE, then B–>A is also counted and filtered out as well for net1 with compared to net2.
Ac3net.getDifferentLinks
returns a network matrix that correspond to the different pairs of net1 with compared to net2.
Gokmen Altay
G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018. G. Altay, F. Emmert-Streib, "Inferring the conservative causal core of gene regulatory networks", BMC Systems Biology (2010) 4:132.
# net1 # net2 # diffnet <- Ac3net.getDifferentLinks(net1,net2, directed=TRUE)
# net1 # net2 # diffnet <- Ac3net.getDifferentLinks(net1,net2, directed=TRUE)
Ac3net.getDirectedOrDualLinks
takes a network list matrix and returns a unique network; either directionals or the duals.
Ac3net.getDirectedOrDualLinks(net1, dual_=FALSE)
Ac3net.getDirectedOrDualLinks(net1, dual_=FALSE)
net1 |
A matrix that represents the links between two variables at each row. Namely, the element at row i and column 1 and the element at row i and column 2 are assumed to be paired or linked. There is no connection assumed among rows. |
dual_ |
It is FALSE by default, which means there is directionality assumed from column 1 to column 2 at each matrices. A–B and B–A is cases filtered out. If TRUE, then only the dual pairs selected. |
Ac3net.getDirectedOrDualLinks
takes a network list matrix and returns a unique network; either directionals or the duals. If directed=TRUE then it is the unique pairs from column 1 to column 2. If directed=FALSE then it is the unique dual pairs (selects if and only if A–B and B–A exist).
directional or undirectional common pairs between the two regarding the first two columns of the networks.
Ac3net.getDirectedOrDualLinks
returns a unique network matrix.
Gokmen Altay
G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018. G. Altay, F. Emmert-Streib, "Inferring the conservative causal core of gene regulatory networks", BMC Systems Biology (2010) 4:132.
# net1 # net <- Ac3net.getDirectedOrDualLinks(net1, dual_=FALSE)
# net1 # net <- Ac3net.getDirectedOrDualLinks(net1, dual_=FALSE)
Ac3net.maxmim
takes an adjacency matrix and returns the pairs with the absolute maximum correlated partner of each variable on the rows.
Ac3net.maxmim(mim_, net_= TRUE, cutoff_=0)
Ac3net.maxmim(mim_, net_= TRUE, cutoff_=0)
mim_ |
An adjacency matrix, where the element at row i and column j corresponds to the correlation or mutual information between variables row i and column. Row and columns of the matrix must have the variable names. |
net_ |
If equal to TRUE, then it returns a sorted list of interaction of Ac3net algorithm. The significance cutoff values needs to be set in this case. In this case the resulting network directions is shown by Source and Target columns to make it look intuitive and avoid confusion in general. If equal to FALSE, then it only returns the maximum valued partner for each gene by the rows of the matrix, not sorted and no filtered by the cutoff. The gene of interest is in the second column and its maximum valued partner is in the first column, similar to above. |
cutoff_ |
A scaler cutoff magnitude above which is considered as significant dependecny score. |
Ac3net.maxmim
takes an adjacency matrix and returns the pairs with the absolute maximum correlated partner.
Ac3net.maxmim
returns a network matrix where the second column is the variable names of the row names of the input adjacency matrix and second columns have the variables names that correspond to the absolute maximum value for the variables in the second column. If net_ is TRUE, then this list of gene pairs are further filtered out based on the cutoff and sorted, which results the inferred network of Ac3net algorithm. If net_ is FALSE, the it only returns the maximum valued partner of each variable of the input matrix.
Gokmen Altay
G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018. G. Altay, F. Emmert-Streib, "Inferring the conservative causal core of gene regulatory networks", BMC Systems Biology (2010) 4:132.
Ac3net.commonlinks
, Ac3net.cutoff
,
# data(expdata) # mim <- cor(t(expdata), method = 'pearson') # mim <- Ac3net.filtersames(mim) # cutoff <- Ac3net.cutoff(mim=mim, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96) # Ac3net.net <- Ac3net.maxmim(mim_= mim, net_=TRUE, cutoff_= cutoff)
# data(expdata) # mim <- cor(t(expdata), method = 'pearson') # mim <- Ac3net.filtersames(mim) # cutoff <- Ac3net.cutoff(mim=mim, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96) # Ac3net.net <- Ac3net.maxmim(mim_= mim, net_=TRUE, cutoff_= cutoff)
Ac3net.MTC
Return adjusted p-values of the adjancency matrix.
Ac3net.MTC(data, iterations=10, MTC=TRUE, MTCmethod="BH", estmethod='pearson')
Ac3net.MTC(data, iterations=10, MTC=TRUE, MTCmethod="BH", estmethod='pearson')
data |
Data matrix where rows are variables and columns are the samples. Rows must have the variable names |
iterations |
Number of iterations to get null distribuiton from multiple shuffling of the data. |
MTC |
If TRUE,as the default status, the the returned p-value matrix has the adjusted p-values |
MTCmethod |
The Multiple Testing Correction method. BH is default. See R p.adjust function for options. |
estmethod |
The default method is 'pearson' assuming that the data was normalized (at least with Log-2). If the data is not normalized, its recomended setting is 'spearman'. |
Ac3net.MTC
takes a data matrix and returns the adjusted p-values matrix that correspond to the adjacency matrix of the input data. This way varios p-values can be tried to get different cutoff values without re-calculating the p-values.
Ac3net.MTC
returns a default adjusted p-values matrix that corresponds to the input adjacency matrix. If MTC is set to FALSE then it returns raw p-values.
Gokmen Altay
G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018. G. Altay, F. Emmert-Streib, "Inferring the conservative causal core of gene regulatory networks", BMC Systems Biology (2010) 4:132.
Ac3net.maxmim
, Ac3net.commonlinks
,
#data(expdata) #mim.pvals <- Ac3net.MTC(data = expdata, iterations=10, # MTC=TRUE, MTCmethod="BH", estmethod='pearson')
#data(expdata) #mim.pvals <- Ac3net.MTC(data = expdata, iterations=10, # MTC=TRUE, MTCmethod="BH", estmethod='pearson')
Ac3net.performance
takes two network list matrices. First is the predicted network and second is the reference true network. Returns performance scores.
Ac3net.performance(predictNet, referenceNet, data_, directed=TRUE)
Ac3net.performance(predictNet, referenceNet, data_, directed=TRUE)
predictNet |
The predicted network. A matrix that represents the links between two variables at each row. Namely, the element at row i and column 1 and the element at row i and column 2 are assumed to be paired or linked. There is no connection assumed among rows. |
referenceNet |
The reference network over which the performance will ve evaluated. A matrix that represents the links between two variables at each row. Namely, the element at row i and column 1 and the element at row i and column 2 are assumed to be paired or linked. There is no connection assumed among rows. |
data_ |
The data matrix where the variables are available as row names of it. Only row names will be used to get all the variable names for the analaysis. |
directed |
It is TRUE by default, which means there is directionality assumed from column 1 to column 2 at each matrices. Therefore common links are the directionale common links. If it is FALSE, then the pairs assumed to be undirectional and all the common pairs are taken as common. E.g. If there is A–B in net1 and B–A in net2 then they are considered as common. |
Ac3net.performance
takes two network list matrices and based on the first two columns it makes comparison betwee the predicted network and the reference network. If the argument directed is equal to TRUE, as in the default case, then it assumes directionally from column 1 to column 2 of the matrices and computes the performance based on it. E.g. For a pair of A–>B in the predicted network, if there is also A–>B in the reference network then it is taken as True Positive (TP) but the opposite direction B–>A is not accepted as TP. If the argument directed is equal to FALSE, then eitherA–>B or B–>A is acepted as TP, with no directional considerations.
Ac3net.performance
returns an object with all the performance scores.
Gokmen Altay
G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018. G. Altay, F. Emmert-Streib, "Inferring the conservative causal core of gene regulatory networks", BMC Systems Biology (2010) 4:132.
# data(expdata) # data(truenet) # data(zeroindx) # zero indices for the example dataset, not in general. ## step by step to get Ac3net network # mim <- cor(t(expdata), method = "pearson") # mim[zeroindx, zeroindx] <- 0 #for the example dataset, not in general. # mim <- Ac3net.filtersames(mim=mim) #in case if there are same variables. #diag(mim) <-0 #cutoff <- Ac3net.cutoff(mim, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96) #mim[abs(mim) < cutoff] <- 0 #Ac3net.net <- Ac3net.maxmim(mim=mim, net_=TRUE, cutoff_= cutoff) ### one command could do the same as below if zeroindx was not available. ### ## ac3net.net <- Ac3net(DataOrMim=expdata, processed=FALSE, ratio_ = 0.002, PCmincutoff=0.6, # PCmaxcutoff=0.96, cutoff=0, estmethod='pearson', pval=1, # iterations=10, MTC=FALSE, MTCmethod="BH" ) # performance <- Ac3net.performance(predictNet=ac3net.net, # referenceNet = truenet, data_, directed=TRUE) # performance
# data(expdata) # data(truenet) # data(zeroindx) # zero indices for the example dataset, not in general. ## step by step to get Ac3net network # mim <- cor(t(expdata), method = "pearson") # mim[zeroindx, zeroindx] <- 0 #for the example dataset, not in general. # mim <- Ac3net.filtersames(mim=mim) #in case if there are same variables. #diag(mim) <-0 #cutoff <- Ac3net.cutoff(mim, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96) #mim[abs(mim) < cutoff] <- 0 #Ac3net.net <- Ac3net.maxmim(mim=mim, net_=TRUE, cutoff_= cutoff) ### one command could do the same as below if zeroindx was not available. ### ## ac3net.net <- Ac3net(DataOrMim=expdata, processed=FALSE, ratio_ = 0.002, PCmincutoff=0.6, # PCmaxcutoff=0.96, cutoff=0, estmethod='pearson', pval=1, # iterations=10, MTC=FALSE, MTCmethod="BH" ) # performance <- Ac3net.performance(predictNet=ac3net.net, # referenceNet = truenet, data_, directed=TRUE) # performance
Normalized real microarray gene expression E.coli data set.
data("expdata")
data("expdata")
This dataset compiled in (Faith, 2007) . The example data set is also given to provide a sample data set so that one can take it as reference while formatting the new data set as entry to As in this example datset, the input data sets must be complete and neither empty or non-numerical characters are allowed.
This data was downloaded from m3d.mssm.edu/network_inference.html
Faith JJ, Hayete B, Thaden JT, Mogno I, Wierzbowski J, Cottarel G, Kasif S, Collins JJ, Gardner TS. Large-scale mapping and validation of Escherichia coli transcriptional regulation from a compendium of expression profiles. PLoS Biol. 2007 Jan;5(1):e8
data(expdata) #returns data matrix with the name expdata.
data(expdata) #returns data matrix with the name expdata.
This true interactions of E.coli from RegulonDB database.
data("truenet")
data("truenet")
These true interactions are mainly from RegulonDB database. We compiled the one from (Faith, 2007), and the RegulonDB database (TF-TF and TF-gene).We removed the links where the gene names is not evailable in our example E.coli dataset. See the references for the usage information of the data.
This data was downloaded from http://regulondb.ccg.unam.mx/menu/download/datasets/index.jsp and m3d.mssm.edu/network_inference.html .
Gama-Castro S, et.al., RegulonDB version 9.0: high-level integration of gene regulation, coexpression, motif clustering and beyond., Nucleic Acids Res. 2016 Jan 4;44(D1):D133-43.
Faith JJ, Hayete B, Thaden JT, Mogno I, Wierzbowski J, Cottarel G, Kasif S, Collins JJ, Gardner TS. Large-scale mapping and validation of Escherichia coli transcriptional regulation from a compendium of expression profiles. PLoS Biol. 2007 Jan;5(1):e8
data(truenet)
data(truenet)
The indices to force to zero correlations of E.coli expresseion data. Because REgulonDB database provided only TF-TF or TF-gene interactions. We need to remove gene-gene interactions before the performance analysis.
data("zeroindx")
data("zeroindx")
The indices to force to zero correlations of E.coli expresseion data. Because REgulonDB database provided only TF-TF or TF-gene interactions. We need to remove gene-gene interactions before the performance analysis. These indice are also from (Faith, 2007), available along with the expression data.
This data was downloaded from m3d.mssm.edu/network_inference.html .
Faith JJ, Hayete B, Thaden JT, Mogno I, Wierzbowski J, Cottarel G, Kasif S, Collins JJ, Gardner TS. Large-scale mapping and validation of Escherichia coli transcriptional regulation from a compendium of expression profiles. PLoS Biol. 2007 Jan;5(1):e8
#data(zeroindx)
#data(zeroindx)