Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
general
ccb
sybilSBML
Commits
7231dce5
Commit
7231dce5
authored
Dec 01, 2016
by
Habil, Ardalan (arhab001)
Browse files
BUG compartment FIX
parent
cf61cc58
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/readSBMLmod.R
View file @
7231dce5
...
@@ -413,7 +413,7 @@ if (is.null(compartmentsList)) {
...
@@ -413,7 +413,7 @@ if (is.null(compartmentsList)) {
}
}
missingId
(
compartmentsList
)
missingId
(
compartmentsList
)
sybil
::
mod_compart
(
mod
)
<-
compartmentsList
[[
"id"
]]
comp_tmp_id
<-
compartmentsList
[[
"id"
]]
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
...
@@ -1056,6 +1056,27 @@ if(newSybil)
...
@@ -1056,6 +1056,27 @@ if(newSybil)
}
}
#------------------------------------------------------------------------------#
# compartments Attr @Ardalan #
#------------------------------------------------------------------------------#
# Define SKIP_COMPARTMENT FALSE= HAS NO REFERENCE
met_comp_tmp
<-
metabolitesList
[[
"compartment"
]][
met_id_pos
][
SKIP_METABOLITE
]
SKIP_COMPARTMENT
<-
comp_tmp_id
%in%
unique
(
met_comp_tmp
)
sybil
::
mod_compart
(
mod
)
<-
comp_tmp_id
[
SKIP_COMPARTMENT
]
numcom
<-
length
(
mod_compart
(
mod
))
comannotation
<-
compartmentsList
[[
"annotation"
]][
SKIP_COMPARTMENT
]
comnotes
<-
compartmentsList
[[
"notes"
]][
SKIP_COMPARTMENT
]
if
(
newSybil
)
{
sybil
::
comp_attr
(
mod
)
<-
data.frame
(
row.names
=
1
:
numcom
)
if
(
!
is.null
(
comannotation
)
&&
length
(
comannotation
)
==
numcom
)
sybil
::
comp_attr
(
mod
)[[
'annotation'
]]
<-
comannotation
if
(
!
is.null
(
comnotes
)
&&
length
(
comnotes
)
==
numcom
)
sybil
::
comp_attr
(
mod
)[[
'notes'
]]
<-
comnotes
}
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# metabolite id's #
# metabolite id's #
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
...
@@ -1071,7 +1092,7 @@ sybil::met_id(mod) <- gsub("-", "_", met_id_tmp, fixed = TRUE)
...
@@ -1071,7 +1092,7 @@ sybil::met_id(mod) <- gsub("-", "_", met_id_tmp, fixed = TRUE)
# metabolite compartments #
# metabolite compartments #
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
met_comp_tmp
<-
metabolitesList
[[
"compartment"
]][
met_id_pos
][
SKIP_METABOLITE
]
#
met_comp_tmp <- metabolitesList[["compartment"]][met_id_pos][SKIP_METABOLITE]
sybil
::
met_comp
(
mod
)
<-
match
(
met_comp_tmp
,
sybil
::
mod_compart
(
mod
))
sybil
::
met_comp
(
mod
)
<-
match
(
met_comp_tmp
,
sybil
::
mod_compart
(
mod
))
...
@@ -1149,20 +1170,6 @@ if(newSybil)
...
@@ -1149,20 +1170,6 @@ if(newSybil)
}
}
#------------------------------------------------------------------------------#
# compartments Attr @Ardalan #
#------------------------------------------------------------------------------#
sybil
::
mod_compart
(
mod
)
<-
sybil
::
mod_compart
(
mod
)[
sort
(
unique
(
sybil
::
met_comp
(
mod
)))]
numcom
<-
length
(
mod_compart
(
mod
))
comannotation
<-
compartmentsList
[[
"annotation"
]]
comnotes
<-
compartmentsList
[[
"notes"
]]
if
(
newSybil
)
{
sybil
::
comp_attr
(
mod
)
<-
data.frame
(
row.names
=
1
:
numcom
)
if
(
!
is.null
(
comannotation
)
&&
length
(
comannotation
)
==
numcom
)
sybil
::
comp_attr
(
mod
)[[
'annotation'
]]
<-
comannotation
if
(
!
is.null
(
comnotes
)
&&
length
(
comnotes
)
==
numcom
)
sybil
::
comp_attr
(
mod
)[[
'notes'
]]
<-
comnotes
}
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
...
...
Write
Preview
Supports
Markdown
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