Finalscore_parallel_permutation: Derive final importance scores of interactions for one...

Description Usage Arguments Value References Examples

Description

This function returns final importance scores of interactions for one permuted data set run in parallel.

Usage

1
2
3
FinalScore_parallel_permutation(importance, model, genes.name,
                                 to.store=NULL)
                                 

Arguments

importance

A matrix containing importance scores. When model iRafNet is implemented, importance is a two dimensional matrix (p x p) with p being the total number of genes/proteins. When either function iJRF or ptmJRF is implemented, importance is a three dimensional matrix of importance scores (p x p x C) with p being the total number of genes/proteins and C the number of classes.

model

Variable indicating which iJRFNet model needs to be imlemented. Takes values in c("iJRF", "iRafNet","ptmJRF")

genes.name

Vector containing genes name. The order needs to match the rows/columns of importance.

to.store

Optional Integer. Total number of importance scores to be stored. When omitted, all importance scores will be returned. Note that to compute FDR and derive the final network via function Derive_network we do not need all (p-p) x p / 2 importance scores where p is the total number of proteins/genes. A sufficiently large number would work. This number is usually chosen based on the number of nodes and is the maximum number of interactions that you would expect.

Value

A matrix with to.store rows and C columns where to.store is the numbere of top importance scores and C is the number of classes. When to.store is omitted, all importance scores will be returned.

References

Petralia, F., Song, W.M., Tu, Z. and Wang, P. (2016). New method for joint network analysis reveals common and different coexpression patterns among genes and proteins in breast cancer. Journal of proteome research, 15(3), pp.743-754.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 # --- Generate data sets
 nclasses=2               # number of data sets / classes
 n1<-n2<-20               # sample size for each data sets
 p<-5                   # number of variables (genes/proteins)
 genes.name<-paste("G",seq(1,p),sep="")   # genes/proteins name
 
 data1<-matrix(rnorm(p*n1),p,n1)       # generate data1
 data2<-matrix(rnorm(p*n2),p,n1)       # generate data2

  ##---------------------------------------------------------------------------##
  ## ---  Run iJRF 
  
  # --- Run multiple jobs in parallel and combine them
   out.new<-array(0,c(p,p,nclasses))
   n.var=0
   for (k in 1:3){ 
      out<-iJRFNet_parallel_permutation(X=list(data1,data2),
      genes.name=genes.name, model="iJRF",parallel=c(k,2),seed=1)
      
      n.target<-dim(out$importance)[2]
      for (c in 1:nclasses) {
      out.new[,seq(n.var+1,n.var+n.target),c]<-out$importance[,,c];}
      n.var=n.var+n.target
    }
     
   # --- Derive interactions 
   FinalScore_parallel_permutation(importance=out.new,model="iJRF",
                                   genes.name=genes.name)

petraf01/iJRF documentation built on Dec. 22, 2021, 7:46 a.m.