Skip to content

Commit 3c01d3b

Browse files
authored
Merge pull request #27 from saezlab/no_solver
0 length seeds protection
2 parents 1acf92a + 63d7862 commit 3c01d3b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

R/compress_same_children.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,12 @@ decompress_solution_network <- function(formatted_res, meta_network, node_signat
221221
seeds <- SIF[!(SIF[,1] %in% SIF[,2]),1]
222222
bad_seeds <- seeds[!(seeds %in% ATT[ATT$NodeType == "P","Nodes"])]
223223

224-
ATT <- ATT[!(ATT$Nodes %in% bad_seeds),]
225-
SIF <- SIF[SIF$source %in% ATT$Nodes &
226-
SIF$target %in% ATT$Nodes,]
224+
if(length(bad_seeds) > 0)
225+
{
226+
ATT <- ATT[!(ATT$Nodes %in% bad_seeds),]
227+
SIF <- SIF[SIF$source %in% ATT$Nodes &
228+
SIF$target %in% ATT$Nodes,]
229+
}
227230

228231
formatted_res <- list(SIF,ATT)
229232

0 commit comments

Comments
 (0)