Browse code

'prova'

claudia.cava authored on 16/04/2019 11:04:47
Showing 2 changed files

... ...
@@ -1,8 +1,8 @@
1 1
 Package: StarBioTrek
2 2
 Type: Package
3 3
 Title: StarBioTrek
4
-Version: 1.9.4
5
-Date: 04-15-2019
4
+Version: 1.9.5
5
+Date: 04-16-2019
6 6
 Author: Claudia Cava,
7 7
     Isabella Castiglioni
8 8
 Maintainer: Claudia Cava <claudia.cava@ibfm.cnr.it>
... ...
@@ -234,6 +234,14 @@ eucdistcrtlk <- function(dataFilt,pathway_exp){
234 234
 #heatmap(as.matrix(score_euc_dista_t),scale="column",margins =c(12,9))
235 235
 
236 236
 
237
+#listpathgenees<-GE_matrix(dataFilt,pathway_exp)
238
+#listpathgenees<-listpathgenees[!sapply(listpathgenees, is.null)]
239
+#listpathgenees<-lapply(listpathgenees,function(x) apply(x,2,sd))
240
+
241
+
242
+#listpathgenees<-listpathgenees[!sapply(listpathgenees, function(x) all(is.na(x)))]
243
+#gsmatrix_sd<-do.call("rbind",listpathgenees)
244
+
237 245
 
238 246
 #' @title For TCGA data get human pathway data and creates a measure of standard deviations among pathways 
239 247
 #' @description stdv creates a matrix with standard deviation for pathways  
... ...
@@ -255,9 +263,6 @@ stdv<-function(gslist){
255 263
 
256 264
 
257 265
 
258
-
259
-
260
-
261 266
 #' @title For TCGA data get human pathway data and creates a measure of discriminating score among pathways 
262 267
 #' @description dsscorecrtlk creates a matrix with  discriminating score for pathways  
263 268
 #' @param dataFilt TCGA matrix
... ...
@@ -269,6 +274,13 @@ stdv<-function(gslist){
269 274
 dsscorecrtlk<-function(dataFilt,pathway_exp){
270 275
   listpathgenees<-GE_matrix(dataFilt,pathway_exp)
271 276
   PEAmatrix<-average(listpathgenees)
277
+  
278
+  # standard deviation
279
+  PEAmatrix_sd<-stdv(listpathgenees)
280
+  r<-intersect(rownames(PEAmatrix),rownames(PEAmatrix_sd))
281
+  PEAmatrix<-PEAmatrix[r,]
282
+  PEAmatrix_sd<-PEAmatrix_sd[r,]
283
+  
272 284
   #step 5 distance
273 285
   # EUCLIDEA DISTANCE
274 286
   df=combn(rownames(PEAmatrix),2) # possibili relazioni tra i pathway
... ...
@@ -281,7 +293,7 @@ dsscorecrtlk<-function(dataFilt,pathway_exp){
281 293
     distance<-dist(patients) # calcolo distanza EUCLIDEA tra le possibile combinazioni
282 294
     ma_d[,p]<-distance
283 295
   }
284
-  PEAmatrix_sd<-stdv(listpathgenees)
296
+  
285 297
   df=combn(rownames(PEAmatrix_sd),2) 
286 298
   df=t(df)
287 299
   ma<-matrix(0,nrow(df),ncol(PEAmatrix_sd)) # creo matrix che conterr le somme delle dev st
... ...
@@ -300,8 +312,9 @@ dsscorecrtlk<-function(dataFilt,pathway_exp){
300 312
   for( i in 1: ncol(pp2)){
301 313
     pp2[,i] <- as.numeric(as.character(pp2[,i]))
302 314
   
303
-return(pp2)
304
-}
315
+
316
+  }
317
+  return(pp2)
305 318
 }
306 319
 
307 320