From de2fee0ddc906540dce0fe0aadd985c4515b6294 Mon Sep 17 00:00:00 2001
From: Sajjad Ghaffarinasabsharabiani <ghaffas@hhu.de>
Date: Tue, 9 Aug 2022 10:25:15 +0000
Subject: [PATCH] Upload New File

---
 .../modelchecks/readModels.R                  | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 networkComplexityBigg/modelchecks/readModels.R

diff --git a/networkComplexityBigg/modelchecks/readModels.R b/networkComplexityBigg/modelchecks/readModels.R
new file mode 100644
index 0000000..3c4d31a
--- /dev/null
+++ b/networkComplexityBigg/modelchecks/readModels.R
@@ -0,0 +1,25 @@
+#!/usr/bin/Rscript
+
+library(methods)
+library(sybilSBML)
+library(parallel)
+
+f <- dir("../sourceData/models", pattern="*.xml", full.names=T)
+
+m <- mclapply(f, function(x){
+                tryCatch(readSBMLmod(x), error=function(e) NULL )
+        }
+)
+
+names(m) <- gsub("\\.xml", "", gsub(".*/models/", "", f))
+
+cat("Problem with following models:\n")
+err <- !sapply(m, is, "modelorg")
+print(f[err])
+
+m <- m[sapply(m, is, "modelorg")]
+
+
+save(m, file="models.Rdata")
+
+
-- 
GitLab