예제 #1
0
 def from_array(arr, rng, style):
     from ctypes import byref, sizeof
     if rng.start > rng.end:
         gterror("range.start > range.end")
     gtarr = Array.create(sizeof(c_void_p), False)
     for i in arr:
         if not isinstance(i, FeatureNode):
             gterror("Diagram array must only contain FeatureNodes!")
         gtarr.add(i)
     diagram = gtlib.gt_diagram_new_from_array(gtarr, byref(rng), style)
     return Diagram(diagram)
예제 #2
0
 def from_array(arr, rng, style):
     from ctypes import byref, sizeof
     if rng.start > rng.end:
         gterror("range.start > range.end")
     gtarr = Array.create(sizeof(c_void_p), False)
     for i in arr:
         if not isinstance(i, FeatureNode):
             gterror("Diagram array must only contain FeatureNodes!")
         gtarr.add(i)
     diagram = gtlib.gt_diagram_new_from_array(gtarr, byref(rng),
             style)
     return Diagram(diagram)
예제 #3
0
 def get_features_for_range(self, start, end, seqid):
     from ctypes import byref
     a = Array.create()
     err = Error()
     rng = Range(start, end)
     rval = gtlib.gt_feature_index_get_features_for_range(self.fi, a,
             seqid, byref(rng), err)
     if rval != 0:
         gterror(err)
     result = []
     for i in range(a.size()):
         fptr = gtlib.gt_genome_node_ref(a.get(i))
         result.append(FeatureNode.create_from_ptr(fptr))
     return result
예제 #4
0
 def get_features_for_range(self, start, end, seqid):
     from ctypes import byref
     a = Array.create()
     err = Error()
     rng = Range(start, end)
     rval = gtlib.gt_feature_index_get_features_for_range(
         self.fi, a, seqid, byref(rng), err)
     if rval != 0:
         gterror(err)
     result = []
     for i in range(a.size()):
         fptr = gtlib.gt_genome_node_ref(a.get(i))
         result.append(FeatureNode.create_from_ptr(fptr))
     return result