Title: | Deciphering Biological Networks with Patterned Heterogeneous Measurements |
---|---|
Description: | A modeling tool dedicated to biological network modeling (Bertrand and others 2020, <doi:10.1093/bioinformatics/btaa855>). It allows for single or joint modeling of, for instance, genes and proteins. It starts with the selection of the actors that will be the used in the reverse engineering upcoming step. An actor can be included in that selection based on its differential measurement (for instance gene expression or protein abundance) or on its time course profile. Wrappers for actors clustering functions and cluster analysis are provided. It also allows reverse engineering of biological networks taking into account the observed time course patterns of the actors. Many inference functions are provided and dedicated to get specific features for the inferred network such as sparsity, robust links, high confidence links or stable through resampling links. Some simulation and prediction tools are also available for cascade networks (Jung and others 2014, <doi:10.1093/bioinformatics/btt705>). Example of use with microarray or RNA-Seq data are provided. |
Authors: | Frederic Bertrand [cre, aut] , Myriam Maumy-Bertrand [aut] |
Maintainer: | Frederic Bertrand <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.5 |
Built: | 2025-02-07 06:17:41 UTC |
Source: | https://github.com/fbertran/patterns |
Calculates some indicators for each node in the network.
## S4 method for signature 'omics_network' analyze_network(Omega, nv, label_v = NULL)
## S4 method for signature 'omics_network' analyze_network(Omega, nv, label_v = NULL)
Omega |
a omics_network object |
nv |
the level of cutoff at which the analysis should be done |
label_v |
(optionnal) the name of the genes |
A matrix containing, for each node, its betweenness,its degree, its output, its closeness.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(network) analyze_network(network,nv=0)
data(network) analyze_network(network,nv=0)
Coerce a matrix into a omics_array object.
as.omics_array( M, time, subject, name_probe = NULL, gene_ID = NULL, group = 0, start_time = 0 )
as.omics_array( M, time, subject, name_probe = NULL, gene_ID = NULL, group = 0, start_time = 0 )
M |
A matrix. Contains the omicsarray measurements. Should be of size N * K, with N the number of genes and K=T*P with T the number of time points, and P the number of subjects. This matrix should be created using cbind(M1,M2,...) with M1 a N*T matrix with the measurements for patient 1, M2 a N*T matrix with the measurements for patient 2. |
time |
A vector. The time points measurements |
subject |
The number of subjects. |
name_probe |
Vector with the row names of the omics array. |
gene_ID |
Vector with the actors' IDs of the row names of the omics array. |
group |
Vector with the actors' groups of the row names of the omics array. |
start_time |
Vector with the actors' starting time (i.e. the time it is thought to begin to have an effect on another actor in the network). |
A omics_array object.
Bertrand Frederic, Myriam Maumy-Bertrand.
if(require(CascadeData)){ data(micro_US, package="CascadeData") micro_US<-as.omics_array(micro_US[1:100,],time=c(60,90,210,390),subject=6) plot(micro_US) }
if(require(CascadeData)){ data(micro_US, package="CascadeData") micro_US<-as.omics_array(micro_US[1:100,],time=c(60,90,210,390),subject=6) plot(micro_US) }
This is an helper function to create initial values F matrices for cascade networks.
CascadeFinit(sqF, ngrp, low.trig = TRUE)
CascadeFinit(sqF, ngrp, low.trig = TRUE)
sqF |
Size of an F cell |
ngrp |
Number of groups |
low.trig |
Fill the lower trigonal matrices with ones |
An array of sizes c(sqF, sqF, ngrp).
Bertrand Frederic, Myriam Maumy-Bertrand.
CascadeFinit(3,2) CascadeFinit(4,3) plotF(CascadeFinit(4,3),choice = "F") CascadeFinit(3,2,low.trig=FALSE) CascadeFinit(4,3,low.trig=FALSE) plotF(CascadeFinit(4,3,low.trig=FALSE),choice = "F")
CascadeFinit(3,2) CascadeFinit(4,3) plotF(CascadeFinit(4,3),choice = "F") CascadeFinit(3,2,low.trig=FALSE) CascadeFinit(4,3,low.trig=FALSE) plotF(CascadeFinit(4,3,low.trig=FALSE),choice = "F")
This is an helper function to create F matrices with special shape used for cascade networks.
CascadeFshape(sqF, ngrp)
CascadeFshape(sqF, ngrp)
sqF |
Size of an F cell |
ngrp |
Number of groups |
An array of sizes c(sqF, sqF, ngrp).
Bertrand Frederic, Myriam Maumy-Bertrand.
CascadeFshape(3,2) plotF(CascadeFshape(3,2),choice = "Fshape") CascadeFshape(4,3) plotF(CascadeFshape(4,3),choice = "Fshape")
CascadeFshape(3,2) plotF(CascadeFshape(3,2),choice = "Fshape") CascadeFshape(4,3) plotF(CascadeFshape(4,3),choice = "Fshape")
B-cells were negatively selected from healthy donors and previously untreated CLL patients. BCR stimulated and unstimulated control B-cells were treated at four time points after stimulation for total RNA extraction and hybridization on Affymetrix microarrays.
The format is: chr "CLL"
The dataset provided with package is the first five lines of the full dataset. The full dataset can be downloaded from the github repository of the package (https://raw.githubusercontent.com/fbertran/Patterns/master/add_data/CLL.RData).
Three different cell populations (6 healthy B-lymphocytes, 6 leukemic CLL B-lymphocyte of indolent form and 5 leukemic CLL B-lymphocyte of aggressive form) were stimulated in vitro with an anti-IgM antibody, activating the B-cell receptor (BCR). We analyzed the gene expression at 4 time points (60, 90, 210 and 390 minutes). Each gene expression measurement is performed both in stimulated cells and in control unstimulated cells. For one aggressive CLL case, we silenced expression of DUSP1 by transfecting DUSP1-specific RNAi and, as a control, transfected cells with a non-targeting RNAi. We then stimulated the BCR of these cells and analyzed the gene expression at the same time points in stimulated cells and in control unstimulated cells.
Bertrand Frederic, Myriam Maumy-Bertrand.
https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE39411
Vallat, L., Kemper, C. A., Jung, N., Maumy-Bertrand, M., Bertrand, F., Meyer, N., … Bahram, S. (2013). Reverse-engineering the genetic circuitry of a cancer cell with predicted intervention in chronic lymphocytic leukemia. Proceedings of the National Academy of Sciences of the United States of America, 110(2), 459–464.
data(CLL) str(CLL) CLLfile <- "https://github.com/fbertran/Patterns/raw/master/add_data/CLL.RData" repmis::source_data(CLLfile) str(CLL)
data(CLL) str(CLL) CLLfile <- "https://github.com/fbertran/Patterns/raw/master/add_data/CLL.RData" repmis::source_data(CLLfile) str(CLL)
Based on soft clustering performed by the Mfuzz package.
## S4 method for signature 'omics_array' clustExploration(omicsarray, new.window = FALSE)
## S4 method for signature 'omics_array' clustExploration(omicsarray, new.window = FALSE)
omicsarray |
A omicsarray to cluster |
new.window |
Boolean. New X11 window for plots. Defaults to FALSE. |
A data.frame of nrows(omicsarray) observations of 3 variables (name, cluster, maj.vote.index).
Bertrand Frederic, Myriam Maumy-Bertrand.
library(Patterns) if(require(CascadeData)){ data(micro_S, package="CascadeData") D<-Patterns::as.omics_array(micro_S[1:100,],1:4,6) a<-clustExploration(D) a }
library(Patterns) if(require(CascadeData)){ data(micro_S, package="CascadeData") D<-Patterns::as.omics_array(micro_S[1:100,],1:4,6) a<-clustExploration(D) a }
Based on soft clustering performed by the Mfuzz package.
## S4 method for signature 'omics_array,numeric' clustInference(omicsarray, vote.index, new.window = FALSE)
## S4 method for signature 'omics_array,numeric' clustInference(omicsarray, vote.index, new.window = FALSE)
omicsarray |
A omicsarray to cluster |
vote.index |
Option for cluster attribution |
new.window |
Boolean. New X11 window for plots. Defaults to FALSE. |
A list of two elements:
res.matrix |
A data.frame of nrows(omicsarray) observations of 3 variables (name, cluster, maj.vote.index). |
prop.matrix |
Additionnal info. |
Bertrand Frederic, Myriam Maumy-Bertrand.
library(Patterns) if(require(CascadeData)){ data(micro_S, package="CascadeData") D<-Patterns::as.omics_array(micro_S[1:20,],1:4,6) b<-Patterns::clustInference(D,0.5) b }
library(Patterns) if(require(CascadeData)){ data(micro_S, package="CascadeData") D<-Patterns::as.omics_array(micro_S[1:20,],1:4,6) b<-Patterns::clustInference(D,0.5) b }
Allows comparison between actual and inferred network.
## S4 method for signature 'omics_network,omics_network,numeric' compare(Net, Net_inf, nv = 1)
## S4 method for signature 'omics_network,omics_network,numeric' compare(Net, Net_inf, nv = 1)
Net |
A omics_network object containing the actual network. |
Net_inf |
A omics_network object containing the inferred network. |
nv |
A number that indicates at which level of cutoff the comparison should be done. |
A vector containing : sensitivity, predictive positive value, the usual F-score (2*ppv*sens/(sppvpe+sens)), the 1/2 ponderated Fscore ((1+0.5^2)*ppv*sens/(ppv/4+sens)) and the 2 ponderated Fscore ((1+2^2)*ppv*sens/(ppv*4+sens)).
A omics_network object containing the actual network.
A omics_network object containing the inferred network.
A number that indicates at which level of cutoff the comparison should be done.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(Net) data(Net_inf_PL) #Comparing true and inferred networks Crit_values=NULL #Here are the cutoff level tested test.seq<-seq(0,max(abs(Net_inf_PL@omics_network*0.9)),length.out=200) for(u in test.seq){ Crit_values<-rbind(Crit_values,Patterns::compare(Net,Net_inf_PL,u)) } matplot(test.seq,Crit_values,type="l",ylab="Criterion value",xlab="Cutoff level",lwd=2) legend(x="topleft", legend=colnames(Crit_values), lty=1:5,col=1:5,ncol=2,cex=.9)
data(Net) data(Net_inf_PL) #Comparing true and inferred networks Crit_values=NULL #Here are the cutoff level tested test.seq<-seq(0,max(abs(Net_inf_PL@omics_network*0.9)),length.out=200) for(u in test.seq){ Crit_values<-rbind(Crit_values,Patterns::compare(Net,Net_inf_PL,u)) } matplot(test.seq,Crit_values,type="l",ylab="Criterion value",xlab="Cutoff level",lwd=2) legend(x="topleft", legend=colnames(Crit_values), lty=1:5,col=1:5,ncol=2,cex=.9)
Allows estimating the best cutoff. For a sequence of cutoff, the p value corresponding to each cutoff value of the sequence. Mainly recommended for single time cascade networks. To achieve more sparsity in other settings, please use a fiiting function based on the stability selection or selectboost algorithms.
## S4 method for signature 'omics_network' cutoff(Omega, sequence = NULL, x_min = 0)
## S4 method for signature 'omics_network' cutoff(Omega, sequence = NULL, x_min = 0)
Omega |
a omics_network object |
sequence |
a vector corresponding to the sequence of cutoffs that will be tested. |
x_min |
an integer ; only values over x_min are further retained for performing the test. |
A list containing two objects :
p.value |
the p values corresponding to the sequence of cutoff |
p.value.inter |
the smoothed p value vector, using the loess function |
Bertrand Frederic, Myriam Maumy-Bertrand.
data(network) cutoff(network) #See vignette for more details
data(network) cutoff(network) #See vignette for more details
Dimension of the data
## S4 method for signature 'omics_array' dim(x)
## S4 method for signature 'omics_array' dim(x)
x |
an object of class 'omics_array'. |
Gives the dimension of the matrix of measurements.
Bertrand Frederic, Myriam Maumy-Bertrand.
Retrieve human transcription factors from HumanTFDB, extracted from AnimalTFDB 3.0: a comprehensive resource for annotation and prediction of animal transcription factors. Hui Hu, Ya-Ru Miao, Long-Hao Jia, Qing-Yang Yu, Qiong Zhang and An-Yuan Guo. *Nucl. Acids Res*. (2018).
Bertrand Frederic, Myriam Maumy-Bertrand.
data(doc) head(doc) summary(doc)
data(doc) head(doc) summary(doc)
See the evolution of the network with change of cutoff
## S4 method for signature 'omics_network' evolution( net, list_nv, gr = NULL, color.vertex = NULL, color.edge = NULL, fix = TRUE, size = c(2000, 1000), label_v = 1:dim(net@omics_network)[1], legend.position = "topleft", frame.color = "black", label.hub = FALSE, outdir, type.ani = "html" )
## S4 method for signature 'omics_network' evolution( net, list_nv, gr = NULL, color.vertex = NULL, color.edge = NULL, fix = TRUE, size = c(2000, 1000), label_v = 1:dim(net@omics_network)[1], legend.position = "topleft", frame.color = "black", label.hub = FALSE, outdir, type.ani = "html" )
net |
a omics_network object |
list_nv |
a vector of cutoff at which the network should be shown |
gr |
a vector giving the group of each genee. Defaults to NULL |
color.vertex |
a vector giving the color of each nodee. Defaults to NULL |
color.edge |
a vector giving the color of each edge. Defaults to NULL |
fix |
logical, should the position of the node in the network be calculated once at the beginning ? Defaults to TRUE. |
size |
vector giving the size of the plot. Defaults to c(2000,1000) |
label_v |
vector giving the labels of each vertex. Defaults to 1:dim(net@omics_network)[1] |
legend.position |
string giving the position of the legend. Defaults to "topleft" |
frame.color |
string giving the color of the frame of the plot. Defaults to "black" |
label.hub |
label hubs. Defaults to FALSE |
outdir |
Directory to save the animation. No default value since it must be specified by the user. |
type.ani |
Type of animation. Defaults to "html" |
legend |
string giving the position of the legend. Defaults to "topleft" |
Several types of outputs are available using the type.ani option.
html
latex (requires latex)
swf (requires swftools)
video (requires ffmpeg)
gif
manual_gif
A HTML page with the evolution of the network.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(network) sequence<-seq(0,0.2,length.out=20) #Change the destdir to have the animation created where you want. destdir = tempdir() #Example of use of the evolution method with an html output. evolution(network,sequence,type.ani = "html", outdir=destdir) ## Not run: #Example of use of the evolution method with an animated gif output. evolution(network,sequence,type.ani = "gif", outdir=destdir) ## End(Not run)
data(network) sequence<-seq(0,0.2,length.out=20) #Change the destdir to have the animation created where you want. destdir = tempdir() #Example of use of the evolution method with an html output. evolution(network,sequence,type.ani = "html", outdir=destdir) ## Not run: #Example of use of the evolution method with an animated gif output. evolution(network,sequence,type.ani = "gif", outdir=destdir) ## End(Not run)
Simulates omicsarray data based on a given network.
## S4 method for signature 'omics_network' gene_expr_simulation( omics_network, time_label = 1:4, subject = 5, peak_level = 100, act_time_group = 1:4 )
## S4 method for signature 'omics_network' gene_expr_simulation( omics_network, time_label = 1:4, subject = 5, peak_level = 100, act_time_group = 1:4 )
omics_network |
A omics_network object. |
time_label |
a vector containing the time labels. |
subject |
the number of subjects |
peak_level |
the mean level of peaks. |
act_time_group |
[NULL] vector ; at which time the groups (defined by sort(unique(group))) are activated ? |
A omics_array object.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(Net) set.seed(1) #We simulate gene expressions according to the network Net Msim<-Patterns::gene_expr_simulation( omics_network=Net, time_label=rep(1:4,each=25), subject=5, peak_level=200) head(Msim)
data(Net) set.seed(1) #We simulate gene expressions according to the network Net Msim<-Patterns::gene_expr_simulation( omics_network=Net, time_label=rep(1:4,each=25), subject=5, peak_level=200) head(Msim)
Find the neighborhood of a set of nodes.
## S4 method for signature 'omics_network' geneNeighborhood( net, targets, nv = 0, order = length(net@time_pt) - 1, label_v = NULL, ini = NULL, frame.color = "white", label.hub = FALSE, graph = TRUE, names = F )
## S4 method for signature 'omics_network' geneNeighborhood( net, targets, nv = 0, order = length(net@time_pt) - 1, label_v = NULL, ini = NULL, frame.color = "white", label.hub = FALSE, graph = TRUE, names = F )
net |
a omics_network object |
targets |
a vector containing the set of nodes |
nv |
the level of cutoff. Defaut to 0. |
order |
of the neighborhood. Defaut to 'length(net@time_pt)-1'. |
label_v |
vector defining the vertex labels. |
ini |
using the “position” function, you can fix the position of the nodes. |
frame.color |
color of the frames. |
label.hub |
logical ; if TRUE only the hubs are labeled. |
graph |
plot graph of the network. Defaults to 'TRUE'. |
names |
return names of the neighbors. Defaults to 'FALSE'. |
The neighborhood of the targeted genes.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(Selection) data(infos) #Find probesets for EGR1 pbst_EGR1 = infos[infos$hgnc_symbol=="EGR1", "affy_hg_u133_plus_2"] gene_IDs = infos[match(Selection@name, infos$affy_hg_u133_plus_), "hgnc_symbol"] data(network) #A nv value can chosen using the cutoff function nv=.11 EGR1<-which(is.element(Selection@name,pbst_EGR1)) P<-position(network,nv=nv) geneNeighborhood(network,targets=EGR1,nv=nv,ini=P, label_v=gene_IDs)
data(Selection) data(infos) #Find probesets for EGR1 pbst_EGR1 = infos[infos$hgnc_symbol=="EGR1", "affy_hg_u133_plus_2"] gene_IDs = infos[match(Selection@name, infos$affy_hg_u133_plus_), "hgnc_symbol"] data(network) #A nv value can chosen using the cutoff function nv=.11 EGR1<-which(is.element(Selection@name,pbst_EGR1)) P<-position(network,nv=nv) geneNeighborhood(network,targets=EGR1,nv=nv,ini=P, label_v=gene_IDs)
Selection of differentially expressed genes.
## S4 method for signature 'omics_array,omics_array,numeric' geneSelection( x, y, tot.number, data_log = TRUE, wanted.patterns = NULL, forbidden.patterns = NULL, peak = NULL, alpha = 0.05, Design = NULL, lfc = 0 ) ## S4 method for signature 'list,list,numeric' geneSelection( x, y, tot.number, data_log = TRUE, alpha = 0.05, cont = FALSE, lfc = 0, f.asso = NULL, return.diff = FALSE ) ## S4 method for signature 'omics_array,numeric' genePeakSelection( x, peak, y = NULL, data_log = TRUE, durPeak = c(1, 1), abs_val = TRUE, alpha_diff = 0.05 )
## S4 method for signature 'omics_array,omics_array,numeric' geneSelection( x, y, tot.number, data_log = TRUE, wanted.patterns = NULL, forbidden.patterns = NULL, peak = NULL, alpha = 0.05, Design = NULL, lfc = 0 ) ## S4 method for signature 'list,list,numeric' geneSelection( x, y, tot.number, data_log = TRUE, alpha = 0.05, cont = FALSE, lfc = 0, f.asso = NULL, return.diff = FALSE ) ## S4 method for signature 'omics_array,numeric' genePeakSelection( x, peak, y = NULL, data_log = TRUE, durPeak = c(1, 1), abs_val = TRUE, alpha_diff = 0.05 )
x |
either a omics_array object or a list of omics_array objects. In the first case, the omics_array object represents the stimulated measurements. In the second case, the control unstimulated data (if present) should be the first element of the list. |
y |
either a omics_array object or a list of strings. In the first case, the omics_array object represents the stimulated measurements. In the second case, the list is the way to specify the contrast:
|
tot.number |
an integer. The number of selected genes. If tot.number <0 all differentially genes are selected. If tot.number > 1, tot.number is the maximum of diffenrtially genes that will be selected. If 0<tot.number<1, tot.number represents the proportion of diffenrentially genes that are selected. |
data_log |
logical (default to TRUE); should data be logged ? |
wanted.patterns |
a matrix with wanted patterns [only for geneSelection]. |
forbidden.patterns |
a matrix with forbidden patterns [only for geneSelection]. |
peak |
interger. At which time points measurements should the genes be selected [optionnal for geneSelection]. |
alpha |
float; the risk level. Default to 'alpha=0.05' |
Design |
the design matrix of the experiment. Defaults to 'NULL'. |
lfc |
log fold change value used in limma's 'topTable'. Defaults to 0. |
cont |
use contrasts. Defaults to 'FALSE'. |
f.asso |
function used to assess the association between the genes. The default value 'NULL' implies the use of the usual 'mean' function. |
return.diff |
[FALSE] if TRUE then the function returns the stimulated expression of the differentially expressed genes |
durPeak |
vector of size 2 (default to c(1,1)) ; the first elements gives the length of the peak at the left, the second at the right. [only for genePeakSelection] |
abs_val |
logical (default to TRUE) ; should genes be selected on the basis of their absolute value expression ? [only for genePeakSelection] |
alpha_diff |
float; the risk level |
A omics_array object.
Frédéric Bertrand , Myriam Maumy-Bertrand.
if(require(CascadeData)){ data(micro_US) micro_US<-as.omics_array(micro_US,time=c(60,90,210,390),subject=6) data(micro_S) micro_S<-as.omics_array(micro_S,time=c(60,90,210,390),subject=6) #Basically, to find the 50 more significant expressed genes you will use: Selection_1<-geneSelection(x=micro_S,y=micro_US, tot.number=50,data_log=TRUE) summary(Selection_1) #If we want to select genes that are differentially #at time t60 or t90 : Selection_2<-geneSelection(x=micro_S,y=micro_US,tot.number=30, wanted.patterns= rbind(c(0,1,0,0),c(1,0,0,0),c(1,1,0,0))) summary(Selection_2) #To select genes that have a differential maximum of expression at a specific time point. Selection_3<-genePeakSelection(x=micro_S,y=micro_US,peak=1, abs_val=FALSE,alpha_diff=0.01) summary(Selection_3) } if(require(CascadeData)){ data(micro_US) micro_US<-as.omics_array(micro_US,time=c(60,90,210,390),subject=6) data(micro_S) micro_S<-as.omics_array(micro_S,time=c(60,90,210,390),subject=6) #Genes with differential expression at t1 Selection1<-geneSelection(x=micro_S,y=micro_US,20,wanted.patterns= rbind(c(1,0,0,0))) #Genes with differential expression at t2 Selection2<-geneSelection(x=micro_S,y=micro_US,20,wanted.patterns= rbind(c(0,1,0,0))) #Genes with differential expression at t3 Selection3<-geneSelection(x=micro_S,y=micro_US,20,wanted.patterns= rbind(c(0,0,1,0))) #Genes with differential expression at t4 Selection4<-geneSelection(x=micro_S,y=micro_US,20,wanted.patterns= rbind(c(0,0,0,1))) #Genes with global differential expression Selection5<-geneSelection(x=micro_S,y=micro_US,20) #We then merge these selections: Selection<-unionOmics(list(Selection1,Selection2,Selection3,Selection4,Selection5)) print(Selection) #Prints the correlation graphics Figure 4: summary(Selection,3) ##Uncomment this code to retrieve geneids. #library(org.Hs.eg.db) # #ff<-function(x){substr(x, 1, nchar(x)-3)} #ff<-Vectorize(ff) # ##Here is the function to transform the probeset names to gene ID. # #library("hgu133plus2.db") # #probe_to_id<-function(n){ #x <- hgu133plus2SYMBOL #mp<-mappedkeys(x) #xx <- unlist(as.list(x[mp])) #genes_all = xx[(n)] #genes_all[is.na(genes_all)]<-"unknown" #return(genes_all) #} #Selection@name<-probe_to_id(Selection@name) }
if(require(CascadeData)){ data(micro_US) micro_US<-as.omics_array(micro_US,time=c(60,90,210,390),subject=6) data(micro_S) micro_S<-as.omics_array(micro_S,time=c(60,90,210,390),subject=6) #Basically, to find the 50 more significant expressed genes you will use: Selection_1<-geneSelection(x=micro_S,y=micro_US, tot.number=50,data_log=TRUE) summary(Selection_1) #If we want to select genes that are differentially #at time t60 or t90 : Selection_2<-geneSelection(x=micro_S,y=micro_US,tot.number=30, wanted.patterns= rbind(c(0,1,0,0),c(1,0,0,0),c(1,1,0,0))) summary(Selection_2) #To select genes that have a differential maximum of expression at a specific time point. Selection_3<-genePeakSelection(x=micro_S,y=micro_US,peak=1, abs_val=FALSE,alpha_diff=0.01) summary(Selection_3) } if(require(CascadeData)){ data(micro_US) micro_US<-as.omics_array(micro_US,time=c(60,90,210,390),subject=6) data(micro_S) micro_S<-as.omics_array(micro_S,time=c(60,90,210,390),subject=6) #Genes with differential expression at t1 Selection1<-geneSelection(x=micro_S,y=micro_US,20,wanted.patterns= rbind(c(1,0,0,0))) #Genes with differential expression at t2 Selection2<-geneSelection(x=micro_S,y=micro_US,20,wanted.patterns= rbind(c(0,1,0,0))) #Genes with differential expression at t3 Selection3<-geneSelection(x=micro_S,y=micro_US,20,wanted.patterns= rbind(c(0,0,1,0))) #Genes with differential expression at t4 Selection4<-geneSelection(x=micro_S,y=micro_US,20,wanted.patterns= rbind(c(0,0,0,1))) #Genes with global differential expression Selection5<-geneSelection(x=micro_S,y=micro_US,20) #We then merge these selections: Selection<-unionOmics(list(Selection1,Selection2,Selection3,Selection4,Selection5)) print(Selection) #Prints the correlation graphics Figure 4: summary(Selection,3) ##Uncomment this code to retrieve geneids. #library(org.Hs.eg.db) # #ff<-function(x){substr(x, 1, nchar(x)-3)} #ff<-Vectorize(ff) # ##Here is the function to transform the probeset names to gene ID. # #library("hgu133plus2.db") # #probe_to_id<-function(n){ #x <- hgu133plus2SYMBOL #mp<-mappedkeys(x) #xx <- unlist(as.list(x[mp])) #genes_all = xx[(n)] #genes_all[is.na(genes_all)]<-"unknown" #return(genes_all) #} #Selection@name<-probe_to_id(Selection@name) }
Overview of a omics_array object.
## S4 method for signature 'omics_array' head(x, ...)
## S4 method for signature 'omics_array' head(x, ...)
x |
an object of class 'omics_array'. |
... |
additional parameters |
Gives an overview.
Gives an overview.
Bertrand Frederic, Myriam Maumy-Bertrand.
if(require(CascadeData)){ data(micro_US) micro_US<-as.omics_array(micro_US,time=c(60,90,210,390),subject=6) head(micro_US) }
if(require(CascadeData)){ data(micro_US) micro_US<-as.omics_array(micro_US,time=c(60,90,210,390),subject=6) head(micro_US) }
This is an helper function to create initial values F matrices for networks.
IndicFinit(sqF, ngrp, Indic, low.trig = TRUE)
IndicFinit(sqF, ngrp, Indic, low.trig = TRUE)
sqF |
Size of an F cell |
ngrp |
Number of groups |
Indic |
Matrix to specify where there is an interaction from one group to another |
low.trig |
Fill the lower trigonal matrices with ones |
An array of size (sqF, sqF, ngrp).
Bertrand Frederic, Myriam Maumy-Bertrand.
IndicFinit(3, 2, matrix(1,2,2)-diag(2))
IndicFinit(3, 2, matrix(1,2,2)-diag(2))
This is an helper function to create values F matrices using specific intergroup actions for network inference.
IndicFshape(sqF, ngrp, Indic)
IndicFshape(sqF, ngrp, Indic)
sqF |
Size of an F cell |
ngrp |
Number of groups |
Indic |
Matrix to specify where there is an interaction from one group to another |
An array of size (sqF, sqF, ngrp).
Bertrand Frederic, Myriam Maumy-Bertrand.
IndicFshape(3, 2, matrix(1,2,2)-diag(2))
IndicFshape(3, 2, matrix(1,2,2)-diag(2))
Reverse-engineer the network.
## S4 method for signature 'omics_array' inference( M, tour.max = 30, g = function(x) { 1/x }, conv = 0.001, cv.subjects = TRUE, nb.folds = NULL, eps = 10^-5, type.inf = "iterative", Fshape = NULL, Finit = NULL, Omega = NULL, fitfun = "LASSO", use.Gram = TRUE, error.stabsel = 0.05, pi_thr.stabsel = 0.6, priors = NULL, mc.cores = getOption("mc.cores", 2L), intercept.stabpath = TRUE, steps.seq = 0.95, limselect = 0.95, use.parallel = TRUE, verbose = TRUE, show.error.messages = FALSE )
## S4 method for signature 'omics_array' inference( M, tour.max = 30, g = function(x) { 1/x }, conv = 0.001, cv.subjects = TRUE, nb.folds = NULL, eps = 10^-5, type.inf = "iterative", Fshape = NULL, Finit = NULL, Omega = NULL, fitfun = "LASSO", use.Gram = TRUE, error.stabsel = 0.05, pi_thr.stabsel = 0.6, priors = NULL, mc.cores = getOption("mc.cores", 2L), intercept.stabpath = TRUE, steps.seq = 0.95, limselect = 0.95, use.parallel = TRUE, verbose = TRUE, show.error.messages = FALSE )
M |
a omics_array object. |
tour.max |
[30] tour.max + 1 = maximal number of steps. |
g |
After each step, the new solution is choosen as (the old solution + g(x) * the new solution)/(1+g(x)) where x is the number of steps. Defaults to 'g=function(x) 1/x' |
conv |
[0.001] Convergence criterion. |
cv.subjects |
[TRUE] Subjectwise cross validation: should the cross validation be done by removing the subject one by one? |
nb.folds |
[NULL] Relevant only if no subjectwise cross validation (i.e. cv.subjects=FALSE). The number of folds in cross validation. |
eps |
[10^-5] Threshold for rounding coefficients to 0 (i.e. machine zero). |
type.inf |
["iterative"] "iterative" or "noniterative" : should the algorithm be computed iteratively or only for one step? For highly homogeneous clusters, the "noniterative" option is suffisant. |
Fshape |
[NULL] Shape of the F matrix. |
Finit |
[NULL] Init values of the F matrix. |
Omega |
[NULL] Init values for the Omega matrix. |
fitfun |
["LASSO"] Function to infer the Omega matrix at each step. |
use.Gram |
[TRUE] Optional parameter for the lasso in the 'lars' package. |
error.stabsel |
[0.05] Optional parameter for the stability selection algorithm in the 'c060' package. |
pi_thr.stabsel |
[0.6] Optional parameter for the stability selection algorithm in the 'c060' package. |
priors |
[NULL] A priori weights for the links between the actors. 0 means that an actor is always included in the predictive model, 1 is a neutral weighting and +infinity that the actor is never used in the model. For a given predictive model, the weighting vector is normalized so that its sum is equal to the number of predictors in the model. |
mc.cores |
[getOption("mc.cores", 2L)] Number of cores. |
intercept.stabpath |
[TRUE] Use intercept in stability selection models? |
steps.seq |
[.95] Optional parameter for the SelectBoost algorithm in the 'SelectBoost' package. |
limselect |
[.95] Optional parameter for the SelectBoost algorithm in the 'SelectBoost' package. |
use.parallel |
[TRUE] Use parallel computing? |
verbose |
[TRUE] Info on the completion of the fitting process |
show.error.messages |
[FALSE] Should the error messages of the Omega estimating function be returned? |
The fitting built-in fitting functions ('fitfun') provided with the 'Patterns' package are :
from the 'lars' package (default value)
from the 'glmnet' package
from the 'spls' package
from the 'elasticnet' package
from the 'c060' package implementation of stability selection
a new weighted version of the 'c060' package implementation of stability selection
lasso from the 'lars' package with light random Gaussian noise added to the explanatory variables
a new weighted version of the 'selectboost' package implementation of the selectboost algorithm to look for the more stable links against resampling that takes into account the correlated structure of the predictors. If no weights are provided, equal weigths are for all the variables (=non weighted case).
The weights are viewed as a penalty factors in the penalized regression model: it is a number that multiplies the lambda value in the minimization problem to allow differential shrinkage, [Friedman et al. 2010](https://web.stanford.edu/~hastie/Papers/glmnet.pdf), equation 1 page 3. If equal to 0, it implies no shrinkage, and that variable is always included in the model. Default is 1 for all variables. Infinity means that the variable is excluded from the model. Note that the weights are rescaled to sum to the number of variables.
A omics_network object.
Bertrand Frederic, Myriam Maumy-Bertrand.
#With simulated data, default shaped F matrix and default LASSO from the lars package #as fitting function data(M) infM <- inference(M) str(infM) plot(infM, choice="F", nround=0) plot(infM, choice="F", nround=1) #With simulated data, cascade network shaped F matrix (1 group per time measurement case) #and default LASSO from the lars package as fitting function infMcasc <- inference(M, Finit=CascadeFinit(4,4), Fshape=CascadeFshape(4,4)) str(infMcasc) plot(infMcasc, choice="F", nround=0) plot(infMcasc, choice="F", nround=1) #With selection of genes from GSE39411 data(Selection) infSel <- inference(Selection, Finit=CascadeFinit(4,4), Fshape=CascadeFshape(4,4)) str(infSel) str(infSel) plot(infSel, choice="F", nround=0) plot(infSel, choice="F", nround=1)
#With simulated data, default shaped F matrix and default LASSO from the lars package #as fitting function data(M) infM <- inference(M) str(infM) plot(infM, choice="F", nround=0) plot(infM, choice="F", nround=1) #With simulated data, cascade network shaped F matrix (1 group per time measurement case) #and default LASSO from the lars package as fitting function infMcasc <- inference(M, Finit=CascadeFinit(4,4), Fshape=CascadeFshape(4,4)) str(infMcasc) plot(infMcasc, choice="F", nround=0) plot(infMcasc, choice="F", nround=1) #With selection of genes from GSE39411 data(Selection) infSel <- inference(Selection, Finit=CascadeFinit(4,4), Fshape=CascadeFshape(4,4)) str(infSel) str(infSel) plot(infSel, choice="F", nround=0) plot(infSel, choice="F", nround=1)
Dataset with information on the affy_hg_u133_plus_2 platform such as probeset name (affy_hg_u133_plus_2), ensembl_gene_id, entrezgene, hgnc_symbol, chromosome_name, start_position, end_position and band.
The format is: chr "infos"
Data.frame with 8859 rows and 8 variables.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(infos)
data(infos)
Simulated M, microarray.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(M) head(M) str(M)
data(M) head(M) str(M)
Simulated network.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(Net) str(Net)
data(Net) str(Net)
The reverse-engineered network with the 'Patterns' package using the fitfun="LASSO" default function and a cascade network setting.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(Net_inf_PL) str(Net_inf_PL)
data(Net_inf_PL) str(Net_inf_PL)
This dataset is a network example with 102 nodes, 4 times and 4 groups.
The format is: chr "network"
A network class object [package "Patterns"] with 6 slots.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(network) str(network) plot(network)
data(network) str(network) plot(network)
Generates a network.
network_random( nb, time_label, exp, init, regul, min_expr, max_expr, casc.level )
network_random( nb, time_label, exp, init, regul, min_expr, max_expr, casc.level )
nb |
Integer. The number of genes. |
time_label |
Vector. The time points measurements. |
exp |
The exponential parameter, as in the barabasi.game function in igraph package. |
init |
The attractiveness of the vertices with no adjacent edges. See barabasi.game function. |
regul |
A vector mapping each gene with its number of regulators. |
min_expr |
Minimum of strength of a non-zero link |
max_expr |
Maximum of strength of a non-zero link |
casc.level |
... |
A omics_network object.
Bertrand Frederic, Myriam Maumy-Bertrand.
set.seed(1) Net<-network_random( nb=100, time_label=rep(1:4,each=25), exp=1, init=1, regul=round(rexp(100,1))+1, min_expr=0.1, max_expr=2, casc.level=0.4 ) plot(Net)
set.seed(1) Net<-network_random( nb=100, time_label=rep(1:4,each=25), exp=1, init=1, regul=round(rexp(100,1))+1, min_expr=0.1, max_expr=2, casc.level=0.4 ) plot(Net)
This dataset is a cascade network example with 53 nodes, 4 times and 2 groups.
The format is: chr "network2gp"
A network class object [package "Patterns"] with 6 slots.
data(network2gp) str(network2gp) plot(network2gp)
data(network2gp) str(network2gp) plot(network2gp)
This dataset is a cascade network example with 102 nodes, 4 times and 4 groups.
The format is: chr "networkCascade"
A network class object [package "Patterns"] with 6 slots.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(networkCascade) str(networkCascade) plot(networkCascade)
data(networkCascade) str(networkCascade) plot(networkCascade)
"omics_array"
The "omics_array"
class
Objects can be created by calls of the form
new("omics_array", ...)
.
Bertrand Frederic, Myriam Maumy-Bertrand.
showClass("omics_array")
showClass("omics_array")
"omics_network"
The "omics_network"
class
Objects can be created by calls of the form
new("omics_network", ...)
.
Bertrand Frederic, Myriam Maumy-Bertrand.
showClass("omics_network")
showClass("omics_network")
"omics_predict"
The "omics_predict"
class
Objects can be created by calls of the form
new("omics_predict", ...)
.
Bertrand Frederic, Myriam Maumy-Bertrand.
showClass("omics_predict")
showClass("omics_predict")
Considering the class of the argument which is passed to plot, the graphical output differs.
## S4 method for signature 'omics_array,ANY' plot(x, y, ...) ## S4 method for signature 'omics_network,ANY' plot( x, y, choice = "omics_network", nv = 0, gr = NULL, ini = NULL, color.vertex = NULL, color.edge = NULL, video = TRUE, weight.node = NULL, ani = FALSE, size = c(2000, 1000), label_v = 1:dim(x@omics_network)[1], horiz = TRUE, legend.position = "topleft", frame.color = "black", label.hub = FALSE, nround = 2, ani.img.name = "Rplot", ani.imgdir = "images", ani.htmlfile = "index.html", outdir, ani.group.legend = "Cluster", layout = ini, alpha = 1, pixmap.color = terrain.colors(20), ... ) ## S4 method for signature 'omics_predict,ANY' plot( x, time = NULL, label_v = NULL, frame.color = "white", ini = NULL, label.hub = FALSE, edge.arrow.size = 0.7, edge.thickness = 1 )
## S4 method for signature 'omics_array,ANY' plot(x, y, ...) ## S4 method for signature 'omics_network,ANY' plot( x, y, choice = "omics_network", nv = 0, gr = NULL, ini = NULL, color.vertex = NULL, color.edge = NULL, video = TRUE, weight.node = NULL, ani = FALSE, size = c(2000, 1000), label_v = 1:dim(x@omics_network)[1], horiz = TRUE, legend.position = "topleft", frame.color = "black", label.hub = FALSE, nround = 2, ani.img.name = "Rplot", ani.imgdir = "images", ani.htmlfile = "index.html", outdir, ani.group.legend = "Cluster", layout = ini, alpha = 1, pixmap.color = terrain.colors(20), ... ) ## S4 method for signature 'omics_predict,ANY' plot( x, time = NULL, label_v = NULL, frame.color = "white", ini = NULL, label.hub = FALSE, edge.arrow.size = 0.7, edge.thickness = 1 )
x |
a omics_array object, a omics_network object or a omics_predict object |
y |
optional and not used if x is an appropriate structure |
... |
additional parameters |
choice |
what graphic should be plotted: either "F" (for a representation of the matrices F) or "network". |
nv |
the level of cutoff. Defaut to '0'. |
gr |
a vector giving the group of each gene |
ini |
using the “position” function, you can fix the position of the nodes. |
color.vertex |
a vector defining the color of the vertex. |
color.edge |
color of the edges |
video |
if ani is TRUE and video is TRUE, the result of the animation is saved as an animated GIF. |
weight.node |
nodes weighting. Defaults to 'NULL'. |
ani |
animated plot? |
size |
vector giving the size of the plot. Default to 'c(2000,1000)'. |
label_v |
vector defining the vertex labels. |
horiz |
landscape? Defaults to 'TRUE'. |
legend.position |
position of the legend. |
frame.color |
color of the frames. |
label.hub |
logical ; if TRUE only the hubs are labeled. |
nround |
number of digits to display |
ani.img.name |
name of image file for animations |
ani.imgdir |
name of the image directory for animations |
ani.htmlfile |
name of the html file for animations |
outdir |
name of the outdir for animations |
ani.group.legend |
legend for animations |
layout |
layout of the graphs |
alpha |
transparency of the graphs |
pixmap.color |
color for pixmap graphs |
time |
sets the time for plot of the prediction. Defaults to 'NULL' |
edge.arrow.size |
size of the arrows ; default to 0.7. |
edge.thickness |
edge thickness ; default to 1. |
a omics_array object
a vector of cutoff at which the network should be shown
a omics_network object
Optionnal arguments:
a vector giving the group of each gene
what graphic should be plotted: either "F" (for a representation of the matrices F) or "network".
the level of cutoff. Defaut to 0.
using the “position” function, you can fix the position of the nodes
a vector defining the color of the vertex
vector giving the size of the plot. Default to c(2000,1000). The animation can only be created in the working directory. See the help page of the animation method.
if ani is TRUE and video is TRUE, the animation result is a GIF video
vector defining the vertex labels
position of the legend
color of the frames
logical ; if TRUE only the hubs are labeled
size of the arrows ; default to 0.7
edge thickness ; default to 1.
a omics_predict object
Optional arguments: see plot for omics_network
Bertrand Frederic, Myriam Maumy-Bertrand.
if(require(CascadeData)){ data(micro_US, package="CascadeData") micro_US<-as.omics_array(micro_US[1:100,],time=c(60,90,210,390),subject=6) plot(micro_US) }
if(require(CascadeData)){ data(micro_US, package="CascadeData") micro_US<-as.omics_array(micro_US[1:100,],time=c(60,90,210,390),subject=6) plot(micro_US) }
The graphical output will differ according to the option used.
plotF(x, choice = "Fshape", nround = 2, pixmap.color = terrain.colors(20))
plotF(x, choice = "Fshape", nround = 2, pixmap.color = terrain.colors(20))
x |
The F matrix. |
choice |
A string: either "F", "Fpixmap", "Fshape", or "Fshapepixmap" |
nround |
An integer. For numerical F matrices only. The number of decimal numbers to display. |
pixmap.color |
For pixmap plots. |
Nothing.
Bertrand Frederic, Myriam Maumy-Bertrand.
#For numerical/inferred F matrices plotF(CascadeFinit(4,4),choice="F", nround=1) if (requireNamespace("pixmap", quietly = TRUE)) { plotF(CascadeFinit(4,4),choice="Fpixmap") } else { plotF(CascadeFinit(4,4),choice="F", nround=1) } #For theoritical F matrices plotF(CascadeFshape(4,4),choice="Fshape") if (requireNamespace("pixmap", quietly = TRUE)) { plotF(CascadeFshape(4,4),choice="Fshapepixmap") } else { plotF(CascadeFshape(4,4),choice="Fshape") }
#For numerical/inferred F matrices plotF(CascadeFinit(4,4),choice="F", nround=1) if (requireNamespace("pixmap", quietly = TRUE)) { plotF(CascadeFinit(4,4),choice="Fpixmap") } else { plotF(CascadeFinit(4,4),choice="F", nround=1) } #For theoritical F matrices plotF(CascadeFshape(4,4),choice="Fshape") if (requireNamespace("pixmap", quietly = TRUE)) { plotF(CascadeFshape(4,4),choice="Fshapepixmap") } else { plotF(CascadeFshape(4,4),choice="Fshape") }
Returns the position of edges in the network Retrieve network position for consistent plotting. Utility function to plot networks.
## S4 method for signature 'omics_network' position(net, nv = 0)
## S4 method for signature 'omics_network' position(net, nv = 0)
net |
a omics_network object |
nv |
the level of cutoff at which the analysis should be done |
Matrix with as many rows as the number of edges of the network and three columns (name, xcoord, ycoord).
Returns a matrix with the position of the node. This matrix can then be used as an argument in the plot function.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(network) position(network)
data(network) position(network)
predict
Prediction of the gene expressions after a knock-out experience for cascade networks.
## S4 method for signature 'omics_array' predict( object, Omega, act_time_group = NULL, nv = 0, targets = NULL, adapt = TRUE )
## S4 method for signature 'omics_array' predict( object, Omega, act_time_group = NULL, nv = 0, targets = NULL, adapt = TRUE )
object |
a omics_array object. |
Omega |
a omics_network object. |
act_time_group |
[NULL] vector; at which time the groups (defined by sort(unique(group))) are activated ? |
nv |
[=0] numeric ; the level of the cutoff |
targets |
[NULL] vector ; which genes are knocked out ? |
adapt |
[TRUE] boolean; do not raise an error if used with vectors |
The plot of prediction of knock down experiments (i.e. targets<>NULL) is still in beta testing for the moment.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(Selection) data(infos) pbst_NR4A1 = infos[infos$hgnc_symbol=="NR4A1", "affy_hg_u133_plus_2"] pbst_EGR1 = infos[infos$hgnc_symbol=="EGR1", "affy_hg_u133_plus_2"] gene_IDs = infos[match(Selection@name, infos$affy_hg_u133_plus_), "hgnc_symbol"] data(networkCascade) #A nv value can chosen using the cutoff function nv = .02 NR4A1<-which(is.element(Selection@name,pbst_NR4A1)) EGR1<-which(is.element(Selection@name,pbst_EGR1)) P<-position(networkCascade,nv=nv) #We predict gene expression modulations within the network if NR4A1 is experimentaly knocked-out. prediction_ko5_NR4A1<-predict(Selection,networkCascade,nv=nv,targets=NR4A1,act_time_group=1:4) #Then we plot the results. Here for example we see changes at time points t2, t3 ans t4: plot(prediction_ko5_NR4A1,time=2:4,ini=P,label_v=gene_IDs) #We predict gene expression modulations within the network if EGR1 is experimentaly knocked-out. prediction_ko5_EGR1<-predict(Selection,networkCascade,nv=nv,targets=EGR1,act_time_group=1:4) #Then we plot the results. Here for example we see changes at time point t2, t3 ans t4: plot(prediction_ko5_EGR1,time=2:4,ini=P,label_v=gene_IDs)
data(Selection) data(infos) pbst_NR4A1 = infos[infos$hgnc_symbol=="NR4A1", "affy_hg_u133_plus_2"] pbst_EGR1 = infos[infos$hgnc_symbol=="EGR1", "affy_hg_u133_plus_2"] gene_IDs = infos[match(Selection@name, infos$affy_hg_u133_plus_), "hgnc_symbol"] data(networkCascade) #A nv value can chosen using the cutoff function nv = .02 NR4A1<-which(is.element(Selection@name,pbst_NR4A1)) EGR1<-which(is.element(Selection@name,pbst_EGR1)) P<-position(networkCascade,nv=nv) #We predict gene expression modulations within the network if NR4A1 is experimentaly knocked-out. prediction_ko5_NR4A1<-predict(Selection,networkCascade,nv=nv,targets=NR4A1,act_time_group=1:4) #Then we plot the results. Here for example we see changes at time points t2, t3 ans t4: plot(prediction_ko5_NR4A1,time=2:4,ini=P,label_v=gene_IDs) #We predict gene expression modulations within the network if EGR1 is experimentaly knocked-out. prediction_ko5_EGR1<-predict(Selection,networkCascade,nv=nv,targets=EGR1,act_time_group=1:4) #Then we plot the results. Here for example we see changes at time point t2, t3 ans t4: plot(prediction_ko5_EGR1,time=2:4,ini=P,label_v=gene_IDs)
Used to collapse probesets using the collapseRows function of the WGCNA package
## S4 method for signature 'omics_array' probeMerge(x, ...)
## S4 method for signature 'omics_array' probeMerge(x, ...)
x |
omicsarray |
... |
Additionnal parameters to the collapseRows function of the WGCNA package |
Formal class 'omics_array' [package "Patterns"] with 7 slots
Bertrand Frederic, Myriam Maumy-Bertrand.
if(require(CascadeData)){ data(micro_S) D<-as.omics_array(micro_S[1:2000,],1:4,6) D@gene_ID<-jetset::scores.hgu133plus2[D@name,"EntrezID"] PM <- probeMerge(D) }
if(require(CascadeData)){ data(micro_S) D<-as.omics_array(micro_S[1:2000,],1:4,6) D@gene_ID<-jetset::scores.hgu133plus2[D@name,"EntrezID"] PM <- probeMerge(D) }
F matrices utility function.
replaceBand(a, b, k)
replaceBand(a, b, k)
a |
The matrix to be replaced |
b |
The matrix with the replacement values |
k |
The extend of the replacement: 0 (diagonal only), 1 (diagonal and first extra diagonal), in general an entry is replaced if abs(row(a) - col(a)) <= k |
A matrix (same size as a)
Bertrand Frederic, Myriam Maumy-Bertrand.
a=matrix(1:9,3,3) b=matrix(0,3,3) replaceBand(a,b,0) replaceBand(a,b,1) replaceBand(a,b,2)
a=matrix(1:9,3,3) b=matrix(0,3,3) replaceBand(a,b,0) replaceBand(a,b,1) replaceBand(a,b,2)
F matrices utility function.
replaceDown(a, b, k)
replaceDown(a, b, k)
a |
The matrix to be replaced |
b |
The matrix with the replacement values |
k |
The extend of the replacement: 0 (lower part and diagonal only), 1 (lower part and first extra diagonal), in general an entry is replaced if -(row(a) - col(a)) <= k |
A matrix (same size as a)
Bertrand Frederic, Myriam Maumy-Bertrand.
a=matrix(1:9,3,3) b=matrix(1,3,3) replaceDown(a,b,0) replaceDown(a,b,1) replaceDown(a,b,2)
a=matrix(1:9,3,3) b=matrix(1,3,3) replaceDown(a,b,0) replaceDown(a,b,1) replaceDown(a,b,2)
F matrices utility function.
replaceUp(a, b, k)
replaceUp(a, b, k)
a |
The matrix to be replaced |
b |
The matrix with the replacement values |
k |
The extend of the replacement: 0 (upper part only), 1 (upper part and first extra diagonal), in general an entry is replaced if (row(a) - col(a)) <= k |
A matrix (same size as a)
Bertrand Frederic, Myriam Maumy-Bertrand.
a=matrix(1:9,3,3) b=matrix(1,3,3) replaceUp(a,b,0) replaceUp(a,b,1) replaceUp(a,b,2)
a=matrix(1:9,3,3) b=matrix(1,3,3) replaceUp(a,b,0) replaceUp(a,b,1) replaceUp(a,b,2)
20 (at most) genes with differential expression at t1, 20 (at most) genes with differential expression at t2, 20 (at most) genes with differential expression at t3, 20 (at most) genes with differential expression at t4 et 20 (at most) genes with global differential expression were selected.
Bertrand Frederic, Myriam Maumy-Bertrand.
data(Selection) head(Selection) summary(Selection,3)
data(Selection) head(Selection) summary(Selection,3)
Show
methodsMethods for generic function show
## S4 method for signature 'omics_array' show(object) ## S4 method for signature 'omics_network' show(object)
## S4 method for signature 'omics_array' show(object) ## S4 method for signature 'omics_network' show(object)
object |
an object of class omics-array or omics_network |
Print an object of class omics_array
Print an object of class omics_network
Bertrand Frederic, Myriam Maumy-Bertrand.
Summary
methodsMethods for function summary
## S4 method for signature 'omics_array' summary(object, nb.graph = NULL, ...)
## S4 method for signature 'omics_array' summary(object, nb.graph = NULL, ...)
object |
an object of class omics-array |
nb.graph |
(optionnal) choose the graph to plot. Displays all graphs by default. |
... |
additional parameters. |
method here~~
Bertrand Frederic, Myriam Maumy-Bertrand.
Makes the union between two omics_array objects.
## S4 method for signature 'omics_array,omics_array' unionOmics(M1, M2)
## S4 method for signature 'omics_array,omics_array' unionOmics(M1, M2)
M1 |
a omics-array or a list of omics-arrays |
M2 |
a omics-array or nothing if M1 is a list of omics-arrays |
Returns a omics_array object which is the union of M1 and M2.
Returns a omics_array object which is the union of the elements of M1.
Bertrand Frederic, Myriam Maumy-Bertrand.
if(require(CascadeData)){ data(micro_S, package="CascadeData") #Create another omicsarray object with 100 genes Mbis<-M<-as.omics_array(micro_S[1:100,],1:4,6) #Rename the 100 genes Mbis@name<-paste(M@name,"bis") rownames(Mbis@omicsarray) <- Mbis@name #Union (merge without duplicated names) of the two omicsarrays. str(unionOmics(M,Mbis)) }
if(require(CascadeData)){ data(micro_S, package="CascadeData") #Create another omicsarray object with 100 genes Mbis<-M<-as.omics_array(micro_S[1:100,],1:4,6) #Rename the 100 genes Mbis@name<-paste(M@name,"bis") rownames(Mbis@omicsarray) <- Mbis@name #Union (merge without duplicated names) of the two omicsarrays. str(unionOmics(M,Mbis)) }
Based on soft clustering performed by the Mfuzz package.
## S4 method for signature 'omics_array' unsupervised_clustering_auto_m_c( M1, clust = NULL, mestim = NULL, M2 = NULL, data_log = TRUE, screen = NULL, crange = NULL, repeats = NULL, cselect = TRUE, dminimum = FALSE )
## S4 method for signature 'omics_array' unsupervised_clustering_auto_m_c( M1, clust = NULL, mestim = NULL, M2 = NULL, data_log = TRUE, screen = NULL, crange = NULL, repeats = NULL, cselect = TRUE, dminimum = FALSE )
M1 |
Object of omics_array class. |
clust |
[NULL] Number of clusters. |
mestim |
[NULL] Fuzzification parameter. |
M2 |
[NULL] Object of omics_array class, |
data_log |
[TRUE] Should data be logged? |
screen |
[NULL] Specify 'screen' parameter. |
crange |
[NULL] Specify 'crange' parameter. |
repeats |
[NULL] Specify 'repeats' parameter. |
cselect |
[TRUE] Estimate 'cselect' parameter. |
dminimum |
[FALSE] Estimate 'dminimum' parameter. |
m |
Estimate of the optimal fuzzification parameter. |
c |
Estimate of the optimal number of clusters. |
csearch |
More result from the cselection function of the Mfuzz package |
Bertrand Frederic, Myriam Maumy-Bertrand.
if(require(CascadeData)){ data(micro_S, package="CascadeData") M<-as.omics_array(micro_S[1:100,],1:4,6) mc<-unsupervised_clustering_auto_m_c(M) }
if(require(CascadeData)){ data(micro_S, package="CascadeData") M<-as.omics_array(micro_S[1:100,],1:4,6) mc<-unsupervised_clustering_auto_m_c(M) }
Based on soft clustering performed by the Mfuzz package.
## S4 method for signature 'omics_array,numeric,numeric' unsupervised_clustering( M1, clust, mestim, M2 = NULL, data_log = TRUE, screen = NULL, heatmap = TRUE, new.window = TRUE )
## S4 method for signature 'omics_array,numeric,numeric' unsupervised_clustering( M1, clust, mestim, M2 = NULL, data_log = TRUE, screen = NULL, heatmap = TRUE, new.window = TRUE )
M1 |
Object of omics_array class. |
clust |
Number of clusters. |
mestim |
Fuzzification parameter. |
M2 |
[NULL] Object of omics_array class, |
data_log |
[TRUE] Should data be logged? |
screen |
[NULL] Specify 'mfrow' parameter. |
heatmap |
[TRUE] Plot heatmaps? |
new.window |
[TRUE] Use new window? |
An object of class omics_array with the group slot updated by groups deduced from the soft clustering result.
Bertrand Frederic, Myriam Maumy-Bertrand.
if(require(CascadeData)){ data(micro_S, package="CascadeData") M<-as.omics_array(micro_S[51:100,],1:4,6) mc<-unsupervised_clustering_auto_m_c(M) MwithGrp=unsupervised_clustering(M, 4, mc$m, screen=NULL, heatmap=FALSE, new.window = FALSE) # Other options unsupervised_clustering(M, 4, mc$m, screen=c(2,2), heatmap=TRUE, new.window = FALSE) # Plot the clusters plot(MwithGrp) }
if(require(CascadeData)){ data(micro_S, package="CascadeData") M<-as.omics_array(micro_S[51:100,],1:4,6) mc<-unsupervised_clustering_auto_m_c(M) MwithGrp=unsupervised_clustering(M, 4, mc$m, screen=NULL, heatmap=FALSE, new.window = FALSE) # Other options unsupervised_clustering(M, 4, mc$m, screen=c(2,2), heatmap=TRUE, new.window = FALSE) # Plot the clusters plot(MwithGrp) }