Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support values are node-level attributes, not edge-level.

  • Loading branch information...
commit 2201c658af318518bb08de66773ad53d0e27663c 1 parent f9f4315
@bendmorris bendmorris authored etal committed
Showing with 8 additions and 9 deletions.
  1. +7 −8 Bio/Phylo/CDAOIO.py
  2. +1 −1  Tests/CDAO/test.cdao
View
15 Bio/Phylo/CDAOIO.py
@@ -235,9 +235,6 @@ def get_node_info(self, model, context=None):
if 'value' in annotation:
node_info['branch_length'] = float(annotation['value'])
- if 'confidence' in edge:
- node_info['confidence'] = float(edge['confidence'])
-
if 'tu' in obj:
# if this object points to a TU, we need the label of that TU
tu = self.obj_info[obj['tu']]
@@ -425,6 +422,13 @@ def process_clade(self, clade, parent=None, root=False):
(nUri(clade.uri), qUri('cdao:has_Parent'), nUri(parent.uri)),
(nUri(parent.uri), qUri('cdao:belongs_to_Edge_as_Parent'), nUri(edge_uri)),
]
+
+ if hasattr(clade, 'confidence') and not clade.confidence is None:
+ confidence = RDF.Node(literal=str(clade.confidence),
+ datatype=RDF.Uri('http://www.w3.org/2001/XMLSchema#decimal'))
+
+ statements += [(nUri(clade.uri), qUri('cdao:has_Support_Value'), confidence)]
+
if len(clade.ancestors) > 0:
#ancestors = RDF.Node(literal=str(len(clade.ancestors)),
@@ -443,11 +447,6 @@ def process_clade(self, clade, parent=None, root=False):
(nUri(edge_uri), qUri('cdao:has_Annotation'), nUri(edge_ann_uri)),
(nUri(edge_ann_uri), qUri('cdao:has_Value'), branch_length),
]
- if hasattr(clade, 'confidence') and not clade.confidence is None:
- confidence = RDF.Node(literal=str(clade.confidence),
- datatype=RDF.Uri('http://www.w3.org/2001/XMLSchema#decimal'))
-
- statements += [(nUri(edge_uri), qUri('cdao:has_Support_Value'), confidence)]
for stmt in statements:
yield RDF.Statement(*stmt)
View
2  Tests/CDAO/test.cdao
@@ -32,7 +32,6 @@
obo:CDAO_0000200 <tree0000001#tree0000001> ;
obo:CDAO_0000201 <tree0000001#node0000004> ;
obo:CDAO_0000209 <tree0000001#node0000005> ;
- obo:CDAO_0000214 20.0 ;
a obo:CDAO_0000139 .
<tree0000001#edge0000005>
@@ -815,6 +814,7 @@
obo:CDAO_0000177 <tree0000001#edge0000004>, <tree0000001#edge0000053> ;
obo:CDAO_0000179 <tree0000001#node0000003> ;
obo:CDAO_0000200 <tree0000001#tree0000001> ;
+ obo:CDAO_0000214 20.0 ;
a obo:CDAO_0000026 .
<tree0000001#node0000005>
Please sign in to comment.
Something went wrong with that request. Please try again.