libsbgnpy 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- libsbgnpy/__init__.py +16 -0
- libsbgnpy/examples/__init__.py +0 -0
- libsbgnpy/examples/extension_example.py +103 -0
- libsbgnpy/examples/info_example.py +70 -0
- libsbgnpy/examples/notes_example.py +66 -0
- libsbgnpy/examples/read_example.py +35 -0
- libsbgnpy/examples/sbgn/adh.sbgn +61 -0
- libsbgnpy/examples/sbgn/glycolysis.sbgn +375 -0
- libsbgnpy/examples/sbgn/neuronal_muscle_signalling_color.sbgn +439 -0
- libsbgnpy/examples/sbgn/notes.sbgn +13 -0
- libsbgnpy/examples/sbgn/test-output-01.sbgn +8 -0
- libsbgnpy/examples/sbgn/test-output-02.sbgn +59 -0
- libsbgnpy/examples/sbgn/test-output-03.sbgn +16 -0
- libsbgnpy/examples/write_example.py +223 -0
- libsbgnpy/libsbgn.py +4490 -0
- libsbgnpy/libsbgnSubs.py +127 -0
- libsbgnpy/libsbgnTypes.py +112 -0
- libsbgnpy/render.py +59 -0
- libsbgnpy/sbo/__init__.py +0 -0
- libsbgnpy/sbo/sbgn_sbo_mapping.txt +1304 -0
- libsbgnpy/sbo/sbo2sbgn.py +58 -0
- libsbgnpy/sbo/sbo_sbgn_map.txt +38 -0
- libsbgnpy/schema/README.md +156 -0
- libsbgnpy/schema/SBGN.xsd +1018 -0
- libsbgnpy/schema/__init__.py +0 -0
- libsbgnpy/utils.py +93 -0
- libsbgnpy/validation/__init__.py +0 -0
- libsbgnpy/validation/error-test-files/AF/af10101-fail.sbgn +34 -0
- libsbgnpy/validation/error-test-files/AF/af10101-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10102-fail-1.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10102-fail-2.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10102-fail-3.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10102-fail-4.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10102-pass.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10103-fail.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10103-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10104-fail.sbgn +34 -0
- libsbgnpy/validation/error-test-files/AF/af10104-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10109-fail.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10109-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10110-fail.sbgn +34 -0
- libsbgnpy/validation/error-test-files/AF/af10111-fail.sbgn +42 -0
- libsbgnpy/validation/error-test-files/AF/af10111-pass.sbgn +26 -0
- libsbgnpy/validation/error-test-files/AF/af10112-fail.sbgn +25 -0
- libsbgnpy/validation/error-test-files/AF/af10113-fail.sbgn +17 -0
- libsbgnpy/validation/error-test-files/ER/er10103-fail.sbgn +29 -0
- libsbgnpy/validation/error-test-files/ER/er10103-pass.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10104-fail.sbgn +31 -0
- libsbgnpy/validation/error-test-files/ER/er10104-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-1.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-2.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-3.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-4.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-5.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-6.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-pass.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-1.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-2.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-3.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-4.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-5.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-6.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-pass.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10108-fail-1.sbgn +43 -0
- libsbgnpy/validation/error-test-files/ER/er10108-fail-2.sbgn +43 -0
- libsbgnpy/validation/error-test-files/ER/er10108-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/ER/er10109-fail.sbgn +40 -0
- libsbgnpy/validation/error-test-files/ER/er10109-pass.sbgn +40 -0
- libsbgnpy/validation/error-test-files/ER/er10111-fail.sbgn +53 -0
- libsbgnpy/validation/error-test-files/ER/er10111-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/ER/er20001-fail.sbgn +55 -0
- libsbgnpy/validation/error-test-files/ER/er20001-pass.sbgn +57 -0
- libsbgnpy/validation/error-test-files/PD/pd10101-fail.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10101-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10102-fail.sbgn +55 -0
- libsbgnpy/validation/error-test-files/PD/pd10102-pass.sbgn +55 -0
- libsbgnpy/validation/error-test-files/PD/pd10103-fail.sbgn +37 -0
- libsbgnpy/validation/error-test-files/PD/pd10103-pass.sbgn +45 -0
- libsbgnpy/validation/error-test-files/PD/pd10104-fail.sbgn +55 -0
- libsbgnpy/validation/error-test-files/PD/pd10104-pass.sbgn +47 -0
- libsbgnpy/validation/error-test-files/PD/pd10105-fail.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10105-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10106-fail.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10106-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10107-fail.sbgn +37 -0
- libsbgnpy/validation/error-test-files/PD/pd10107-pass.sbgn +45 -0
- libsbgnpy/validation/error-test-files/PD/pd10108-fail.sbgn +42 -0
- libsbgnpy/validation/error-test-files/PD/pd10108-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-1.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-2.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-3.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-4.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-5.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-1.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-2.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-3.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-4.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-5.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10111-fail-2.sbgn +72 -0
- libsbgnpy/validation/error-test-files/PD/pd10111-fail.sbgn +72 -0
- libsbgnpy/validation/error-test-files/PD/pd10111-pass.sbgn +68 -0
- libsbgnpy/validation/error-test-files/PD/pd10112-fail-1.sbgn +28 -0
- libsbgnpy/validation/error-test-files/PD/pd10112-fail-2.sbgn +28 -0
- libsbgnpy/validation/error-test-files/PD/pd10112-pass.sbgn +28 -0
- libsbgnpy/validation/error-test-files/PD/pd10124-fail.sbgn +67 -0
- libsbgnpy/validation/error-test-files/PD/pd10124-pass.sbgn +67 -0
- libsbgnpy/validation/error-test-files/PD/pd10125-fail.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10126-fail.sbgn +53 -0
- libsbgnpy/validation/error-test-files/PD/pd10126-pass.sbgn +45 -0
- libsbgnpy/validation/error-test-files/PD/pd10127-fail.sbgn +21 -0
- libsbgnpy/validation/error-test-files/PD/pd10127-pass.sbgn +17 -0
- libsbgnpy/validation/error-test-files/PD/pd10128-fail.sbgn +21 -0
- libsbgnpy/validation/error-test-files/PD/pd10128-pass.sbgn +17 -0
- libsbgnpy/validation/error-test-files/PD/pd10131-fail.sbgn +9 -0
- libsbgnpy/validation/error-test-files/PD/pd10131-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10132-fail.sbgn +10 -0
- libsbgnpy/validation/error-test-files/PD/pd10132-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10140-fail.sbgn +31 -0
- libsbgnpy/validation/error-test-files/PD/pd10140-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10141-fail.sbgn +11 -0
- libsbgnpy/validation/error-test-files/PD/pd10141-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10142-fail.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10142-pass.sbgn +53 -0
- libsbgnpy/validation/error-test-files/error_notes.txt +7 -0
- libsbgnpy/validation/rules/sbgn_af.sch +275 -0
- libsbgnpy/validation/rules/sbgn_er.sch +288 -0
- libsbgnpy/validation/rules/sbgn_pd.sch +634 -0
- libsbgnpy/validation/schematron/ExtractSchFromRNG.xsl +75 -0
- libsbgnpy/validation/schematron/ExtractSchFromXSD.xsl +77 -0
- libsbgnpy/validation/schematron/iso-schematron-xslt1.zip +0 -0
- libsbgnpy/validation/schematron/iso-schematron-xslt2.zip +0 -0
- libsbgnpy/validation/schematron/iso_abstract_expand.xsl +297 -0
- libsbgnpy/validation/schematron/iso_dsdl_include.xsl +1509 -0
- libsbgnpy/validation/schematron/iso_schematron_message.xsl +55 -0
- libsbgnpy/validation/schematron/iso_schematron_skeleton_for_xslt1.xsl +1841 -0
- libsbgnpy/validation/schematron/iso_svrl_for_xslt1.xsl +604 -0
- libsbgnpy/validation/schematron/readme.txt +101 -0
- libsbgnpy/validation/schematron/schematron-skeleton-api.htm +723 -0
- libsbgnpy/validation/validator.py +141 -0
- libsbgnpy-0.3.0.dist-info/METADATA +91 -0
- libsbgnpy-0.3.0.dist-info/RECORD +145 -0
- libsbgnpy-0.3.0.dist-info/WHEEL +4 -0
- libsbgnpy-0.3.0.dist-info/licenses/LICENSE +7 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""
|
|
2
|
+
SBOTerm to SBGN mapping.
|
|
3
|
+
|
|
4
|
+
Cleanup based on initial mapping provided by Augustin.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import re
|
|
8
|
+
from collections import defaultdict
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Tuple
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _clean_line(line: str) -> Tuple[str, str]:
|
|
14
|
+
"""Parse sbo and sbgn from single line."""
|
|
15
|
+
tokens = [item.strip() for item in line.split("!")]
|
|
16
|
+
sbo = tokens[0].split(" ")[1]
|
|
17
|
+
sbgn = tokens[1].replace(".", "")
|
|
18
|
+
return sbo, sbgn
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _is_sbo(sbo_term: str) -> bool:
|
|
22
|
+
"""Check is sbo_term is really a SBO term."""
|
|
23
|
+
res = re.search(r"^SBO:\d{7}$", sbo_term)
|
|
24
|
+
return res is not None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def read_sbo2sbgn(filename: Path) -> dict[str, set[str]]:
|
|
28
|
+
"""Read the initial mapping."""
|
|
29
|
+
sbo2sbgn: dict[str, set(str)] = defaultdict(set)
|
|
30
|
+
with open(filename, "r") as f_in:
|
|
31
|
+
for line in f_in:
|
|
32
|
+
sbo, sbgn = _clean_line(line)
|
|
33
|
+
sbo2sbgn[sbo].add(sbgn)
|
|
34
|
+
return sbo2sbgn
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def write_sbo2sbgn(outfile: Path, sbo2sbgn: dict[str, set[str]]) -> None:
|
|
38
|
+
"""Write the sorted entries."""
|
|
39
|
+
|
|
40
|
+
with open(outfile, "w") as f_out:
|
|
41
|
+
for sbo in sorted(sbo2sbgn.keys()):
|
|
42
|
+
sbgn_set = sorted(sbo2sbgn[sbo])
|
|
43
|
+
if not _is_sbo(sbo):
|
|
44
|
+
print("Not SBO:", sbo, sbgn_set)
|
|
45
|
+
else:
|
|
46
|
+
f_out.write(f"{sbo}\t{sbgn_set}\n")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
"""
|
|
51
|
+
Cleanup of mapping and writing to file.
|
|
52
|
+
"""
|
|
53
|
+
infile = Path(__file__).parent / "sbgn_sbo_mapping.txt"
|
|
54
|
+
outfile = Path(__file__).parent / "sbo_sbgn_map.txt"
|
|
55
|
+
|
|
56
|
+
sbo2sbgn = read_sbo2sbgn(infile)
|
|
57
|
+
print(sbo2sbgn)
|
|
58
|
+
write_sbo2sbgn(outfile, sbo2sbgn)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
SBO:0000167 ['reaction']
|
|
2
|
+
SBO:0000168 ['control']
|
|
3
|
+
SBO:0000169 ['inhibition']
|
|
4
|
+
SBO:0000170 ['inhibition', 'stimulation']
|
|
5
|
+
SBO:0000171 ['necessary stimulation']
|
|
6
|
+
SBO:0000172 ['catalysis']
|
|
7
|
+
SBO:0000173 ['and']
|
|
8
|
+
SBO:0000174 ['or']
|
|
9
|
+
SBO:0000177 ['binding', 'non-covalent binding']
|
|
10
|
+
SBO:0000180 ['dissociation']
|
|
11
|
+
SBO:0000225 ['delay']
|
|
12
|
+
SBO:0000238 ['not']
|
|
13
|
+
SBO:0000245 ['entity', 'macromolecule']
|
|
14
|
+
SBO:0000247 ['simple chemical', 'simple chemical \\glyphContainer A']
|
|
15
|
+
SBO:0000253 ['non-covalent complex']
|
|
16
|
+
SBO:0000285 ['material entity of unknown nature', 'material entity of unspecified nature']
|
|
17
|
+
SBO:0000286 ['multimer']
|
|
18
|
+
SBO:0000291 ['empty set']
|
|
19
|
+
SBO:0000354 ['genetic entity', 'informational molecule segment']
|
|
20
|
+
SBO:0000357 ['perturbation']
|
|
21
|
+
SBO:0000358 ['observable', 'phenotype']
|
|
22
|
+
SBO:0000375 ['process']
|
|
23
|
+
SBO:0000393 ['production']
|
|
24
|
+
SBO:0000394 ['consumption']
|
|
25
|
+
SBO:0000395 ['encapsulating process']
|
|
26
|
+
SBO:0000396 ['uncertain process']
|
|
27
|
+
SBO:0000398 ['logical relationship']
|
|
28
|
+
SBO:0000405 ['perturbing agent']
|
|
29
|
+
SBO:0000407 ['absolute inhibition']
|
|
30
|
+
SBO:0000409 ['interaction outcome']
|
|
31
|
+
SBO:0000411 ['absolute stimulation']
|
|
32
|
+
SBO:0000412 ['biological activity']
|
|
33
|
+
SBO:0000418 ['multimer of complexes']
|
|
34
|
+
SBO:0000419 ['multimer of informational molecule segments']
|
|
35
|
+
SBO:0000420 ['multimer of macromolecules']
|
|
36
|
+
SBO:0000421 ['multimer of simple chemicals']
|
|
37
|
+
SBO:0000464 ['state variable assignment']
|
|
38
|
+
SBO:0000550 ['annotation']
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Generate python bindings
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
The python language bindings were created from the XML schema using
|
|
5
|
+
generateDS and than adapted to include GlyphClasses and ArcClasses.
|
|
6
|
+
|
|
7
|
+
The latest versions support py2 and py3 (>0.24a0)
|
|
8
|
+
```
|
|
9
|
+
sudo pip install generateDS
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
/usr/local/bin/generateDS.py -o "libsbgn.py" -s "libsbgnSubs.py" SBGN.xsd
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Additional changes to the mapping after creation:
|
|
17
|
+
|
|
18
|
+
**Adding write function**
|
|
19
|
+
```{python}
|
|
20
|
+
class SBGNBase ->
|
|
21
|
+
|
|
22
|
+
def write_file(self, outfile, namespace='sbgn'):
|
|
23
|
+
""" Write SBGN to file
|
|
24
|
+
|
|
25
|
+
Necessary to fix the issue of the sbgn namespace prefix.
|
|
26
|
+
|
|
27
|
+
:param outfile:
|
|
28
|
+
:type outfile:
|
|
29
|
+
:return:
|
|
30
|
+
"""
|
|
31
|
+
f = open(outfile, 'w')
|
|
32
|
+
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
|
|
33
|
+
self.export(f, level=0, namespace_='sbgn', name_='')
|
|
34
|
+
f.close()
|
|
35
|
+
|
|
36
|
+
# this is a bad hack to remove the namespaces, because
|
|
37
|
+
# most of the SBGN tools do not support them.
|
|
38
|
+
import fileinput
|
|
39
|
+
f = fileinput.input(outfile, inplace=True)
|
|
40
|
+
|
|
41
|
+
for line in f:
|
|
42
|
+
# remove prefix from closing tags, and unnecessary namespace
|
|
43
|
+
line = line.replace(' xmlns:sbgn="http://sbgn.org/libsbgn/0.2"', '')
|
|
44
|
+
line = line.replace('sbgn:', '')
|
|
45
|
+
line = line.replace('<sbgn>', '<sbgn xmlns="http://sbgn.org/libsbgn/0.2">')
|
|
46
|
+
print(line, end='')
|
|
47
|
+
|
|
48
|
+
f.close()
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Adding type checks**
|
|
52
|
+
```{python}
|
|
53
|
+
class map ->
|
|
54
|
+
|
|
55
|
+
def get_language(self):
|
|
56
|
+
""" Get the Language.
|
|
57
|
+
:return: Language instance.
|
|
58
|
+
"""
|
|
59
|
+
return Language(self.language)
|
|
60
|
+
|
|
61
|
+
def set_language(self, language):
|
|
62
|
+
""" Sets the language and checks that within allowed values.
|
|
63
|
+
:param language:
|
|
64
|
+
:return:
|
|
65
|
+
"""
|
|
66
|
+
if language and not isinstance(language, Language):
|
|
67
|
+
raise TypeError('language must be of type Language')
|
|
68
|
+
if language:
|
|
69
|
+
self.language = _cast(None, language.value)
|
|
70
|
+
else:
|
|
71
|
+
self.language = _cast(None, language)
|
|
72
|
+
|
|
73
|
+
__init__
|
|
74
|
+
self.language = self.set_language(language)
|
|
75
|
+
self.set_language(language)
|
|
76
|
+
|
|
77
|
+
class glyph ->
|
|
78
|
+
|
|
79
|
+
def get_class(self):
|
|
80
|
+
""" Returns the GlyphClass."""
|
|
81
|
+
return GlyphClass(self.class_)
|
|
82
|
+
|
|
83
|
+
def set_class(self, class_):
|
|
84
|
+
""" Sets the class and checks that in allowed GlyphClasses
|
|
85
|
+
:param class_:
|
|
86
|
+
:return:
|
|
87
|
+
"""
|
|
88
|
+
if class_ and not isinstance(class_, GlyphClass):
|
|
89
|
+
raise TypeError('class must be of type GlyphClass')
|
|
90
|
+
if class_:
|
|
91
|
+
self.class_ = _cast(None, class_.value)
|
|
92
|
+
else:
|
|
93
|
+
self.class_ = _cast(None, class_)
|
|
94
|
+
|
|
95
|
+
def get_orientation(self):
|
|
96
|
+
""" Get orientation.
|
|
97
|
+
:return: Orientation instance.
|
|
98
|
+
"""
|
|
99
|
+
return Orientation(self.orientation)
|
|
100
|
+
|
|
101
|
+
def set_orientation(self, orientation):
|
|
102
|
+
""" Sets orientation and checks that allowed Orientation.
|
|
103
|
+
|
|
104
|
+
:param orientation:
|
|
105
|
+
:return:
|
|
106
|
+
"""
|
|
107
|
+
if not isinstance(orientation, Orientation):
|
|
108
|
+
raise TypeError('orientation must be of type Orientation')
|
|
109
|
+
self.orientation = _cast(None, orientation.value)
|
|
110
|
+
|
|
111
|
+
__init__
|
|
112
|
+
self.set_class(class_)
|
|
113
|
+
self.set_orientation(orientation)
|
|
114
|
+
|
|
115
|
+
class arc ->
|
|
116
|
+
|
|
117
|
+
def get_class(self):
|
|
118
|
+
""" Get the ArcClass. """
|
|
119
|
+
return ArcClass(self.class_)
|
|
120
|
+
|
|
121
|
+
def set_class(self, class_):
|
|
122
|
+
""" Set the ArcClass.
|
|
123
|
+
:param class_:
|
|
124
|
+
:return:
|
|
125
|
+
"""
|
|
126
|
+
if class_ and not isinstance(class_, ArcClass):
|
|
127
|
+
raise TypeError('class must be of type ArcClass')
|
|
128
|
+
if class_:
|
|
129
|
+
self.class_ = _cast(None, class_.value)
|
|
130
|
+
else:
|
|
131
|
+
self.class_ = _cast(None, class_)
|
|
132
|
+
|
|
133
|
+
__init__
|
|
134
|
+
self.set_class(class_)
|
|
135
|
+
```
|
|
136
|
+
**Fixing bugs in automatic creation**
|
|
137
|
+
```
|
|
138
|
+
class bbox ->
|
|
139
|
+
# change order of arguments for backwards compatibility
|
|
140
|
+
def __init__(self, x=None, y=None, w=None, h=None, notes=None, extension=None):
|
|
141
|
+
|
|
142
|
+
class calloutType ->
|
|
143
|
+
# ensure that id is written in SBGN
|
|
144
|
+
def set_target(self, target):
|
|
145
|
+
if isinstance(target, glyph):
|
|
146
|
+
self.target = target.get_id()
|
|
147
|
+
else:
|
|
148
|
+
self.target = target
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Overwrite namespace prefix**
|
|
153
|
+
```
|
|
154
|
+
namespace_='sbgn:' -> namespace_='namespace_'
|
|
155
|
+
self.exportChildren(outfile, level + 1, namespace_=namespace_, name_='point', pretty_print=pretty_print)
|
|
156
|
+
```
|