Browse code

added a check to gettMotifs function in case the connection with the db does not work

Aufiero authored on 06/05/2025 16:29:59
Showing 1 changed files

... ...
@@ -247,6 +247,7 @@ getMotifs <-
247 247
         if (database == 'ATtRACT') {
248 248
             # Get motifs from attract data base (it contains motifs for 159 human RBPs)
249 249
             rbpMotifsFromDB <- .getRBPmotifsAttract(species)
250
+            
250 251
         } else if (database == 'MEME') {
251 252
             # Get MEME motifs (it contains motifs for 80 human RBPs)
252 253
             rbpMotifsFromDB <- .getRBPmotifsMEME(memeIndexFilePath)
... ...
@@ -278,6 +279,11 @@ getMotifs <-
278 279
                     .getReverseAttractRBPmotifs(rbpMotifsFromDB)
279 280
             } else if (nrow(rbpMotifsFromDB) > 0) {
280 281
                 rbpMotifsFromDBnew <- getReverseMotifs(rbpMotifsFromDB)
282
+            } else if (nrow(rbpMotifsFromDB) == 0){
283
+              
284
+              rbpMotifsFromDBnew <- rbpMotifsFromDB
285
+              cat("No motifs were retrieved from the database. Please check the connection to",
286
+                  database, "database")
281 287
             }
282 288
 
283 289