Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
COVID-19
models
Commits
a1c4489b
Commit
a1c4489b
authored
Jun 18, 2020
by
Marek Ostaszewski
Browse files
updates
parent
35710af3
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Curation/Renin-angiotensin pathway/SPIKE-ACE2-RAS_and_drugs_vers6d.pdf
0 → 100644
View file @
a1c4489b
File added
Curation/Renin-angiotensin pathway/SPIKE-ACE2-RAS_and_drugs_vers6d.xml
0 → 100644
View file @
a1c4489b
This diff is collapsed.
Click to expand it.
Curation/SARS-CoV-2 proteins/Orf3a/Orf3a_v2.pdf
0 → 100644
View file @
a1c4489b
File added
Curation/SARS-CoV-2 proteins/Orf3a/Orf3a_v2.xml
0 → 100644
View file @
a1c4489b
This diff is collapsed.
Click to expand it.
Integration/MINERVA_build/combine_sources.R
View file @
a1c4489b
...
...
@@ -93,23 +93,43 @@ construct_overview <- function(elements) {
### Resource: url to the xml content of the diagram
### Type: what kind of file do we integrate
### Name: under which name the diaram is to be shown in the build
res
<-
read.csv
(
url
(
"https://git-r3lab.uni.lu/covid/models/raw/master/Integration/MINERVA_build/resources.csv"
),
header
=
T
,
stringsAsFactors
=
F
)
# res <- read.csv(url("https://git-r3lab.uni.lu/covid/models/raw/master/Integration/MINERVA_build/resources.csv"),
# header = T, stringsAsFactors = F)
wps
<-
readLines
(
"https://raw.githubusercontent.com/wikipathways/SARS-CoV-2-WikiPathways/master/pathways.txt"
)
res
<-
data.frame
(
Include
=
"Yes"
,
Resource
=
paste0
(
"https://raw.githubusercontent.com/wikipathways/SARS-CoV-2-WikiPathways/master/gpml/"
,
wps
,
".gpml"
),
Type
=
"GPML"
,
Name
=
wps
)
### Filter only these to be included
res
<-
res
[
res
$
Include
==
"Yes"
,]
### Define the output dir
outdir
<-
"_notgit/output/"
### Just to simplify later writes
outdir_submaps
<-
paste0
(
outdir
,
"submaps/"
)
### Create output directory if not existing.
if
(
!
dir.exists
(
"
out
put/"
))
{
dir.create
(
"
out
put/"
)
}
if
(
!
dir.exists
(
out
dir
))
{
dir.create
(
out
dir
)
}
### Create submaps directory if not existing.
if
(
!
dir.exists
(
"
out
put/
submaps
/"
))
{
dir.create
(
"
out
put/
submaps
/"
)
}
if
(
!
dir.exists
(
out
dir_
submaps
))
{
dir.create
(
out
dir_
submaps
)
}
### For all resources
for
(
r
in
1
:
nrow
(
res
))
{
### Process the 'resources' table, all should be network-accessible (raw git)
message
(
paste0
(
"Processing: "
,
res
[
r
,]
$
Resource
))
con
<-
url
(
res
[
r
,]
$
Resource
)
rls
<-
paste
(
readLines
(
con
),
collapse
=
"\n"
)
conread
<-
try
(
readLines
(
con
),
silent
=
T
)
### Try retrieving a resource, end gracefully
if
(
class
(
conread
)
==
"try-error"
)
{
message
(
paste0
(
"Cannot read from "
,
res
[
r
,]
$
Resource
))
close
(
con
)
message
(
conread
)
next
}
rls
<-
paste
(
conread
,
collapse
=
"\n"
)
close
(
con
)
fin_cont
<-
NULL
### Depending on the type, process differently
...
...
@@ -125,7 +145,7 @@ for(r in 1:nrow(res)) {
}
### Write the result to a file
write_xml
(
fin_cont
,
file
=
paste0
(
"
out
put/
submaps
/"
,
res
[
r
,]
$
Name
,
".xml"
))
write_xml
(
fin_cont
,
file
=
paste0
(
out
dir_
submaps
,
res
[
r
,]
$
Name
,
".xml"
))
message
(
"Done.\n\n"
)
}
...
...
@@ -142,7 +162,7 @@ if(reconstruct_overview) {
ovw
<-
gsub
(
"width=\"90.0\" height=\"30.0\""
,
"width=\"190.0\" height=\"40.0\""
,
ovw
)
ovw
<-
gsub
(
"color=\"FFCC99FF\""
,
"color=\"FFCCFFFF\""
,
ovw
)
cat
(
ovw
,
file
=
paste0
(
"
out
put/
overview.xml"
))
cat
(
ovw
,
file
=
paste0
(
out
dir
,
"
overview.xml"
))
}
if
(
reconstruct_mapping
)
{
...
...
@@ -164,8 +184,8 @@ if(reconstruct_mapping) {
}
### Write to file, read in as an xml structure
cat
(
mapping
,
file
=
"output/
submaps
/
mapping.xml"
,
sep
=
"\n"
)
mapn
<-
read_xml
(
"output/
submaps
/
mapping.xml"
)
cat
(
mapping
,
file
=
paste0
(
outdir_
submaps
,
"
mapping.xml"
)
,
sep
=
"\n"
)
mapn
<-
read_xml
(
paste0
(
outdir_
submaps
,
"
mapping.xml"
)
)
### Remove all reactions whose baseReactant species is a placeholder
for
(
sp
in
xml_find_all
(
mapn
,
"//cd:species"
,
ns_cd
))
{
...
...
@@ -177,5 +197,5 @@ if(reconstruct_mapping) {
}
### Write down the trimmed file
write_xml
(
mapn
,
"output/
submaps
/
mapping.xml"
)
write_xml
(
mapn
,
paste0
(
outdir_
submaps
,
"
mapping.xml"
)
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment