Package 'Ac3net'

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

Help Index


Implement Ac3net algorithm with a single function.

Description

Ac3net A quick way to implement Ac3net algorithm with a single function.

Usage

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" )

Arguments

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.

Details

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.

Value

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.

Author(s)

Gokmen Altay

References

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.

See Also

Ac3net.maxmim, Ac3net.commonlinks,

Examples

# 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" )

Calculates a quick cutoff value from an adjacency matrix

Description

Ac3net.cutoff A quick way to get a very rough estimate of the cutoff value for the significants of the input adjacency matrix

Usage

Ac3net.cutoff(mim, ratio_ = 0.002, PCmincutoff=0.6, PCmaxcutoff=0.96)

Arguments

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.

Details

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.

Value

Ac3net.cutoff returns a scaler as a very rough estimate of the cutoff value for the significants of the input adjacency matrix.

Author(s)

Gokmen Altay

References

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.

See Also

Ac3net.maxmim, Ac3net.commonlinks,

Examples

data(expdata)
 mim <- cor(t(expdata), method = 'pearson')
 cutoff <- Ac3net.cutoff(mim=mim, ratio_ = 0.002,
              PCmincutoff=0.6, PCmaxcutoff=0.96)

The correlations of the same variables are set to zero.

Description

Ac3net.filtersames The correlations of the same variables are set to zero as they are likly to have the maximum correlations already.

Usage

Ac3net.filtersames(mim)

Arguments

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.

Details

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.

Value

Ac3net.filtersames returns an adjacency matrix with no self dependency.

Author(s)

Gokmen Altay

References

G. Altay,"Directed Conservative Causal Core Gene Networks", bioRxiv, 2018.

See Also

Ac3net.maxmim, Ac3net.commonlinks,

Examples

# data(expdata)
# mim <- cor(t(expdata), method = 'pearson')
# mim <- Ac3net.filtersames(mim)

Find the maximum valued partner of each variable.

Description

Ac3net.maxmim takes an adjacency matrix and returns the pairs with the absolute maximum correlated partner of each variable on the rows.

Usage

Ac3net.maxmim(mim_, net_= TRUE, cutoff_=0)

Arguments

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.

Details

Ac3net.maxmim takes an adjacency matrix and returns the pairs with the absolute maximum correlated partner.

Value

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.

Author(s)

Gokmen Altay

References

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.

See Also

Ac3net.commonlinks, Ac3net.cutoff,

Examples

# 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)

Return adjusted p-values of the adjancency matrix.

Description

Ac3net.MTC Return adjusted p-values of the adjancency matrix.

Usage

Ac3net.MTC(data, iterations=10, MTC=TRUE, MTCmethod="BH",
estmethod='pearson')

Arguments

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'.

Details

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.

Value

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.

Author(s)

Gokmen Altay

References

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.

See Also

Ac3net.maxmim, Ac3net.commonlinks,

Examples

#data(expdata)
#mim.pvals <- Ac3net.MTC(data = expdata, iterations=10,
#            MTC=TRUE, MTCmethod="BH", estmethod='pearson')

Find the performance of the first network based on the second.

Description

Ac3net.performance takes two network list matrices. First is the predicted network and second is the reference true network. Returns performance scores.

Usage

Ac3net.performance(predictNet, referenceNet, data_, directed=TRUE)

Arguments

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.

Details

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.

Value

Ac3net.performance returns an object with all the performance scores.

Author(s)

Gokmen Altay

References

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.

See Also

Ac3net.maxmim, Ac3net.cutoff,

Examples

# 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

Real E.coli Gene Expression Dataset

Description

Normalized real microarray gene expression E.coli data set.

Usage

data("expdata")

Details

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.

Source

This data was downloaded from m3d.mssm.edu/network_inference.html

References

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

Examples

data(expdata) #returns data matrix with the name expdata.

The known intreactions of E.coli from RegulonDB database.

Description

This true interactions of E.coli from RegulonDB database.

Usage

data("truenet")

Details

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.

Source

This data was downloaded from http://regulondb.ccg.unam.mx/menu/download/datasets/index.jsp and m3d.mssm.edu/network_inference.html .

References

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

Examples

data(truenet)

The indices to force to zero correlations.

Description

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.

Usage

data("zeroindx")

Details

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.

Source

This data was downloaded from m3d.mssm.edu/network_inference.html .

References

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

Examples

#data(zeroindx)