Browse code

accomodate tidy edges to work when refining by cell line

Shana White authored on 06/12/2017 18:18:54
Showing 2 changed files

... ...
@@ -67,9 +67,12 @@ function(pathwayid, cell_line = NA,
67 67
     if(!isS4(KGML)){
68 68
         return()
69 69
     }
70
-    KEGG_mappings <- 
71
-        expand_KEGG_mappings(KGML,convert_KEGG_IDs = convert_KEGG_IDs)
70
+    if (!refine_by_cell_line){
71
+        KEGG_mappings <- expand_KEGG_mappings(KGML,convert_KEGG_IDs = convert_KEGG_IDs)
72
+    }
73
+        
72 74
     if (refine_by_cell_line) {
75
+        KEGG_mappings <- expand_KEGG_mappings(KGML,convert_KEGG_IDs = convert_KEGG_IDs)
73 76
         full_mappings <- KEGG_mappings
74 77
         KEGG_mappings <- refine_mappings(KEGG_mappings, cell_line)
75 78
         for (i in 1:nrow(full_mappings)){
... ...
@@ -156,7 +156,7 @@ function(expanded_edges, data_added = FALSE, significance_markup = FALSE,
156 156
 
157 157
     if (tidy_edge == TRUE) {
158 158
       edge_IDs <- seq(min(expanded_edges$edgeID), max(expanded_edges$edgeID))
159
-      for (i in edge_IDs){
159
+      for (i in edge_IDs[edge_IDs %in% expanded_edges$edgeID]){
160 160
         if(data_added == TRUE){
161 161
           expanded_edges <- tidy_edge(edges = expanded_edges,
162 162
                                       edge_id = edge_IDs[i],