Merging
This commit is contained in:
@ -1,60 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obiview cimport Obiview_p
|
|
||||||
from .capi.obitypes cimport index_t, \
|
|
||||||
obitype_t
|
|
||||||
|
|
||||||
from .dms cimport DMS
|
|
||||||
from .column cimport Column
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cdef class View:
|
|
||||||
|
|
||||||
cdef DMS _dms
|
|
||||||
cdef Obiview_p _pointer
|
|
||||||
|
|
||||||
cpdef View clone(self,
|
|
||||||
object view_name,
|
|
||||||
object comments=*)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef View _new(DMS dms,
|
|
||||||
bytes view_name,
|
|
||||||
bytes comments=*)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef View _open(DMS dms,
|
|
||||||
bytes view_name)
|
|
||||||
|
|
||||||
cpdef close(self)
|
|
||||||
|
|
||||||
cpdef get_column(self,
|
|
||||||
object column_name)
|
|
||||||
|
|
||||||
cpdef delete_column(self,
|
|
||||||
object column_name)
|
|
||||||
|
|
||||||
cpdef rename_column(self,
|
|
||||||
object current_name,
|
|
||||||
object new_name)
|
|
||||||
|
|
||||||
cpdef View_line_selection new_selection(self,
|
|
||||||
list lines=*)
|
|
||||||
|
|
||||||
cdef class View_line_selection(list):
|
|
||||||
|
|
||||||
cdef View _view
|
|
||||||
|
|
||||||
cdef index_t* __build_binary_list__(self)
|
|
||||||
|
|
||||||
cpdef View materialize(self,
|
|
||||||
object view_name,
|
|
||||||
object comments=*)
|
|
||||||
|
|
||||||
cdef class View_line :
|
|
||||||
|
|
||||||
cdef index_t _index
|
|
||||||
cdef View _view
|
|
||||||
|
|
||||||
|
|
@ -1,417 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from libc.stdlib cimport malloc
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_new_view, \
|
|
||||||
obi_open_view, \
|
|
||||||
obi_save_and_close_view, \
|
|
||||||
obi_view_get_pointer_on_column_in_view, \
|
|
||||||
obi_view_delete_column, \
|
|
||||||
obi_view_create_column_alias
|
|
||||||
|
|
||||||
from .capi.obidmscolumn cimport OBIDMS_column_p
|
|
||||||
|
|
||||||
from obitools3.utils cimport tobytes, \
|
|
||||||
bytes2str
|
|
||||||
|
|
||||||
|
|
||||||
cdef class View :
|
|
||||||
|
|
||||||
|
|
||||||
def __init__(self,dms,int __internalCall__):
|
|
||||||
|
|
||||||
if __internalCall__!=987654:
|
|
||||||
raise RuntimeError('OBIView constructor cannot be called directly')
|
|
||||||
|
|
||||||
self._dms = dms
|
|
||||||
self._pointer = NULL
|
|
||||||
|
|
||||||
cpdef View clone(self,
|
|
||||||
object view_name,
|
|
||||||
object comments=None):
|
|
||||||
|
|
||||||
|
|
||||||
cdef bytes view_name_b = tobytes(view_name)
|
|
||||||
cdef bytes comments_b
|
|
||||||
cdef View view = View(self._dms,
|
|
||||||
987654)
|
|
||||||
|
|
||||||
if comments is not None:
|
|
||||||
comments_b = tobytes(comments)
|
|
||||||
else:
|
|
||||||
comments_b = b''
|
|
||||||
|
|
||||||
view._pointer = obi_new_view(self._pointer.dms,
|
|
||||||
view_name_b,
|
|
||||||
self._pointer,
|
|
||||||
NULL,
|
|
||||||
comments_b)
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot clone view %s into view %s"
|
|
||||||
% (str(self.name),
|
|
||||||
bytes2str(view_name_b))
|
|
||||||
)
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef View _new(DMS dms,
|
|
||||||
bytes view_name,
|
|
||||||
bytes comments=b""):
|
|
||||||
|
|
||||||
cdef View view = View(dms,
|
|
||||||
987654) # @DuplicatedSignature
|
|
||||||
|
|
||||||
view._pointer = obi_new_view(dms._pointer,
|
|
||||||
view_name,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
comments)
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot create view %s" % view_name)
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def new(DMS dms,
|
|
||||||
object view_name,
|
|
||||||
object comments=None):
|
|
||||||
|
|
||||||
cdef bytes view_name_b = tobytes(view_name)
|
|
||||||
cdef bytes comments_b
|
|
||||||
|
|
||||||
if comments is not None:
|
|
||||||
comments_b = tobytes(comments)
|
|
||||||
else:
|
|
||||||
comments_b = b''
|
|
||||||
|
|
||||||
|
|
||||||
return View._new(dms,
|
|
||||||
view_name_b,
|
|
||||||
comments_b)
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef View _open(DMS dms,
|
|
||||||
bytes view_name):
|
|
||||||
|
|
||||||
cdef View view = View(dms,
|
|
||||||
987654) # @DuplicatedSignature
|
|
||||||
|
|
||||||
view._pointer = obi_open_view(dms._pointer,
|
|
||||||
view_name)
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot open view %s" % bytes2str(view_name))
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def open(DMS dms, # @ReservedAssignment
|
|
||||||
object view_name):
|
|
||||||
|
|
||||||
cdef bytes view_name_b = tobytes(view_name)
|
|
||||||
|
|
||||||
return View._open(dms,view_name_b)
|
|
||||||
|
|
||||||
cpdef close(self):
|
|
||||||
if (obi_save_and_close_view(self._pointer) < 0) :
|
|
||||||
raise Exception("Problem closing view %s" %
|
|
||||||
bytes2str(self.name))
|
|
||||||
|
|
||||||
def __dealloc__(self):
|
|
||||||
self.close()
|
|
||||||
|
|
||||||
def __repr__(self) :
|
|
||||||
cdef str s = "{name:s}\n{comments:s}\n{line_count:d} lines\n".format(name = str(self.name),
|
|
||||||
comments = str(self.comments),
|
|
||||||
line_count = self.line_count)
|
|
||||||
|
|
||||||
#for column_name in self._columns :
|
|
||||||
# s = s + repr(self._columns[column_name]) + '\n'
|
|
||||||
|
|
||||||
return s
|
|
||||||
|
|
||||||
cpdef get_column(self,
|
|
||||||
object column_name):
|
|
||||||
cdef bytes column_name_b = tobytes(column_name)
|
|
||||||
cdef OBIDMS_column_p* column_pp
|
|
||||||
cdef OBIDMS_column_p column_p
|
|
||||||
cdef Column column
|
|
||||||
cdef obitype_t column_type
|
|
||||||
|
|
||||||
column_pp = obi_view_get_pointer_on_column_in_view(self._pointer,
|
|
||||||
column_name_b)
|
|
||||||
|
|
||||||
if column_pp == NULL:
|
|
||||||
raise KeyError("Cannot access to column %s in view %s" % (
|
|
||||||
bytes2str(column_name_b),
|
|
||||||
bytes2str(self.name)
|
|
||||||
))
|
|
||||||
|
|
||||||
column_p = column_pp[0]
|
|
||||||
column_type = column_p.header.returned_data_type
|
|
||||||
|
|
||||||
column = DMS.get_column_class(column_type)(self)
|
|
||||||
column._pointer = column_pp
|
|
||||||
|
|
||||||
return column
|
|
||||||
|
|
||||||
cpdef delete_column(self,
|
|
||||||
object column_name) :
|
|
||||||
|
|
||||||
cdef bytes column_name_b = tobytes(column_name)
|
|
||||||
|
|
||||||
if obi_view_delete_column(self._pointer, column_name_b) < 0 :
|
|
||||||
raise Exception("Problem deleting column %s from a view",
|
|
||||||
bytes2str(column_name_b))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cpdef rename_column(self,
|
|
||||||
object current_name,
|
|
||||||
object new_name):
|
|
||||||
|
|
||||||
cdef Column column
|
|
||||||
cdef bytes current_name_b = tobytes(current_name)
|
|
||||||
cdef bytes new_name_b = tobytes(new_name)
|
|
||||||
|
|
||||||
if (obi_view_create_column_alias(self._pointer,
|
|
||||||
tobytes(current_name_b),
|
|
||||||
tobytes(new_name_b)) < 0) :
|
|
||||||
raise Exception("Problem in renaming column %s to %s" % (
|
|
||||||
bytes2str(current_name_b),
|
|
||||||
bytes2str(new_name_b)))
|
|
||||||
|
|
||||||
|
|
||||||
cpdef View_line_selection new_selection(self,list lines=None):
|
|
||||||
return View_line_selection(self,lines)
|
|
||||||
|
|
||||||
def __iter__(self):
|
|
||||||
# Iteration on each line of all columns
|
|
||||||
|
|
||||||
# Declarations
|
|
||||||
cdef index_t line_nb
|
|
||||||
cdef View_line line
|
|
||||||
|
|
||||||
# Yield each line
|
|
||||||
for line_nb in range(self.line_count) :
|
|
||||||
line = self[line_nb]
|
|
||||||
yield line
|
|
||||||
|
|
||||||
|
|
||||||
def __getitem__(self, object item) :
|
|
||||||
if type(item) == str :
|
|
||||||
return (self._columns)[item]
|
|
||||||
elif type(item) == int :
|
|
||||||
return View_line(self, item)
|
|
||||||
|
|
||||||
|
|
||||||
def __contains__(self, str column_name):
|
|
||||||
return (column_name in self._columns)
|
|
||||||
|
|
||||||
|
|
||||||
def __len__(self):
|
|
||||||
return(self.line_count)
|
|
||||||
|
|
||||||
|
|
||||||
def __str__(self) :
|
|
||||||
cdef View_line line
|
|
||||||
cdef str to_print
|
|
||||||
to_print = ""
|
|
||||||
for line in self :
|
|
||||||
to_print = to_print + str(line) + "\n"
|
|
||||||
return to_print
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
|
||||||
def dms(self):
|
|
||||||
return self._dms
|
|
||||||
|
|
||||||
# line_count property getter
|
|
||||||
@property
|
|
||||||
def line_count(self):
|
|
||||||
return self._pointer.infos.line_count
|
|
||||||
|
|
||||||
# name property getter
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
return <bytes> self._pointer.infos.name
|
|
||||||
|
|
||||||
# view type property getter
|
|
||||||
@property
|
|
||||||
def type(self): # @ReservedAssignment
|
|
||||||
return bytes2str(self._pointer.infos.view_type)
|
|
||||||
|
|
||||||
# comments property getter
|
|
||||||
@property
|
|
||||||
def comments(self):
|
|
||||||
return <bytes> self._pointer.infos.comments
|
|
||||||
# TODO setter that concatenates new comments?
|
|
||||||
|
|
||||||
|
|
||||||
cdef class View_line_selection(list):
|
|
||||||
|
|
||||||
def __init__(self, View view, lines=None) :
|
|
||||||
if view._pointer == NULL:
|
|
||||||
raise Exception("Error: trying to create a line selection with an invalidated view")
|
|
||||||
self._view = view
|
|
||||||
self._view_name = view.name
|
|
||||||
|
|
||||||
if lines is not None:
|
|
||||||
self.extend(lines)
|
|
||||||
|
|
||||||
def extend(self, iterable):
|
|
||||||
cdef index_t i
|
|
||||||
cdef index_t max_i = self._view.line_count
|
|
||||||
|
|
||||||
for i in iterable:
|
|
||||||
if i > max_i:
|
|
||||||
raise RuntimeError("Error: trying to select line %d beyond the line count %d of view %s" %
|
|
||||||
(i,
|
|
||||||
max_i,
|
|
||||||
self._view_name)
|
|
||||||
)
|
|
||||||
list.append(self,i)
|
|
||||||
|
|
||||||
def append(self, index_t idx) :
|
|
||||||
if idx >= self._view.line_count :
|
|
||||||
raise IndexError("Error: trying to select line %d beyond the line count %d of view %s" %
|
|
||||||
(idx,
|
|
||||||
self._view.line_count,
|
|
||||||
bytes2str(self.name))
|
|
||||||
)
|
|
||||||
list.append(self,idx)
|
|
||||||
|
|
||||||
cdef index_t* __build_binary_list__(self):
|
|
||||||
cdef index_t* line_selection_p = NULL
|
|
||||||
cdef int i
|
|
||||||
cdef size_t l_selection = len(self)
|
|
||||||
|
|
||||||
line_selection_p = <index_t*> malloc((l_selection + 1) * sizeof(index_t)) # +1 for the -1 flagging the end of the array
|
|
||||||
for i in range(l_selection) :
|
|
||||||
line_selection_p[i] = self[i]
|
|
||||||
line_selection_p[l_selection] = -1 # flagging the end of the array
|
|
||||||
|
|
||||||
return line_selection_p
|
|
||||||
|
|
||||||
cpdef View materialize(self,
|
|
||||||
object view_name,
|
|
||||||
object comments=""):
|
|
||||||
|
|
||||||
cdef View view = View(987654)
|
|
||||||
cdef bytes view_name_b=tobytes(view_name)
|
|
||||||
|
|
||||||
view._pointer = obi_new_view(self._view._pointer.dms,
|
|
||||||
view_name_b,
|
|
||||||
self._view._pointer,
|
|
||||||
self.__build_binary_list__(),
|
|
||||||
tobytes(comments))
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot clone view %s into view %s"
|
|
||||||
% (str(self.name),
|
|
||||||
view_name)
|
|
||||||
)
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
cdef class View_line :
|
|
||||||
|
|
||||||
def __init__(self, View view, index_t line_nb) :
|
|
||||||
self._index = line_nb
|
|
||||||
self._view = view
|
|
||||||
|
|
||||||
def __getitem__(self, str column_name) :
|
|
||||||
return ((self._view)._columns)[column_name][self._index]
|
|
||||||
|
|
||||||
# def __setitem__(self, str column_name, object value):
|
|
||||||
# # TODO detect multiple elements (dict type)? put somewhere else? but more risky (in get)
|
|
||||||
# # TODO OBI_QUAL ?
|
|
||||||
# cdef type value_type
|
|
||||||
# cdef str value_obitype
|
|
||||||
# cdef bytes value_b
|
|
||||||
#
|
|
||||||
# if column_name not in self._view :
|
|
||||||
# if value == None :
|
|
||||||
# raise Exception("Trying to create a column from a None value (can't guess type)")
|
|
||||||
# value_type = type(value)
|
|
||||||
# if value_type == int :
|
|
||||||
# value_obitype = 'OBI_INT'
|
|
||||||
# elif value_type == float :
|
|
||||||
# value_obitype = 'OBI_FLOAT'
|
|
||||||
# elif value_type == bool :
|
|
||||||
# value_obitype = 'OBI_BOOL'
|
|
||||||
# elif value_type == str or value_type == bytes :
|
|
||||||
# if value_type == str :
|
|
||||||
# value_b = str2bytes(value)
|
|
||||||
# else :
|
|
||||||
# value_b = value
|
|
||||||
# if only_ATGC(value_b) : # TODO detect IUPAC
|
|
||||||
# value_obitype = 'OBI_SEQ'
|
|
||||||
# elif len(value) == 1 :
|
|
||||||
# value_obitype = 'OBI_CHAR'
|
|
||||||
# elif (len(value) > 1) :
|
|
||||||
# value_obitype = 'OBI_STR'
|
|
||||||
# else :
|
|
||||||
# raise Exception("Could not guess the type of a value to create a new column")
|
|
||||||
# self._view.add_column(column_name, type=value_obitype)
|
|
||||||
#
|
|
||||||
# (((self._view)._columns)[column_name]).set_line(self._index, value)
|
|
||||||
#
|
|
||||||
# def __iter__(self):
|
|
||||||
# for column_name in ((self._view)._columns) :
|
|
||||||
# yield column_name
|
|
||||||
#
|
|
||||||
# def __contains__(self, str column_name):
|
|
||||||
# return (column_name in self._view._columns)
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
cdef dict line
|
|
||||||
cdef str column_name
|
|
||||||
line = {}
|
|
||||||
# for column_name in self._view._columns :
|
|
||||||
# line[column_name] = self[column_name]
|
|
||||||
return str(line)
|
|
||||||
|
|
||||||
|
|
||||||
# cpdef dict get_view_infos(self, str view_name) :
|
|
||||||
#
|
|
||||||
# cdef Obiview_infos_p view_infos_p
|
|
||||||
# cdef dict view_infos_d
|
|
||||||
# cdef Alias_column_pair_p column_refs
|
|
||||||
# cdef int i, j
|
|
||||||
# cdef str column_name
|
|
||||||
#
|
|
||||||
# view_infos_p = obi_view_map_file(self._pointer,
|
|
||||||
# tobytes(view_name))
|
|
||||||
# view_infos_d = {}
|
|
||||||
# view_infos_d["name"] = bytes2str(view_infos_p.name)
|
|
||||||
# view_infos_d["comments"] = bytes2str(view_infos_p.comments)
|
|
||||||
# view_infos_d["view_type"] = bytes2str(view_infos_p.view_type)
|
|
||||||
# view_infos_d["column_count"] = <int> view_infos_p.column_count
|
|
||||||
# view_infos_d["line_count"] = <int> view_infos_p.line_count
|
|
||||||
# view_infos_d["created_from"] = bytes2str(view_infos_p.created_from)
|
|
||||||
# view_infos_d["creation_date"] = bytes2str(obi_format_date(view_infos_p.creation_date))
|
|
||||||
# if (view_infos_p.all_lines) :
|
|
||||||
# view_infos_d["line_selection"] = None
|
|
||||||
# else :
|
|
||||||
# view_infos_d["line_selection"] = {}
|
|
||||||
# view_infos_d["line_selection"]["column_name"] = bytes2str((view_infos_p.line_selection).column_name)
|
|
||||||
# view_infos_d["line_selection"]["version"] = <int> (view_infos_p.line_selection).version
|
|
||||||
# view_infos_d["column_references"] = {}
|
|
||||||
# column_references = view_infos_p.column_references
|
|
||||||
# for j in range(view_infos_d["column_count"]) :
|
|
||||||
# column_name = bytes2str((column_references[j]).alias)
|
|
||||||
# view_infos_d["column_references"][column_name] = {}
|
|
||||||
# view_infos_d["column_references"][column_name]["original_name"] = bytes2str((column_references[j]).column_refs.column_name)
|
|
||||||
# view_infos_d["column_references"][column_name]["version"] = (column_references[j]).column_refs.version
|
|
||||||
#
|
|
||||||
# obi_view_unmap_file(self._pointer, view_infos_p)
|
|
||||||
#
|
|
||||||
# return view_infos_d
|
|
||||||
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,38 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obidms cimport OBIDMS_p
|
|
||||||
from .capi.obidmscolumn cimport OBIDMS_column_p
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
from ._obitaxo cimport OBI_Taxonomy
|
|
||||||
from ._obiview cimport OBIView, OBIView_line_selection
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column:
|
|
||||||
|
|
||||||
cdef str _alias # associated property: alias
|
|
||||||
cdef OBIDMS_column_p* _pointer
|
|
||||||
cdef OBIView _view
|
|
||||||
|
|
||||||
cpdef close(self)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef object get_subclass_type(OBIDMS_column_p column_p)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts(OBIDMS_column):
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, dict values)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_line:
|
|
||||||
|
|
||||||
cdef OBIDMS_column _column
|
|
||||||
cdef index_t _index
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS:
|
|
||||||
|
|
||||||
cdef OBIDMS_p _pointer
|
|
||||||
|
|
||||||
cpdef close(self)
|
|
||||||
cpdef OBI_Taxonomy open_taxonomy(self, str taxo_name)
|
|
@ -1,271 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from obitools3.utils cimport bytes2str, str2bytes
|
|
||||||
|
|
||||||
from .capi.obidms cimport obi_dms, \
|
|
||||||
obi_close_dms
|
|
||||||
|
|
||||||
from .capi.obidmscolumn cimport obi_close_column, \
|
|
||||||
OBIDMS_column_header_p, \
|
|
||||||
obi_get_elements_names
|
|
||||||
|
|
||||||
from .capi.obiutils cimport obi_format_date
|
|
||||||
|
|
||||||
from .capi.obitypes cimport const_char_p, \
|
|
||||||
OBIType_t, \
|
|
||||||
OBI_INT, \
|
|
||||||
OBI_FLOAT, \
|
|
||||||
OBI_BOOL, \
|
|
||||||
OBI_CHAR, \
|
|
||||||
OBI_QUAL, \
|
|
||||||
OBI_STR, \
|
|
||||||
OBI_SEQ, \
|
|
||||||
name_data_type
|
|
||||||
|
|
||||||
from .capi.obiview cimport Obiview_p, \
|
|
||||||
obi_view_get_pointer_on_column_in_view
|
|
||||||
|
|
||||||
from ._obidmscolumn_int cimport OBIDMS_column_int, \
|
|
||||||
OBIDMS_column_multi_elts_int
|
|
||||||
|
|
||||||
from ._obidmscolumn_float cimport OBIDMS_column_float, \
|
|
||||||
OBIDMS_column_multi_elts_float
|
|
||||||
|
|
||||||
from ._obidmscolumn_bool cimport OBIDMS_column_bool, \
|
|
||||||
OBIDMS_column_multi_elts_bool
|
|
||||||
|
|
||||||
from ._obidmscolumn_char cimport OBIDMS_column_char, \
|
|
||||||
OBIDMS_column_multi_elts_char
|
|
||||||
|
|
||||||
from ._obidmscolumn_qual cimport OBIDMS_column_qual, \
|
|
||||||
OBIDMS_column_multi_elts_qual
|
|
||||||
|
|
||||||
from ._obidmscolumn_str cimport OBIDMS_column_str, \
|
|
||||||
OBIDMS_column_multi_elts_str
|
|
||||||
|
|
||||||
from ._obidmscolumn_seq cimport OBIDMS_column_seq, \
|
|
||||||
OBIDMS_column_multi_elts_seq
|
|
||||||
|
|
||||||
from libc.stdlib cimport free
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column :
|
|
||||||
|
|
||||||
# Note: should only be initialized through a subclass
|
|
||||||
def __init__(self, OBIView view, str column_alias):
|
|
||||||
|
|
||||||
cdef OBIDMS_column_p column_p
|
|
||||||
cdef OBIDMS_column_p* column_pp
|
|
||||||
|
|
||||||
column_pp = obi_view_get_pointer_on_column_in_view(view._pointer, str2bytes(column_alias))
|
|
||||||
column_p = column_pp[0] # TODO ugly cython dereferencing but can't find better
|
|
||||||
|
|
||||||
# Fill structure
|
|
||||||
self._alias = column_alias
|
|
||||||
self._pointer = column_pp
|
|
||||||
self._view = view
|
|
||||||
|
|
||||||
def __setitem__(self, index_t line_nb, object value):
|
|
||||||
self.set_line(line_nb, value)
|
|
||||||
|
|
||||||
def __getitem__(self, index_t line_nb):
|
|
||||||
return self.get_line(line_nb)
|
|
||||||
|
|
||||||
def __len__(self): # TODO discuss
|
|
||||||
return self._view.line_count
|
|
||||||
|
|
||||||
def __sizeof__(self):
|
|
||||||
return ((self._pointer)[0].header.header_size + (self._pointer)[0].header.data_size)
|
|
||||||
|
|
||||||
def __iter__(self): # TODO discuss
|
|
||||||
# Declarations
|
|
||||||
cdef index_t line_nb
|
|
||||||
# Yield each line
|
|
||||||
for line_nb in range(self._view.line_count):
|
|
||||||
yield self.get_line(line_nb)
|
|
||||||
|
|
||||||
def __str__(self) :
|
|
||||||
cdef str to_print
|
|
||||||
to_print = ''
|
|
||||||
for line in self :
|
|
||||||
to_print = to_print + str(line) + "\n"
|
|
||||||
return to_print
|
|
||||||
|
|
||||||
def __repr__(self) :
|
|
||||||
return (self._alias + ", original name: " + self.original_name + ", version " + str(self.version) + ", data type: " + self.data_type)
|
|
||||||
|
|
||||||
cpdef close(self):
|
|
||||||
if obi_close_column((self._pointer)[0]) < 0 :
|
|
||||||
raise Exception("Problem closing a column")
|
|
||||||
|
|
||||||
# Column alias property getter and setter
|
|
||||||
@property
|
|
||||||
def alias(self):
|
|
||||||
return self._alias
|
|
||||||
@alias.setter
|
|
||||||
def alias(self, new_alias): # @DuplicatedSignature
|
|
||||||
self._view.change_column_alias(self._alias, new_alias)
|
|
||||||
|
|
||||||
# elements_names property getter
|
|
||||||
@property
|
|
||||||
def elements_names(self):
|
|
||||||
cdef char* elts_names_b
|
|
||||||
cdef str elts_names
|
|
||||||
elts_names_b = obi_get_elements_names((self._pointer)[0])
|
|
||||||
elts_names = bytes2str(elts_names_b)
|
|
||||||
free(<char*>elts_names_b)
|
|
||||||
return elts_names.split(';')
|
|
||||||
|
|
||||||
# nb_elements_per_line property getter
|
|
||||||
@property
|
|
||||||
def nb_elements_per_line(self):
|
|
||||||
return ((self._pointer)[0].header).nb_elements_per_line
|
|
||||||
|
|
||||||
# data_type property getter
|
|
||||||
@property
|
|
||||||
def data_type(self):
|
|
||||||
return bytes2str(name_data_type(((self._pointer)[0].header).returned_data_type))
|
|
||||||
|
|
||||||
# original_name property getter
|
|
||||||
@property
|
|
||||||
def original_name(self):
|
|
||||||
return bytes2str(((self._pointer)[0].header).name)
|
|
||||||
|
|
||||||
# version property getter
|
|
||||||
@property
|
|
||||||
def version(self):
|
|
||||||
return ((self._pointer)[0].header).version
|
|
||||||
|
|
||||||
# comments property getter
|
|
||||||
@property
|
|
||||||
def comments(self):
|
|
||||||
return bytes2str((self._pointer)[0].header.comments)
|
|
||||||
|
|
||||||
# creation_date property getter
|
|
||||||
@property
|
|
||||||
def creation_date(self):
|
|
||||||
return bytes2str(obi_format_date((self._pointer)[0].header.creation_date))
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef object get_subclass_type(OBIDMS_column_p column_p) :
|
|
||||||
|
|
||||||
cdef object subclass
|
|
||||||
cdef OBIDMS_column_header_p header
|
|
||||||
cdef OBIType_t col_type
|
|
||||||
cdef bint col_writable
|
|
||||||
cdef bint col_one_element_per_line
|
|
||||||
|
|
||||||
header = column_p.header
|
|
||||||
col_type = header.returned_data_type
|
|
||||||
col_writable = column_p.writable
|
|
||||||
col_one_element_per_line = ((header.nb_elements_per_line) == 1)
|
|
||||||
|
|
||||||
if col_type == OBI_INT :
|
|
||||||
if col_one_element_per_line :
|
|
||||||
subclass = OBIDMS_column_int
|
|
||||||
else :
|
|
||||||
subclass = OBIDMS_column_multi_elts_int
|
|
||||||
elif col_type == OBI_FLOAT :
|
|
||||||
if col_one_element_per_line :
|
|
||||||
subclass = OBIDMS_column_float
|
|
||||||
else :
|
|
||||||
subclass = OBIDMS_column_multi_elts_float
|
|
||||||
elif col_type == OBI_BOOL :
|
|
||||||
if col_one_element_per_line :
|
|
||||||
subclass = OBIDMS_column_bool
|
|
||||||
else :
|
|
||||||
subclass = OBIDMS_column_multi_elts_bool
|
|
||||||
elif col_type == OBI_CHAR :
|
|
||||||
if col_one_element_per_line :
|
|
||||||
subclass = OBIDMS_column_char
|
|
||||||
else :
|
|
||||||
subclass = OBIDMS_column_multi_elts_char
|
|
||||||
elif col_type == OBI_QUAL :
|
|
||||||
if col_one_element_per_line :
|
|
||||||
subclass = OBIDMS_column_qual
|
|
||||||
else :
|
|
||||||
subclass = OBIDMS_column_multi_elts_qual
|
|
||||||
elif col_type == OBI_STR :
|
|
||||||
if col_one_element_per_line :
|
|
||||||
subclass = OBIDMS_column_str
|
|
||||||
else :
|
|
||||||
subclass = OBIDMS_column_multi_elts_str
|
|
||||||
elif col_type == OBI_SEQ :
|
|
||||||
if col_one_element_per_line :
|
|
||||||
subclass = OBIDMS_column_seq
|
|
||||||
else :
|
|
||||||
subclass = OBIDMS_column_multi_elts_seq
|
|
||||||
else :
|
|
||||||
raise Exception("Problem with the data type")
|
|
||||||
|
|
||||||
return subclass
|
|
||||||
|
|
||||||
|
|
||||||
######################################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts(OBIDMS_column) :
|
|
||||||
|
|
||||||
def __getitem__(self, index_t line_nb):
|
|
||||||
return OBIDMS_column_line(self, line_nb)
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, dict values):
|
|
||||||
for element_name in values :
|
|
||||||
self.set_item(line_nb, element_name, values[element_name])
|
|
||||||
|
|
||||||
|
|
||||||
######################################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_line :
|
|
||||||
|
|
||||||
def __init__(self, OBIDMS_column column, index_t line_nb) :
|
|
||||||
self._index = line_nb
|
|
||||||
self._column = column
|
|
||||||
|
|
||||||
def __getitem__(self, str element_name) :
|
|
||||||
return self._column.get_item(self._index, element_name)
|
|
||||||
|
|
||||||
def __setitem__(self, str element_name, object value):
|
|
||||||
self._column.set_item(self._index, element_name, value)
|
|
||||||
|
|
||||||
def __contains__(self, str element_name):
|
|
||||||
return (element_name in self._column.elements_names)
|
|
||||||
|
|
||||||
def __repr__(self) :
|
|
||||||
return str(self._column.get_line(self._index))
|
|
||||||
|
|
||||||
|
|
||||||
######################################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS :
|
|
||||||
|
|
||||||
def __init__(self, str dms_name) :
|
|
||||||
|
|
||||||
# Declarations
|
|
||||||
cdef bytes dms_name_b
|
|
||||||
|
|
||||||
# Format the character string to send to C function
|
|
||||||
dms_name_b = str2bytes(dms_name)
|
|
||||||
|
|
||||||
# Fill structure and create or open the DMS
|
|
||||||
self._pointer = obi_dms(<const_char_p> dms_name_b)
|
|
||||||
if self._pointer == NULL :
|
|
||||||
raise Exception("Failed opening or creating an OBIDMS")
|
|
||||||
|
|
||||||
|
|
||||||
# name property getter
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
return bytes2str(self._pointer.dms_name)
|
|
||||||
|
|
||||||
|
|
||||||
cpdef close(self) :
|
|
||||||
if (obi_close_dms(self._pointer)) < 0 :
|
|
||||||
raise Exception("Problem closing an OBIDMS")
|
|
||||||
|
|
||||||
|
|
||||||
cpdef OBI_Taxonomy open_taxonomy(self, str taxo_name) :
|
|
||||||
return OBI_Taxonomy(self, taxo_name)
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,14 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
from ._obidms cimport OBIDMS_column, OBIDMS_column_multi_elts
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_bool(OBIDMS_column):
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_line(self, index_t line_nb, object value)
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_bool(OBIDMS_column_multi_elts):
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name)
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value)
|
|
@ -1,78 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_get_bool_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_get_bool_with_elt_idx_and_col_p_in_view, \
|
|
||||||
obi_set_bool_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_set_bool_with_elt_idx_and_col_p_in_view
|
|
||||||
from .capi.obierrno cimport obi_errno
|
|
||||||
from .capi.obitypes cimport OBIBool_NA, obibool_t
|
|
||||||
|
|
||||||
from obitools3.utils cimport str2bytes
|
|
||||||
|
|
||||||
from cpython.bool cimport PyBool_FromLong
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_bool(OBIDMS_column):
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb):
|
|
||||||
cdef obibool_t value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_bool_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIBool_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = PyBool_FromLong(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, object value):
|
|
||||||
if value is None :
|
|
||||||
value = OBIBool_NA
|
|
||||||
if obi_set_bool_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, <obibool_t> value) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_bool(OBIDMS_column_multi_elts):
|
|
||||||
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name):
|
|
||||||
cdef obibool_t value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_bool_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name))
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb, element_name)
|
|
||||||
if value == OBIBool_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = PyBool_FromLong(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb) :
|
|
||||||
cdef obibool_t value
|
|
||||||
cdef object value_in_result
|
|
||||||
cdef dict result
|
|
||||||
cdef index_t i
|
|
||||||
cdef bint all_NA
|
|
||||||
result = {}
|
|
||||||
all_NA = True
|
|
||||||
for i in range(self.nb_elements_per_line) :
|
|
||||||
value = obi_get_bool_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, i)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIBool_NA :
|
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = PyBool_FromLong(value)
|
|
||||||
result[self.elements_names[i]] = value_in_result
|
|
||||||
if all_NA and (value_in_result is not None) :
|
|
||||||
all_NA = False
|
|
||||||
if all_NA :
|
|
||||||
result = None
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value):
|
|
||||||
if value is None :
|
|
||||||
value = OBIBool_NA
|
|
||||||
if obi_set_bool_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), <obibool_t> value) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,14 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
from ._obidms cimport OBIDMS_column, OBIDMS_column_multi_elts
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_char(OBIDMS_column):
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_line(self, index_t line_nb, object value)
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_char(OBIDMS_column_multi_elts):
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name)
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value)
|
|
@ -1,76 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_get_char_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_get_char_with_elt_idx_and_col_p_in_view, \
|
|
||||||
obi_set_char_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_set_char_with_elt_idx_and_col_p_in_view
|
|
||||||
from .capi.obierrno cimport obi_errno
|
|
||||||
from .capi.obitypes cimport OBIChar_NA, obichar_t
|
|
||||||
|
|
||||||
from obitools3.utils cimport str2bytes, bytes2str
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_char(OBIDMS_column):
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb):
|
|
||||||
cdef obichar_t value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_char_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIChar_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = bytes2str(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, object value):
|
|
||||||
if value is None :
|
|
||||||
value = OBIChar_NA
|
|
||||||
if obi_set_char_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, str2bytes(value)[0]) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_char(OBIDMS_column_multi_elts):
|
|
||||||
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name):
|
|
||||||
cdef obichar_t value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_char_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name))
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb, element_name)
|
|
||||||
if value == OBIChar_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = bytes2str(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb) :
|
|
||||||
cdef obichar_t value
|
|
||||||
cdef object value_in_result
|
|
||||||
cdef dict result
|
|
||||||
cdef index_t i
|
|
||||||
cdef bint all_NA
|
|
||||||
result = {}
|
|
||||||
all_NA = True
|
|
||||||
for i in range(self.nb_elements_per_line) :
|
|
||||||
value = obi_get_char_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, i)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIChar_NA :
|
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = bytes2str(value)
|
|
||||||
result[self.elements_names[i]] = value_in_result
|
|
||||||
if all_NA and (value_in_result is not None) :
|
|
||||||
all_NA = False
|
|
||||||
if all_NA :
|
|
||||||
result = None
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value):
|
|
||||||
if value is None :
|
|
||||||
value = OBIChar_NA
|
|
||||||
if obi_set_char_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), str2bytes(value)[0]) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,14 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
from ._obidms cimport OBIDMS_column, OBIDMS_column_multi_elts
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_float(OBIDMS_column):
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_line(self, index_t line_nb, object value)
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_float(OBIDMS_column_multi_elts):
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name)
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value)
|
|
@ -1,76 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_get_float_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_get_float_with_elt_idx_and_col_p_in_view, \
|
|
||||||
obi_set_float_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_set_float_with_elt_idx_and_col_p_in_view
|
|
||||||
from .capi.obierrno cimport obi_errno
|
|
||||||
from .capi.obitypes cimport OBIFloat_NA, obifloat_t
|
|
||||||
|
|
||||||
from obitools3.utils cimport str2bytes
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_float(OBIDMS_column):
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb):
|
|
||||||
cdef obifloat_t value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_float_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIFloat_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = <double> value
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, object value):
|
|
||||||
if value is None :
|
|
||||||
value = OBIFloat_NA
|
|
||||||
if obi_set_float_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, <obifloat_t> value) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_float(OBIDMS_column_multi_elts):
|
|
||||||
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name):
|
|
||||||
cdef obifloat_t value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_float_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name))
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb, element_name)
|
|
||||||
if value == OBIFloat_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = <double> value
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb) :
|
|
||||||
cdef obifloat_t value
|
|
||||||
cdef object value_in_result
|
|
||||||
cdef dict result
|
|
||||||
cdef index_t i
|
|
||||||
cdef bint all_NA
|
|
||||||
result = {}
|
|
||||||
all_NA = True
|
|
||||||
for i in range(self.nb_elements_per_line) :
|
|
||||||
value = obi_get_float_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, i)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIFloat_NA :
|
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = <double> value
|
|
||||||
result[self.elements_names[i]] = value_in_result
|
|
||||||
if all_NA and (value_in_result is not None) :
|
|
||||||
all_NA = False
|
|
||||||
if all_NA :
|
|
||||||
result = None
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value):
|
|
||||||
if value is None :
|
|
||||||
value = OBIFloat_NA
|
|
||||||
if obi_set_float_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), <obifloat_t> value) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,14 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
from ._obidms cimport OBIDMS_column, OBIDMS_column_multi_elts
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_int(OBIDMS_column):
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_line(self, index_t line_nb, object value)
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_int(OBIDMS_column_multi_elts):
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name)
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value)
|
|
@ -1,78 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_get_int_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_get_int_with_elt_idx_and_col_p_in_view, \
|
|
||||||
obi_set_int_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_set_int_with_elt_idx_and_col_p_in_view
|
|
||||||
from .capi.obierrno cimport obi_errno
|
|
||||||
from .capi.obitypes cimport OBIInt_NA, obiint_t
|
|
||||||
|
|
||||||
from obitools3.utils cimport str2bytes
|
|
||||||
|
|
||||||
from cpython.int cimport PyInt_FromLong
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_int(OBIDMS_column):
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb):
|
|
||||||
cdef obiint_t value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_int_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIInt_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = PyInt_FromLong(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, object value):
|
|
||||||
if value is None :
|
|
||||||
value = OBIInt_NA
|
|
||||||
if obi_set_int_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, <obiint_t> value) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_int(OBIDMS_column_multi_elts):
|
|
||||||
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name):
|
|
||||||
cdef obiint_t value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_int_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name))
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb, element_name)
|
|
||||||
if value == OBIInt_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = PyInt_FromLong(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb) :
|
|
||||||
cdef obiint_t value
|
|
||||||
cdef object value_in_result
|
|
||||||
cdef dict result
|
|
||||||
cdef index_t i
|
|
||||||
cdef bint all_NA
|
|
||||||
result = {}
|
|
||||||
all_NA = True
|
|
||||||
for i in range(self.nb_elements_per_line) :
|
|
||||||
value = obi_get_int_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, i)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIInt_NA :
|
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = PyInt_FromLong(value)
|
|
||||||
result[self.elements_names[i]] = value_in_result
|
|
||||||
if all_NA and (value_in_result is not None) :
|
|
||||||
all_NA = False
|
|
||||||
if all_NA :
|
|
||||||
result = None # TODO discuss
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value):
|
|
||||||
if value is None :
|
|
||||||
value = OBIInt_NA
|
|
||||||
if obi_set_int_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), <obiint_t> value) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,20 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
from ._obidms cimport OBIDMS_column , OBIDMS_column_multi_elts
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_qual(OBIDMS_column):
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef object get_str_line(self, index_t line_nb)
|
|
||||||
cpdef set_line(self, index_t line_nb, object value)
|
|
||||||
cpdef set_str_line(self, index_t line_nb, object value)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_qual(OBIDMS_column_multi_elts):
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name)
|
|
||||||
cpdef object get_str_item(self, index_t line_nb, str element_name)
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef object get_str_line(self, index_t line_nb)
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value)
|
|
||||||
cpdef set_str_item(self, index_t line_nb, str element_name, object value)
|
|
@ -1,189 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_get_qual_char_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_get_qual_char_with_elt_idx_and_col_p_in_view, \
|
|
||||||
obi_set_qual_char_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_set_qual_char_with_elt_idx_and_col_p_in_view, \
|
|
||||||
obi_get_qual_int_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_get_qual_int_with_elt_idx_and_col_p_in_view, \
|
|
||||||
obi_set_qual_int_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_set_qual_int_with_elt_idx_and_col_p_in_view
|
|
||||||
|
|
||||||
from .capi.obierrno cimport obi_errno
|
|
||||||
from .capi.obitypes cimport OBIQual_char_NA, OBIQual_int_NA, const_char_p
|
|
||||||
|
|
||||||
from ._obidms cimport OBIView
|
|
||||||
|
|
||||||
from obitools3.utils cimport str2bytes, bytes2str
|
|
||||||
|
|
||||||
from libc.stdlib cimport free
|
|
||||||
from libc.string cimport strcmp
|
|
||||||
from libc.stdint cimport uint8_t
|
|
||||||
from libc.stdlib cimport malloc
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_qual(OBIDMS_column):
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb):
|
|
||||||
cdef const uint8_t* value
|
|
||||||
cdef int value_length
|
|
||||||
cdef object result
|
|
||||||
cdef int i
|
|
||||||
value = obi_get_qual_int_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, &value_length)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIQual_int_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = []
|
|
||||||
for i in range(value_length) :
|
|
||||||
result.append(<int>value[i])
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef object get_str_line(self, index_t line_nb):
|
|
||||||
cdef char* value
|
|
||||||
cdef object result
|
|
||||||
cdef int i
|
|
||||||
value = obi_get_qual_char_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIQual_char_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = bytes2str(value)
|
|
||||||
free(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, object value):
|
|
||||||
cdef uint8_t* value_b
|
|
||||||
cdef int value_length
|
|
||||||
if value is None :
|
|
||||||
if obi_set_qual_int_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, OBIQual_int_NA, 0) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
else :
|
|
||||||
value_length = len(value)
|
|
||||||
value_b = <uint8_t*> malloc(value_length * sizeof(uint8_t))
|
|
||||||
for i in range(value_length) :
|
|
||||||
value_b[i] = <uint8_t>value[i]
|
|
||||||
if obi_set_qual_int_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, value_b, value_length) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
free(value_b)
|
|
||||||
|
|
||||||
cpdef set_str_line(self, index_t line_nb, object value):
|
|
||||||
cdef bytes value_b
|
|
||||||
if value is None :
|
|
||||||
if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, OBIQual_char_NA) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
else :
|
|
||||||
if type(value) == str:
|
|
||||||
value_b = str2bytes(value)
|
|
||||||
else :
|
|
||||||
value_b = value
|
|
||||||
if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, value_b) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_qual(OBIDMS_column_multi_elts):
|
|
||||||
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name):
|
|
||||||
cdef const uint8_t* value
|
|
||||||
cdef int value_length
|
|
||||||
cdef object result
|
|
||||||
cdef int i
|
|
||||||
value = obi_get_qual_int_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), &value_length)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb, element_name)
|
|
||||||
if value == OBIQual_int_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = []
|
|
||||||
for i in range(value_length) :
|
|
||||||
result.append(<int>value[i])
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef object get_str_item(self, index_t line_nb, str element_name):
|
|
||||||
cdef char* value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_qual_char_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name))
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb, element_name)
|
|
||||||
if value == OBIQual_char_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = bytes2str(value)
|
|
||||||
free(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb) :
|
|
||||||
cdef const uint8_t* value
|
|
||||||
cdef int value_length
|
|
||||||
cdef object value_in_result
|
|
||||||
cdef dict result
|
|
||||||
cdef index_t i
|
|
||||||
cdef int j
|
|
||||||
cdef bint all_NA
|
|
||||||
result = {}
|
|
||||||
all_NA = True
|
|
||||||
for i in range(self.nb_elements_per_line) :
|
|
||||||
value = obi_get_qual_int_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, i, &value_length)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIQual_int_NA :
|
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = []
|
|
||||||
for j in range(value_length) :
|
|
||||||
value_in_result.append(<int>value[j])
|
|
||||||
result[self.elements_names[i]] = value_in_result
|
|
||||||
if all_NA and (value_in_result is not None) :
|
|
||||||
all_NA = False
|
|
||||||
if all_NA :
|
|
||||||
result = None
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef object get_str_line(self, index_t line_nb) :
|
|
||||||
cdef char* value
|
|
||||||
cdef object value_in_result
|
|
||||||
cdef dict result
|
|
||||||
cdef index_t i
|
|
||||||
cdef bint all_NA
|
|
||||||
result = {}
|
|
||||||
all_NA = True
|
|
||||||
for i in range(self.nb_elements_per_line) :
|
|
||||||
value = obi_get_qual_char_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, i)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIQual_char_NA :
|
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = bytes2str(value)
|
|
||||||
free(value)
|
|
||||||
result[self.elements_names[i]] = value_in_result
|
|
||||||
if all_NA and (value_in_result is not None) :
|
|
||||||
all_NA = False
|
|
||||||
if all_NA :
|
|
||||||
result = None
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value):
|
|
||||||
cdef uint8_t* value_b
|
|
||||||
cdef int value_length
|
|
||||||
if value is None :
|
|
||||||
if obi_set_qual_int_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), OBIQual_int_NA, 0) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
else :
|
|
||||||
value_length = len(value)
|
|
||||||
value_b = <uint8_t*> malloc(value_length * sizeof(uint8_t))
|
|
||||||
for i in range(value_length) :
|
|
||||||
value_b[i] = <uint8_t>value[i]
|
|
||||||
if obi_set_qual_int_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), value_b, value_length) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
free(value_b)
|
|
||||||
|
|
||||||
cpdef set_str_item(self, index_t line_nb, str element_name, object value):
|
|
||||||
if value is None :
|
|
||||||
if obi_set_qual_char_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), OBIQual_char_NA) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
else :
|
|
||||||
if obi_set_qual_char_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), str2bytes(value)) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,15 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
from ._obidms cimport OBIView, OBIDMS_column, OBIDMS_column_multi_elts
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_seq(OBIDMS_column):
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_line(self, index_t line_nb, object value)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_seq(OBIDMS_column_multi_elts):
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name)
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value)
|
|
@ -1,108 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_get_seq_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_get_seq_with_elt_idx_and_col_p_in_view, \
|
|
||||||
obi_set_seq_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_set_seq_with_elt_idx_and_col_p_in_view
|
|
||||||
from .capi.obierrno cimport obi_errno
|
|
||||||
from .capi.obitypes cimport OBISeq_NA, const_char_p
|
|
||||||
|
|
||||||
from ._obidms cimport OBIView
|
|
||||||
|
|
||||||
from obitools3.utils cimport str2bytes, bytes2str
|
|
||||||
|
|
||||||
from libc.stdlib cimport free
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_seq(OBIDMS_column):
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb):
|
|
||||||
cdef char* value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_seq_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBISeq_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
try:
|
|
||||||
result = <bytes> value
|
|
||||||
finally:
|
|
||||||
free(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, object value):
|
|
||||||
cdef bytes value_b
|
|
||||||
|
|
||||||
if value is None :
|
|
||||||
value_b = OBISeq_NA
|
|
||||||
elif isinstance(value, bytes) :
|
|
||||||
value_b = value
|
|
||||||
elif isinstance(value, str) :
|
|
||||||
value_b = str2bytes(value)
|
|
||||||
else:
|
|
||||||
raise TypeError('Sequence value must be of type Bytes, Str or None')
|
|
||||||
|
|
||||||
if obi_set_seq_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, value_b) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_seq(OBIDMS_column_multi_elts):
|
|
||||||
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name):
|
|
||||||
cdef char* value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_seq_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name))
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb, element_name)
|
|
||||||
if value == OBISeq_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
try:
|
|
||||||
result = <bytes> value
|
|
||||||
finally:
|
|
||||||
free(value)
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb) :
|
|
||||||
cdef char* value
|
|
||||||
cdef object value_in_result
|
|
||||||
cdef dict result
|
|
||||||
cdef index_t i
|
|
||||||
cdef bint all_NA
|
|
||||||
result = {}
|
|
||||||
all_NA = True
|
|
||||||
for i in range(self.nb_elements_per_line) :
|
|
||||||
value = obi_get_seq_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, i)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBISeq_NA :
|
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
try:
|
|
||||||
value_in_result = <bytes> value
|
|
||||||
finally:
|
|
||||||
free(value)
|
|
||||||
result[self.elements_names[i]] = value_in_result
|
|
||||||
if all_NA and (value_in_result is not None) :
|
|
||||||
all_NA = False
|
|
||||||
if all_NA :
|
|
||||||
result = None
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value):
|
|
||||||
cdef bytes value_b
|
|
||||||
|
|
||||||
if value is None :
|
|
||||||
value_b = OBISeq_NA
|
|
||||||
elif isinstance(value, bytes) :
|
|
||||||
value_b = value
|
|
||||||
elif isinstance(value, str) :
|
|
||||||
value_b = str2bytes(value)
|
|
||||||
else:
|
|
||||||
raise TypeError('Sequence value must be of type Bytes, Str or None')
|
|
||||||
|
|
||||||
if obi_set_seq_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), value_b) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,14 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
from ._obidms cimport OBIDMS_column, OBIDMS_column_multi_elts
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_str(OBIDMS_column):
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_line(self, index_t line_nb, object value)
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_str(OBIDMS_column_multi_elts):
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name)
|
|
||||||
cpdef object get_line(self, index_t line_nb)
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value)
|
|
@ -1,84 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_get_str_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_get_str_with_elt_idx_and_col_p_in_view, \
|
|
||||||
obi_set_str_with_elt_name_and_col_p_in_view, \
|
|
||||||
obi_set_str_with_elt_idx_and_col_p_in_view
|
|
||||||
from .capi.obierrno cimport obi_errno
|
|
||||||
from .capi.obitypes cimport OBIStr_NA, const_char_p
|
|
||||||
|
|
||||||
from obitools3.utils cimport str2bytes, bytes2str
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_str(OBIDMS_column):
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb):
|
|
||||||
cdef const_char_p value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_str_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIStr_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = bytes2str(value)
|
|
||||||
# NOTE: value is not freed because the pointer points to a mmapped region in an AVL data file.
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, object value):
|
|
||||||
if value is None :
|
|
||||||
if obi_set_str_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, OBIStr_NA) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
else :
|
|
||||||
if obi_set_str_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, 0, str2bytes(value)) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIDMS_column_multi_elts_str(OBIDMS_column_multi_elts):
|
|
||||||
|
|
||||||
cpdef object get_item(self, index_t line_nb, str element_name):
|
|
||||||
cdef const_char_p value
|
|
||||||
cdef object result
|
|
||||||
value = obi_get_str_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name))
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb, element_name)
|
|
||||||
if value == OBIStr_NA :
|
|
||||||
result = None
|
|
||||||
else :
|
|
||||||
result = bytes2str(value)
|
|
||||||
# NOTE: value is not freed because the pointer points to a mmapped region in an AVL data file.
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb) :
|
|
||||||
cdef const_char_p value # @DuplicatedSignature
|
|
||||||
cdef object value_in_result
|
|
||||||
cdef dict result
|
|
||||||
cdef index_t i
|
|
||||||
cdef bint all_NA
|
|
||||||
result = {}
|
|
||||||
all_NA = True
|
|
||||||
for i in range(self.nb_elements_per_line) :
|
|
||||||
value = obi_get_str_with_elt_idx_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, i)
|
|
||||||
if obi_errno > 0 :
|
|
||||||
raise IndexError(line_nb)
|
|
||||||
if value == OBIStr_NA :
|
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = bytes2str(value)
|
|
||||||
# NOTE: value is not freed because the pointer points to a mmapped region in an AVL data file.
|
|
||||||
result[self.elements_names[i]] = value_in_result
|
|
||||||
if all_NA and (value_in_result is not None) :
|
|
||||||
all_NA = False
|
|
||||||
if all_NA :
|
|
||||||
result = None
|
|
||||||
return result
|
|
||||||
|
|
||||||
cpdef set_item(self, index_t line_nb, str element_name, object value):
|
|
||||||
cdef bytes value_b
|
|
||||||
if value is None :
|
|
||||||
value_b = OBIStr_NA
|
|
||||||
else :
|
|
||||||
value_b = str2bytes(value)
|
|
||||||
if obi_set_str_with_elt_name_and_col_p_in_view(self._view._pointer, (self._pointer)[0], line_nb, str2bytes(element_name), value_b) < 0:
|
|
||||||
raise Exception("Problem setting a value in a column")
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,21 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from ._obiview cimport OBIView_line
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBI_Seq(dict) :
|
|
||||||
cdef str _id
|
|
||||||
cdef object _seq
|
|
||||||
cdef str _definition
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBI_Nuc_Seq(OBI_Seq) :
|
|
||||||
cdef object _quality
|
|
||||||
cpdef object get_str_quality(self)
|
|
||||||
|
|
||||||
#cpdef object reverse_complement(self)
|
|
||||||
|
|
||||||
cdef class OBI_Nuc_Seq_Stored(OBIView_line) :
|
|
||||||
cpdef object get_str_quality(self)
|
|
||||||
|
|
||||||
#cpdef object reverse_complement(self)
|
|
@ -1,187 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from obitools3.utils cimport bytes2str, str2bytes
|
|
||||||
|
|
||||||
from .capi.obiview cimport NUC_SEQUENCE_COLUMN, \
|
|
||||||
ID_COLUMN, \
|
|
||||||
DEFINITION_COLUMN, \
|
|
||||||
QUALITY_COLUMN
|
|
||||||
|
|
||||||
|
|
||||||
cdef str __str__ID_COLUMN__ = bytes2str(ID_COLUMN)
|
|
||||||
cdef str __str__DEFINITION_COLUMN__ = bytes2str(DEFINITION_COLUMN)
|
|
||||||
cdef str __str__QUALITY_COLUMN__ = bytes2str(QUALITY_COLUMN)
|
|
||||||
cdef str __str__NUC_SEQUENCE_COLUMN__ = bytes2str(NUC_SEQUENCE_COLUMN)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBI_Seq(dict) :
|
|
||||||
|
|
||||||
def __init__(self, str id,
|
|
||||||
object seq,
|
|
||||||
str definition=None,
|
|
||||||
dict tags=None) :
|
|
||||||
|
|
||||||
if tags is not None:
|
|
||||||
self.update(tags)
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
self._seq = seq
|
|
||||||
|
|
||||||
if definition is not None :
|
|
||||||
self._definition = definition
|
|
||||||
else:
|
|
||||||
self._definition = None
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __getitem__(self,str key):
|
|
||||||
if key == __str__ID_COLUMN__:
|
|
||||||
return self._id
|
|
||||||
elif key == __str__DEFINITION_COLUMN__:
|
|
||||||
return self._definition
|
|
||||||
else:
|
|
||||||
return dict.__getitem__(self,key)
|
|
||||||
|
|
||||||
def __setitem__(self,str key,object value):
|
|
||||||
if key == __str__ID_COLUMN__:
|
|
||||||
self._id=value
|
|
||||||
elif key == __str__DEFINITION_COLUMN__:
|
|
||||||
self._definition=value
|
|
||||||
else:
|
|
||||||
dict.__setitem__(self,key,value)
|
|
||||||
|
|
||||||
# sequence id property getter and setter
|
|
||||||
@property
|
|
||||||
def id(self): # @ReservedAssignment
|
|
||||||
return self._id
|
|
||||||
@id.setter
|
|
||||||
def id(self, str new_id): # @ReservedAssignment @DuplicatedSignature
|
|
||||||
self._id = new_id
|
|
||||||
|
|
||||||
# sequence property getter and setter
|
|
||||||
@property
|
|
||||||
def seq(self):
|
|
||||||
return self._seq
|
|
||||||
@seq.setter
|
|
||||||
def seq(self, object new_seq): # @DuplicatedSignature
|
|
||||||
self._seq = new_seq
|
|
||||||
# self["SEQ"] = new_seq # TODO discuss
|
|
||||||
|
|
||||||
# sequence definition property getter and setter
|
|
||||||
@property
|
|
||||||
def definition(self):
|
|
||||||
return self._definition
|
|
||||||
@definition.setter
|
|
||||||
def definition(self, object new_definition): # @DuplicatedSignature
|
|
||||||
self._definition = new_definition
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBI_Nuc_Seq(OBI_Seq) :
|
|
||||||
|
|
||||||
def __init__(self, str id,
|
|
||||||
object seq,
|
|
||||||
str quality=None,
|
|
||||||
str definition=None,
|
|
||||||
dict tags=None) :
|
|
||||||
OBI_Seq.__init__(self,id,seq,tags)
|
|
||||||
if quality is not None:
|
|
||||||
self._quality=quality
|
|
||||||
else:
|
|
||||||
self._quality=None
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __getitem__(self,str key):
|
|
||||||
if key == __str__NUC_SEQUENCE_COLUMN__:
|
|
||||||
return self._seq
|
|
||||||
elif key == __str__QUALITY_COLUMN__:
|
|
||||||
return self._quality
|
|
||||||
else:
|
|
||||||
return OBI_Seq.__getitem__(self,key)
|
|
||||||
|
|
||||||
def __setitem__(self,str key, object value):
|
|
||||||
if key == __str__NUC_SEQUENCE_COLUMN__:
|
|
||||||
self._seq = value
|
|
||||||
elif key == __str__QUALITY_COLUMN__:
|
|
||||||
self._quality=value
|
|
||||||
else:
|
|
||||||
OBI_Seq.__setitem__(self,key,value)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cpdef object get_str_quality(self) : # TODO not ideal. Make quality_int and quality_str properties
|
|
||||||
return self._quality
|
|
||||||
|
|
||||||
# nuc sequence property getter and setter
|
|
||||||
@property
|
|
||||||
def seq(self):
|
|
||||||
return self._seq
|
|
||||||
@seq.setter
|
|
||||||
def seq(self, object new_seq): # @DuplicatedSignature
|
|
||||||
self._seq = new_seq
|
|
||||||
# self[bytes2str(NUC_SEQUENCE_COLUMN)] = new_seq
|
|
||||||
|
|
||||||
# sequence quality property getter and setter
|
|
||||||
@property
|
|
||||||
def quality(self):
|
|
||||||
return self._quality
|
|
||||||
@quality.setter
|
|
||||||
def quality(self, object new_quality): # @DuplicatedSignature
|
|
||||||
self._quality = new_quality
|
|
||||||
# self[bytes2str(QUALITY_COLUMN)] = new_quality
|
|
||||||
|
|
||||||
# cpdef str reverse_complement(self) : TODO in C ?
|
|
||||||
# pass
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBI_Nuc_Seq_Stored(OBIView_line) :
|
|
||||||
|
|
||||||
# TODO store the str version of column name macros?
|
|
||||||
|
|
||||||
# sequence id property getter and setter
|
|
||||||
@property
|
|
||||||
def id(self): # @ReservedAssignment @DuplicatedSignature
|
|
||||||
return self[__str__ID_COLUMN__]
|
|
||||||
|
|
||||||
@id.setter
|
|
||||||
def id(self, str new_id): # @ReservedAssignment @DuplicatedSignature
|
|
||||||
self[__str__ID_COLUMN__] = new_id
|
|
||||||
|
|
||||||
# sequence definition property getter and setter
|
|
||||||
@property
|
|
||||||
def definition(self):
|
|
||||||
return self[__str__DEFINITION_COLUMN__]
|
|
||||||
|
|
||||||
@definition.setter
|
|
||||||
def definition(self, str new_def): # @DuplicatedSignature
|
|
||||||
self[__str__DEFINITION_COLUMN__] = new_def
|
|
||||||
|
|
||||||
# nuc_seq property getter and setter
|
|
||||||
@property
|
|
||||||
def nuc_seq(self):
|
|
||||||
return self[__str__NUC_SEQUENCE_COLUMN__]
|
|
||||||
|
|
||||||
@nuc_seq.setter
|
|
||||||
def nuc_seq(self, object new_seq): # @DuplicatedSignature
|
|
||||||
self[__str__NUC_SEQUENCE_COLUMN__] = new_seq
|
|
||||||
|
|
||||||
# quality property getter and setter
|
|
||||||
@property
|
|
||||||
def quality(self):
|
|
||||||
return self[__str__QUALITY_COLUMN__]
|
|
||||||
|
|
||||||
@quality.setter
|
|
||||||
def quality(self, object new_qual): # @DuplicatedSignature
|
|
||||||
if (type(new_qual) == list) or (new_qual is None) : # TODO check that quality column exists
|
|
||||||
self[__str__QUALITY_COLUMN__] = new_qual
|
|
||||||
else : # Quality is in str form
|
|
||||||
(((self._view).columns)[__str__QUALITY_COLUMN__]).set_str_line(self._index, new_qual)
|
|
||||||
|
|
||||||
cpdef object get_str_quality(self) : # TODO not ideal. Make quality_int and quality_str properties
|
|
||||||
return ((self._view).columns)[__str__QUALITY_COLUMN__].get_str_line(self._index)
|
|
||||||
|
|
||||||
# cpdef str reverse_complement(self) : TODO in C ?
|
|
||||||
# pass
|
|
||||||
|
|
||||||
# TODO static method to import OBI_Nuc_Seq to OBI_Nuc_Seq_Stored ?
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../src/bloom.h
|
|
||||||
../../../src/bloom.c
|
|
||||||
../../../src/char_str_indexer.h
|
|
||||||
../../../src/char_str_indexer.c
|
|
||||||
../../../src/crc64.h
|
|
||||||
../../../src/crc64.c
|
|
||||||
../../../src/dna_seq_indexer.h
|
|
||||||
../../../src/dna_seq_indexer.c
|
|
||||||
../../../src/encode.h
|
|
||||||
../../../src/encode.c
|
|
||||||
../../../src/hashtable.h
|
|
||||||
../../../src/hashtable.c
|
|
||||||
../../../src/murmurhash2.h
|
|
||||||
../../../src/murmurhash2.c
|
|
||||||
../../../src/obi_align.h
|
|
||||||
../../../src/obi_align.c
|
|
||||||
../../../src/obiavl.h
|
|
||||||
../../../src/obiavl.c
|
|
||||||
../../../src/obiblob_indexer.h
|
|
||||||
../../../src/obiblob_indexer.c
|
|
||||||
../../../src/obiblob.h
|
|
||||||
../../../src/obiblob.c
|
|
||||||
../../../src/obidebug.h
|
|
||||||
../../../src/obidms_taxonomy.h
|
|
||||||
../../../src/obidms_taxonomy.c
|
|
||||||
../../../src/obidms.h
|
|
||||||
../../../src/obidms.c
|
|
||||||
../../../src/obidmscolumn_blob.c
|
|
||||||
../../../src/obidmscolumn_blob.h
|
|
||||||
../../../src/obidmscolumn_bool.c
|
|
||||||
../../../src/obidmscolumn_bool.h
|
|
||||||
../../../src/obidmscolumn_char.c
|
|
||||||
../../../src/obidmscolumn_char.h
|
|
||||||
../../../src/obidmscolumn_float.c
|
|
||||||
../../../src/obidmscolumn_float.h
|
|
||||||
../../../src/obidmscolumn_idx.h
|
|
||||||
../../../src/obidmscolumn_idx.c
|
|
||||||
../../../src/obidmscolumn_int.c
|
|
||||||
../../../src/obidmscolumn_int.h
|
|
||||||
../../../src/obidmscolumn_qual.h
|
|
||||||
../../../src/obidmscolumn_qual.c
|
|
||||||
../../../src/obidmscolumn_seq.c
|
|
||||||
../../../src/obidmscolumn_seq.h
|
|
||||||
../../../src/obidmscolumn_str.c
|
|
||||||
../../../src/obidmscolumn_str.h
|
|
||||||
../../../src/obidmscolumn.h
|
|
||||||
../../../src/obidmscolumn.c
|
|
||||||
../../../src/obidmscolumndir.h
|
|
||||||
../../../src/obidmscolumndir.c
|
|
||||||
../../../src/obierrno.h
|
|
||||||
../../../src/obierrno.c
|
|
||||||
../../../src/obilittlebigman.h
|
|
||||||
../../../src/obilittlebigman.c
|
|
||||||
../../../src/obitypes.h
|
|
||||||
../../../src/obitypes.c
|
|
||||||
../../../src/obiview.h
|
|
||||||
../../../src/obiview.c
|
|
||||||
../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../src/uint8_indexer.h
|
|
||||||
../../../src/uint8_indexer.c
|
|
||||||
../../../src/upperband.h
|
|
||||||
../../../src/upperband.c
|
|
||||||
../../../src/utils.h
|
|
||||||
../../../src/utils.c
|
|
@ -1,21 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitaxonomy cimport ecotx_t, OBIDMS_taxonomy_p
|
|
||||||
from ._obidms cimport OBIDMS
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBI_Taxonomy :
|
|
||||||
|
|
||||||
cdef str _name
|
|
||||||
cdef OBIDMS_taxonomy_p _pointer
|
|
||||||
cdef OBIDMS _dms
|
|
||||||
|
|
||||||
cpdef write(self, str prefix)
|
|
||||||
cpdef int add_taxon(self, str name, str rank_name, int parent_taxid, int min_taxid=*)
|
|
||||||
cpdef close(self)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBI_Taxon :
|
|
||||||
|
|
||||||
cdef ecotx_t* _pointer
|
|
||||||
cdef OBI_Taxonomy _tax
|
|
@ -1,141 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from obitools3.utils cimport bytes2str, str2bytes
|
|
||||||
|
|
||||||
from .capi.obitaxonomy cimport obi_read_taxonomy, \
|
|
||||||
obi_read_taxdump, \
|
|
||||||
obi_write_taxonomy, \
|
|
||||||
obi_close_taxonomy, \
|
|
||||||
obi_taxo_get_taxon_with_taxid, \
|
|
||||||
obi_taxo_add_local_taxon, \
|
|
||||||
obi_taxo_add_preferred_name_with_taxon, \
|
|
||||||
ecotx_t
|
|
||||||
|
|
||||||
from ._obidms cimport OBIDMS
|
|
||||||
|
|
||||||
from cpython.pycapsule cimport PyCapsule_New, PyCapsule_GetPointer
|
|
||||||
from logging import raiseExceptions
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBI_Taxonomy :
|
|
||||||
|
|
||||||
# TODO function to import taxonomy?
|
|
||||||
|
|
||||||
def __init__(self, OBIDMS dms, str name, bint taxdump=False) :
|
|
||||||
|
|
||||||
self._dms = dms
|
|
||||||
self._name = name
|
|
||||||
if taxdump :
|
|
||||||
self._pointer = obi_read_taxdump(str2bytes(name))
|
|
||||||
else :
|
|
||||||
self._pointer = obi_read_taxonomy(dms._pointer, str2bytes(name), True) # TODO discuss
|
|
||||||
# TODO if not found in DMS, try to import?
|
|
||||||
|
|
||||||
|
|
||||||
def __getitem__(self, object ref):
|
|
||||||
|
|
||||||
cdef ecotx_t* taxon_p
|
|
||||||
cdef object taxon_capsule
|
|
||||||
|
|
||||||
if type(ref) == int :
|
|
||||||
taxon_p = obi_taxo_get_taxon_with_taxid(self._pointer, ref)
|
|
||||||
if taxon_p == NULL :
|
|
||||||
raise Exception("Taxon not found")
|
|
||||||
taxon_capsule = PyCapsule_New(taxon_p, NULL, NULL)
|
|
||||||
return OBI_Taxon(taxon_capsule, self)
|
|
||||||
else :
|
|
||||||
raise Exception("Not implemented")
|
|
||||||
|
|
||||||
|
|
||||||
def __iter__(self):
|
|
||||||
|
|
||||||
cdef ecotx_t* taxa
|
|
||||||
cdef ecotx_t* taxon_p
|
|
||||||
cdef object taxon_capsule
|
|
||||||
cdef int t
|
|
||||||
|
|
||||||
taxa = self._pointer.taxa.taxon
|
|
||||||
|
|
||||||
# Yield each taxid
|
|
||||||
for t in range(self._pointer.taxa.count):
|
|
||||||
taxon_p = <ecotx_t*> (taxa+t)
|
|
||||||
taxon_capsule = PyCapsule_New(taxon_p, NULL, NULL)
|
|
||||||
yield OBI_Taxon(taxon_capsule, self)
|
|
||||||
|
|
||||||
|
|
||||||
cpdef write(self, str prefix) :
|
|
||||||
if obi_write_taxonomy(self._dms._pointer, self._pointer, str2bytes(prefix)) < 0 :
|
|
||||||
raise Exception("Error writing the taxonomy to binary files")
|
|
||||||
|
|
||||||
|
|
||||||
cpdef int add_taxon(self, str name, str rank_name, int parent_taxid, int min_taxid=10000000) :
|
|
||||||
cdef int taxid
|
|
||||||
taxid = obi_taxo_add_local_taxon(self._pointer, str2bytes(name), str2bytes(rank_name), parent_taxid, min_taxid)
|
|
||||||
if taxid < 0 :
|
|
||||||
raise Exception("Error adding a new taxon to the taxonomy")
|
|
||||||
else :
|
|
||||||
return taxid
|
|
||||||
|
|
||||||
|
|
||||||
cpdef close(self) :
|
|
||||||
if (obi_close_taxonomy(self._pointer) < 0) :
|
|
||||||
raise Exception("Error closing the taxonomy")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBI_Taxon : # TODO dict subclass?
|
|
||||||
|
|
||||||
def __init__(self, object taxon_capsule, OBI_Taxonomy tax) :
|
|
||||||
self._pointer = <ecotx_t*> PyCapsule_GetPointer(taxon_capsule, NULL)
|
|
||||||
if self._pointer == NULL :
|
|
||||||
raise Exception("Error reading a taxon (NULL pointer)")
|
|
||||||
self._tax = tax
|
|
||||||
|
|
||||||
# name property getter
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
return bytes2str(self._pointer.name)
|
|
||||||
|
|
||||||
# taxid property getter
|
|
||||||
@property
|
|
||||||
def taxid(self):
|
|
||||||
return self._pointer.taxid
|
|
||||||
|
|
||||||
# rank property getter
|
|
||||||
@property
|
|
||||||
def rank(self):
|
|
||||||
return self._pointer.rank
|
|
||||||
|
|
||||||
# farest property getter
|
|
||||||
@property
|
|
||||||
def farest(self):
|
|
||||||
return self._pointer.farest
|
|
||||||
|
|
||||||
# parent property getter
|
|
||||||
@property
|
|
||||||
def parent(self):
|
|
||||||
cdef object parent_capsule
|
|
||||||
parent_capsule = PyCapsule_New(self._pointer.parent, NULL, NULL)
|
|
||||||
return OBI_Taxon(parent_capsule, self._tax)
|
|
||||||
|
|
||||||
# preferred name property getter and setter
|
|
||||||
@property
|
|
||||||
def preferred_name(self):
|
|
||||||
if self._pointer.preferred_name != NULL :
|
|
||||||
return bytes2str(self._pointer.preferred_name)
|
|
||||||
@preferred_name.setter
|
|
||||||
def preferred_name(self, str new_preferred_name) : # @DuplicatedSignature
|
|
||||||
if (obi_taxo_add_preferred_name_with_taxon(self._tax._pointer, self._pointer, str2bytes(new_preferred_name)) < 0) :
|
|
||||||
raise Exception("Error adding a new preferred name to a taxon")
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
d = {}
|
|
||||||
d['taxid'] = self.taxid
|
|
||||||
d['name'] = self.name
|
|
||||||
d['preferred name'] = self.preferred_name
|
|
||||||
d['parent'] = self.parent.taxid
|
|
||||||
d['farest'] = self.farest
|
|
||||||
return str(d)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from ._obidms cimport OBIDMS
|
|
||||||
|
|
||||||
from .capi.obiview cimport Obiview_p
|
|
||||||
from .capi.obitypes cimport obiversion_t, index_t
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView:
|
|
||||||
|
|
||||||
cdef Obiview_p _pointer
|
|
||||||
cdef dict _columns
|
|
||||||
|
|
||||||
cdef __init_columns__(self)
|
|
||||||
|
|
||||||
cpdef OBIView clone(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=*)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView new(OBIDMS dms,
|
|
||||||
str view_name,
|
|
||||||
str comments=*)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView open(OBIDMS dms,
|
|
||||||
str view_name)
|
|
||||||
|
|
||||||
cpdef delete_column(self, str column_name)
|
|
||||||
|
|
||||||
cpdef add_column(self,
|
|
||||||
str column_name,
|
|
||||||
obiversion_t version_number=*,
|
|
||||||
str alias=*,
|
|
||||||
str type=*,
|
|
||||||
index_t nb_lines=*,
|
|
||||||
index_t nb_elements_per_line=*,
|
|
||||||
list elements_names=*,
|
|
||||||
str indexer_name=*,
|
|
||||||
str associated_column_name=*,
|
|
||||||
obiversion_t associated_column_version=*,
|
|
||||||
str comments=*,
|
|
||||||
bint create=*
|
|
||||||
)
|
|
||||||
|
|
||||||
cpdef change_column_alias(self, str current_alias, str new_alias)
|
|
||||||
|
|
||||||
cpdef update_column_pointers(self)
|
|
||||||
|
|
||||||
cpdef OBIView_line_selection new_selection(self,
|
|
||||||
list lines=*)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_line :
|
|
||||||
|
|
||||||
cdef index_t _index
|
|
||||||
cdef OBIView _view
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_line_selection(list):
|
|
||||||
|
|
||||||
cdef OBIView _view
|
|
||||||
cdef str _view_name
|
|
||||||
|
|
||||||
cdef index_t* __build_binary_list__(self)
|
|
||||||
|
|
||||||
cpdef OBIView materialize(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=*)
|
|
||||||
|
|
@ -1,426 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from obitools3.utils cimport bytes2str, str2bytes
|
|
||||||
|
|
||||||
from .capi.obitypes cimport OBI_INT, \
|
|
||||||
OBI_FLOAT, \
|
|
||||||
OBI_BOOL, \
|
|
||||||
OBI_CHAR, \
|
|
||||||
OBI_QUAL, \
|
|
||||||
OBI_STR, \
|
|
||||||
OBI_SEQ, \
|
|
||||||
only_ATGC
|
|
||||||
|
|
||||||
from .capi.obiview cimport Obiview_p, \
|
|
||||||
obi_new_view, \
|
|
||||||
obi_open_view, \
|
|
||||||
obi_view_delete_column, \
|
|
||||||
obi_view_add_column, \
|
|
||||||
obi_view_create_column_alias, \
|
|
||||||
obi_view_get_column, \
|
|
||||||
obi_view_get_pointer_on_column_in_view, \
|
|
||||||
obi_save_and_close_view
|
|
||||||
|
|
||||||
from .capi.obidmscolumn cimport OBIDMS_column_p
|
|
||||||
|
|
||||||
from ._obidms cimport OBIDMS, \
|
|
||||||
OBIDMS_column
|
|
||||||
|
|
||||||
from libc.stdlib cimport malloc
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView :
|
|
||||||
|
|
||||||
def __init__(self,int __internalCall__):
|
|
||||||
if __internalCall__!=987654:
|
|
||||||
raise RuntimeError('OBIView constructor cannot be called directly')
|
|
||||||
self._pointer = NULL
|
|
||||||
self._columns = {}
|
|
||||||
|
|
||||||
|
|
||||||
cdef __init_columns__(self):
|
|
||||||
cdef size_t i
|
|
||||||
cdef str col_alias
|
|
||||||
cdef OBIDMS_column_p column_p
|
|
||||||
cdef Obiview_p pointer = self._pointer
|
|
||||||
|
|
||||||
self._columns = {}
|
|
||||||
|
|
||||||
for i in range(pointer.infos.column_count) :
|
|
||||||
col_alias = bytes2str(pointer.infos.column_references[i].alias)
|
|
||||||
column_p = <OBIDMS_column_p> (pointer.columns)[i]
|
|
||||||
subclass = OBIDMS_column.get_subclass_type(column_p)
|
|
||||||
self._columns[col_alias] = subclass(self, col_alias)
|
|
||||||
|
|
||||||
|
|
||||||
cpdef OBIView clone(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=""):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView(987654)
|
|
||||||
|
|
||||||
view._pointer = obi_new_view(self._pointer.dms,
|
|
||||||
str2bytes(view_name),
|
|
||||||
self._pointer,
|
|
||||||
NULL,
|
|
||||||
str2bytes(comments))
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot clone view %s into view %s"
|
|
||||||
% (str(self.name),
|
|
||||||
view_name)
|
|
||||||
)
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView new(OBIDMS dms,
|
|
||||||
str view_name,
|
|
||||||
str comments=""):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView(987654) # @DuplicatedSignature
|
|
||||||
|
|
||||||
view._pointer = obi_new_view(dms._pointer,
|
|
||||||
str2bytes(view_name),
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
str2bytes(comments))
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot create view %s" % view_name)
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView open(OBIDMS dms,
|
|
||||||
str view_name):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView(987654) # @DuplicatedSignature
|
|
||||||
|
|
||||||
view._pointer = obi_open_view(dms._pointer,
|
|
||||||
str2bytes(view_name))
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot open view %s" % view_name)
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
def __dealloc__(self):
|
|
||||||
if (obi_save_and_close_view(self._pointer) < 0) :
|
|
||||||
raise Exception("Problem closing a view")
|
|
||||||
|
|
||||||
|
|
||||||
def __repr__(self) :
|
|
||||||
cdef str s
|
|
||||||
s = str(self.name) + "\n" + str(self.comments) + "\n" + str(self.line_count) + " lines\n"
|
|
||||||
for column_name in self._columns :
|
|
||||||
s = s + repr(self._columns[column_name]) + '\n'
|
|
||||||
return s
|
|
||||||
|
|
||||||
|
|
||||||
cpdef delete_column(self, str column_name) :
|
|
||||||
cdef str column_n
|
|
||||||
if obi_view_delete_column(self._pointer, str2bytes(column_name)) < 0 :
|
|
||||||
raise Exception("Problem deleting a column from a view")
|
|
||||||
# Update the dictionary of column objects:
|
|
||||||
(self._columns).pop(column_name)
|
|
||||||
self.update_column_pointers()
|
|
||||||
|
|
||||||
|
|
||||||
cpdef add_column(self,
|
|
||||||
str column_name,
|
|
||||||
obiversion_t version_number=-1,
|
|
||||||
str alias='',
|
|
||||||
str type='',
|
|
||||||
index_t nb_lines=0,
|
|
||||||
index_t nb_elements_per_line=1,
|
|
||||||
list elements_names=None,
|
|
||||||
str indexer_name="",
|
|
||||||
str associated_column_name="",
|
|
||||||
obiversion_t associated_column_version=-1,
|
|
||||||
str comments="",
|
|
||||||
bint create=True
|
|
||||||
) :
|
|
||||||
|
|
||||||
cdef bytes column_name_b
|
|
||||||
cdef bytes elements_names_b
|
|
||||||
cdef object subclass
|
|
||||||
cdef OBIDMS_column_p column_p
|
|
||||||
|
|
||||||
column_name_b = str2bytes(column_name)
|
|
||||||
if alias == '' :
|
|
||||||
alias = column_name
|
|
||||||
alias_b = column_name_b
|
|
||||||
else :
|
|
||||||
alias_b = str2bytes(alias)
|
|
||||||
|
|
||||||
if elements_names is None :
|
|
||||||
elements_names_b = str2bytes("")
|
|
||||||
else :
|
|
||||||
elements_names_b = str2bytes(';'.join(elements_names))
|
|
||||||
|
|
||||||
if type : # TODO make C function that does that
|
|
||||||
if type == 'OBI_INT' :
|
|
||||||
data_type = OBI_INT
|
|
||||||
elif type == 'OBI_FLOAT' :
|
|
||||||
data_type = OBI_FLOAT
|
|
||||||
elif type == 'OBI_BOOL' :
|
|
||||||
data_type = OBI_BOOL
|
|
||||||
elif type == 'OBI_CHAR' :
|
|
||||||
data_type = OBI_CHAR
|
|
||||||
elif type == 'OBI_QUAL' :
|
|
||||||
data_type = OBI_QUAL
|
|
||||||
elif type == 'OBI_STR' :
|
|
||||||
data_type = OBI_STR
|
|
||||||
elif type == 'OBI_SEQ' :
|
|
||||||
data_type = OBI_SEQ
|
|
||||||
else :
|
|
||||||
raise Exception("Invalid provided data type")
|
|
||||||
|
|
||||||
if (obi_view_add_column(self._pointer, column_name_b, version_number, alias_b,
|
|
||||||
data_type, nb_lines, nb_elements_per_line,
|
|
||||||
elements_names_b, str2bytes(indexer_name),
|
|
||||||
str2bytes(associated_column_name), associated_column_version,
|
|
||||||
str2bytes(comments), create) < 0) :
|
|
||||||
raise Exception("Problem adding a column in a view")
|
|
||||||
|
|
||||||
# Get the column pointer
|
|
||||||
column_p = obi_view_get_column(self._pointer, alias_b)
|
|
||||||
|
|
||||||
# Open and store the subclass
|
|
||||||
subclass = OBIDMS_column.get_subclass_type(column_p)
|
|
||||||
(self._columns)[alias] = subclass(self, alias)
|
|
||||||
|
|
||||||
|
|
||||||
cpdef change_column_alias(self, str current_alias, str new_alias):
|
|
||||||
cdef OBIDMS_column column
|
|
||||||
if (obi_view_create_column_alias(self._pointer, str2bytes(current_alias), str2bytes(new_alias)) < 0) :
|
|
||||||
raise Exception("Problem changing a column alias")
|
|
||||||
# Update the dictionaries of column objects
|
|
||||||
self._columns[new_alias] = self._columns[current_alias]
|
|
||||||
column = self._columns[new_alias]
|
|
||||||
column._alias = new_alias
|
|
||||||
(self._columns).pop(current_alias)
|
|
||||||
|
|
||||||
|
|
||||||
cpdef update_column_pointers(self):
|
|
||||||
cdef str column_n
|
|
||||||
cdef OBIDMS_column column
|
|
||||||
for column_n in self._columns :
|
|
||||||
column = self._columns[column_n]
|
|
||||||
column._pointer = <OBIDMS_column_p*> obi_view_get_pointer_on_column_in_view(self._pointer, str2bytes(column_n))
|
|
||||||
|
|
||||||
|
|
||||||
cpdef OBIView_line_selection new_selection(self,list lines=None):
|
|
||||||
return OBIView_line_selection(self,lines)
|
|
||||||
|
|
||||||
|
|
||||||
def __iter__(self):
|
|
||||||
# Iteration on each line of all columns
|
|
||||||
|
|
||||||
# Declarations
|
|
||||||
cdef index_t line_nb
|
|
||||||
cdef OBIView_line line
|
|
||||||
|
|
||||||
# Yield each line
|
|
||||||
for line_nb in range(self.line_count) :
|
|
||||||
line = self[line_nb]
|
|
||||||
yield line
|
|
||||||
|
|
||||||
|
|
||||||
def __getitem__(self, object item) :
|
|
||||||
if type(item) == str :
|
|
||||||
return (self._columns)[item]
|
|
||||||
elif type(item) == int :
|
|
||||||
return OBIView_line(self, item)
|
|
||||||
|
|
||||||
|
|
||||||
def __contains__(self, str column_name):
|
|
||||||
return (column_name in self._columns)
|
|
||||||
|
|
||||||
|
|
||||||
def __len__(self):
|
|
||||||
return(self.line_count)
|
|
||||||
|
|
||||||
|
|
||||||
def __str__(self) :
|
|
||||||
cdef OBIView_line line
|
|
||||||
cdef str to_print
|
|
||||||
to_print = ""
|
|
||||||
for line in self :
|
|
||||||
to_print = to_print + str(line) + "\n"
|
|
||||||
return to_print
|
|
||||||
|
|
||||||
|
|
||||||
# line_count property getter
|
|
||||||
@property
|
|
||||||
def line_count(self):
|
|
||||||
return self._pointer.infos.line_count
|
|
||||||
|
|
||||||
# name property getter
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
return bytes2str(self._pointer.infos.name)
|
|
||||||
|
|
||||||
# view type property getter
|
|
||||||
@property
|
|
||||||
def type(self): # @ReservedAssignment
|
|
||||||
return bytes2str(self._pointer.infos.view_type)
|
|
||||||
|
|
||||||
# columns property getter
|
|
||||||
@property
|
|
||||||
def columns(self):
|
|
||||||
return self._columns
|
|
||||||
|
|
||||||
# comments property getter
|
|
||||||
@property
|
|
||||||
def comments(self):
|
|
||||||
return bytes2str(self._pointer.infos.comments)
|
|
||||||
# TODO setter that concatenates new comments?
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_line :
|
|
||||||
|
|
||||||
def __init__(self, OBIView view, index_t line_nb) :
|
|
||||||
self._index = line_nb
|
|
||||||
self._view = view
|
|
||||||
|
|
||||||
|
|
||||||
def __getitem__(self, str column_name) :
|
|
||||||
return ((self._view)._columns)[column_name][self._index]
|
|
||||||
|
|
||||||
|
|
||||||
def __setitem__(self, str column_name, object value):
|
|
||||||
# TODO detect multiple elements (dict type)? put somewhere else? but more risky (in get)
|
|
||||||
# TODO OBI_QUAL ?
|
|
||||||
cdef type value_type
|
|
||||||
cdef str value_obitype
|
|
||||||
cdef bytes value_b
|
|
||||||
|
|
||||||
if column_name not in self._view :
|
|
||||||
if value == None :
|
|
||||||
raise Exception("Trying to create a column from a None value (can't guess type)")
|
|
||||||
value_type = type(value)
|
|
||||||
if value_type == int :
|
|
||||||
value_obitype = 'OBI_INT'
|
|
||||||
elif value_type == float :
|
|
||||||
value_obitype = 'OBI_FLOAT'
|
|
||||||
elif value_type == bool :
|
|
||||||
value_obitype = 'OBI_BOOL'
|
|
||||||
elif value_type == str or value_type == bytes :
|
|
||||||
if value_type == str :
|
|
||||||
value_b = str2bytes(value)
|
|
||||||
else :
|
|
||||||
value_b = value
|
|
||||||
if only_ATGC(value_b) : # TODO detect IUPAC
|
|
||||||
value_obitype = 'OBI_SEQ'
|
|
||||||
elif len(value) == 1 :
|
|
||||||
value_obitype = 'OBI_CHAR'
|
|
||||||
elif (len(value) > 1) :
|
|
||||||
value_obitype = 'OBI_STR'
|
|
||||||
else :
|
|
||||||
raise Exception("Could not guess the type of a value to create a new column")
|
|
||||||
self._view.add_column(column_name, type=value_obitype)
|
|
||||||
|
|
||||||
(((self._view)._columns)[column_name]).set_line(self._index, value)
|
|
||||||
|
|
||||||
|
|
||||||
def __iter__(self):
|
|
||||||
for column_name in ((self._view)._columns) :
|
|
||||||
yield column_name
|
|
||||||
|
|
||||||
|
|
||||||
def __contains__(self, str column_name):
|
|
||||||
return (column_name in self._view._columns)
|
|
||||||
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
cdef dict line
|
|
||||||
cdef str column_name
|
|
||||||
line = {}
|
|
||||||
for column_name in self._view._columns :
|
|
||||||
line[column_name] = self[column_name]
|
|
||||||
return str(line)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_line_selection(list):
|
|
||||||
|
|
||||||
def __init__(self, OBIView view, lines=None) :
|
|
||||||
if view._pointer == NULL:
|
|
||||||
raise Exception("Error: trying to create a line selection with an invalidated view")
|
|
||||||
self._view = view
|
|
||||||
self._view_name = view.name
|
|
||||||
|
|
||||||
if lines is not None:
|
|
||||||
self.extend(lines)
|
|
||||||
|
|
||||||
|
|
||||||
def extend(self, iterable):
|
|
||||||
cdef index_t i
|
|
||||||
cdef index_t max_i = self._view.line_count
|
|
||||||
|
|
||||||
for i in iterable:
|
|
||||||
if i > max_i:
|
|
||||||
raise RuntimeError("Error: trying to select line %d beyond the line count %d of view %s" %
|
|
||||||
(i,
|
|
||||||
max_i,
|
|
||||||
self._view_name)
|
|
||||||
)
|
|
||||||
list.append(self,i)
|
|
||||||
|
|
||||||
|
|
||||||
def append(self, index_t idx) :
|
|
||||||
if idx >= self._view.line_count :
|
|
||||||
raise RuntimeError("Error: trying to select line %d beyond the line count %d of view %s" %
|
|
||||||
(idx,
|
|
||||||
self._view.line_count,
|
|
||||||
self._view_name)
|
|
||||||
)
|
|
||||||
list.append(self,idx)
|
|
||||||
|
|
||||||
|
|
||||||
cdef index_t* __build_binary_list__(self):
|
|
||||||
cdef index_t* line_selection_p = NULL
|
|
||||||
cdef int i
|
|
||||||
cdef size_t len_selection = len(self)
|
|
||||||
|
|
||||||
line_selection_p = <index_t*> malloc((len_selection + 1) * sizeof(index_t)) # +1 for the -1 flagging the end of the array
|
|
||||||
for i in range(len_selection) :
|
|
||||||
line_selection_p[i] = self[i]
|
|
||||||
line_selection_p[len_selection] = -1 # flagging the end of the array
|
|
||||||
|
|
||||||
return line_selection_p
|
|
||||||
|
|
||||||
|
|
||||||
cpdef OBIView materialize(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=""):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView(987654)
|
|
||||||
|
|
||||||
view._pointer = obi_new_view(self._view._pointer.dms,
|
|
||||||
str2bytes(view_name),
|
|
||||||
self._view._pointer,
|
|
||||||
self.__build_binary_list__(),
|
|
||||||
str2bytes(comments))
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error: Cannot clone view %s into view %s"
|
|
||||||
% (str(self.name),
|
|
||||||
view_name)
|
|
||||||
)
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from ._obidms cimport OBIDMS
|
|
||||||
from ._obiview cimport OBIView, OBIView_line_selection
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_NUC_SEQS(OBIView):
|
|
||||||
|
|
||||||
cpdef OBIView clone(self,
|
|
||||||
str new_view_name,
|
|
||||||
str comments=*)
|
|
||||||
|
|
||||||
cpdef OBIView_line_selection new_selection(self, list lines=*)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView new(OBIDMS dms,
|
|
||||||
str view_name,
|
|
||||||
str comments=*)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView open(OBIDMS dms,
|
|
||||||
str view_name)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_NUC_SEQS_line_selection(OBIView_line_selection):
|
|
||||||
|
|
||||||
cpdef OBIView materialize(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=*)
|
|
@ -1,113 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
|
|
||||||
from ._obiseq cimport OBI_Nuc_Seq, OBI_Nuc_Seq_Stored
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_new_view_nuc_seqs, \
|
|
||||||
obi_open_view
|
|
||||||
|
|
||||||
from obitools3.utils cimport str2bytes
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_NUC_SEQS(OBIView):
|
|
||||||
|
|
||||||
cpdef OBIView clone(self,
|
|
||||||
str new_view_name,
|
|
||||||
str comments=""):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView_NUC_SEQS(987654)
|
|
||||||
|
|
||||||
view._pointer = obi_new_view_nuc_seqs(self._pointer.dms,
|
|
||||||
str2bytes(new_view_name),
|
|
||||||
self._pointer,
|
|
||||||
NULL,
|
|
||||||
str2bytes(comments),
|
|
||||||
False)
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot clone view %s into view %s"
|
|
||||||
% (str(self.name), new_view_name))
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView new(OBIDMS dms,
|
|
||||||
str view_name,
|
|
||||||
str comments=""):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView_NUC_SEQS(987654) # @DuplicatedSignature
|
|
||||||
|
|
||||||
view._pointer = obi_new_view_nuc_seqs(dms._pointer,
|
|
||||||
str2bytes(view_name),
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
str2bytes(comments),
|
|
||||||
False)
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot create view %s" % view_name)
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView open(OBIDMS dms,
|
|
||||||
str view_name):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView_NUC_SEQS(987654) # @DuplicatedSignature
|
|
||||||
|
|
||||||
view._pointer = obi_open_view(dms._pointer,
|
|
||||||
str2bytes(view_name))
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot open view %s" % view_name)
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
cpdef OBIView_line_selection new_selection(self, list lines=None):
|
|
||||||
return OBIView_NUC_SEQS_line_selection(self, lines)
|
|
||||||
|
|
||||||
|
|
||||||
def __getitem__(self, object item) :
|
|
||||||
if type(item) == str :
|
|
||||||
return (self._columns)[item]
|
|
||||||
elif type(item) == int :
|
|
||||||
return OBI_Nuc_Seq_Stored(self, item)
|
|
||||||
|
|
||||||
|
|
||||||
def __setitem__(self, index_t line_idx, OBI_Nuc_Seq sequence_obj) :
|
|
||||||
for key in sequence_obj :
|
|
||||||
self[line_idx][key] = sequence_obj[key]
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_NUC_SEQS_line_selection(OBIView_line_selection):
|
|
||||||
|
|
||||||
cpdef OBIView materialize(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=""):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView_NUC_SEQS(987654)
|
|
||||||
|
|
||||||
view._pointer = obi_new_view_nuc_seqs(self._view._pointer.dms,
|
|
||||||
str2bytes(view_name),
|
|
||||||
self._view._pointer,
|
|
||||||
self.__build_binary_list__(),
|
|
||||||
str2bytes(comments),
|
|
||||||
False)
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot clone view %s into view %s"
|
|
||||||
% (str(self.name), view_name))
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
@ -1,28 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
|
|
||||||
from ._obidms cimport OBIDMS
|
|
||||||
from ._obiview cimport OBIView
|
|
||||||
from ._obiview_nuc_seq cimport OBIView_NUC_SEQS, OBIView_NUC_SEQS_line_selection
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_NUC_SEQS_QUAL(OBIView_NUC_SEQS):
|
|
||||||
cpdef OBIView clone(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=*)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView new(OBIDMS dms,
|
|
||||||
str view_name,
|
|
||||||
str comments=*)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView open(OBIDMS dms,
|
|
||||||
str view_name)
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_NUC_SEQS_QUAL_line_selection(OBIView_NUC_SEQS_line_selection):
|
|
||||||
cpdef OBIView materialize(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=*)
|
|
@ -1,97 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .capi.obitypes cimport index_t
|
|
||||||
|
|
||||||
from .capi.obiview cimport obi_new_view_nuc_seqs, \
|
|
||||||
obi_open_view
|
|
||||||
|
|
||||||
from obitools3.utils cimport bytes2str, str2bytes
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_NUC_SEQS_QUAL(OBIView_NUC_SEQS):
|
|
||||||
|
|
||||||
cpdef OBIView clone(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=""):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView_NUC_SEQS_QUAL(987654)
|
|
||||||
|
|
||||||
view._pointer = obi_new_view_nuc_seqs(self._pointer.dms,
|
|
||||||
str2bytes(view_name),
|
|
||||||
self._pointer,
|
|
||||||
NULL,
|
|
||||||
str2bytes(comments),
|
|
||||||
True)
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot clone view %s into view %s"
|
|
||||||
% (str(self.name), view_name))
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView new(OBIDMS dms,
|
|
||||||
str view_name,
|
|
||||||
str comments=""):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView_NUC_SEQS_QUAL(987654) # @DuplicatedSignature
|
|
||||||
|
|
||||||
view._pointer = obi_new_view_nuc_seqs(dms._pointer,
|
|
||||||
str2bytes(view_name),
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
str2bytes(comments),
|
|
||||||
True)
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error: Cannot create view %s" % view_name)
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
cdef OBIView open(OBIDMS dms,
|
|
||||||
str view_name):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView_NUC_SEQS_QUAL(987654) # @DuplicatedSignature
|
|
||||||
|
|
||||||
view._pointer = obi_open_view(dms._pointer,
|
|
||||||
str2bytes(view_name))
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error: Cannot open view %s" % view_name)
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
||||||
|
|
||||||
|
|
||||||
cdef class OBIView_NUC_SEQS_QUAL_line_selection(OBIView_NUC_SEQS_line_selection):
|
|
||||||
|
|
||||||
cpdef OBIView materialize(self,
|
|
||||||
str view_name,
|
|
||||||
str comments=""):
|
|
||||||
|
|
||||||
cdef OBIView view = OBIView_NUC_SEQS_QUAL(987654)
|
|
||||||
|
|
||||||
view._pointer = obi_new_view_nuc_seqs(self._view._pointer.dms,
|
|
||||||
str2bytes(view_name),
|
|
||||||
self._view._pointer,
|
|
||||||
self.__build_binary_list__(),
|
|
||||||
str2bytes(comments),
|
|
||||||
True)
|
|
||||||
|
|
||||||
if view._pointer == NULL :
|
|
||||||
raise RuntimeError("Error : Cannot clone view %s into view %s"
|
|
||||||
% (str(self.name),
|
|
||||||
view_name)
|
|
||||||
)
|
|
||||||
|
|
||||||
view.__init_columns__()
|
|
||||||
|
|
||||||
return view
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../../src/bloom.h
|
|
||||||
../../../../src/bloom.c
|
|
||||||
../../../../src/char_str_indexer.h
|
|
||||||
../../../../src/char_str_indexer.c
|
|
||||||
../../../../src/crc64.h
|
|
||||||
../../../../src/crc64.c
|
|
||||||
../../../../src/dna_seq_indexer.h
|
|
||||||
../../../../src/dna_seq_indexer.c
|
|
||||||
../../../../src/encode.h
|
|
||||||
../../../../src/encode.c
|
|
||||||
../../../../src/hashtable.h
|
|
||||||
../../../../src/hashtable.c
|
|
||||||
../../../../src/murmurhash2.h
|
|
||||||
../../../../src/murmurhash2.c
|
|
||||||
../../../../src/obi_align.h
|
|
||||||
../../../../src/obi_align.c
|
|
||||||
../../../../src/obiavl.h
|
|
||||||
../../../../src/obiavl.c
|
|
||||||
../../../../src/obiblob_indexer.h
|
|
||||||
../../../../src/obiblob_indexer.c
|
|
||||||
../../../../src/obiblob.h
|
|
||||||
../../../../src/obiblob.c
|
|
||||||
../../../../src/obidebug.h
|
|
||||||
../../../../src/obidms_taxonomy.h
|
|
||||||
../../../../src/obidms_taxonomy.c
|
|
||||||
../../../../src/obidms.h
|
|
||||||
../../../../src/obidms.c
|
|
||||||
../../../../src/obidmscolumn_blob.c
|
|
||||||
../../../../src/obidmscolumn_blob.h
|
|
||||||
../../../../src/obidmscolumn_bool.c
|
|
||||||
../../../../src/obidmscolumn_bool.h
|
|
||||||
../../../../src/obidmscolumn_char.c
|
|
||||||
../../../../src/obidmscolumn_char.h
|
|
||||||
../../../../src/obidmscolumn_float.c
|
|
||||||
../../../../src/obidmscolumn_float.h
|
|
||||||
../../../../src/obidmscolumn_idx.h
|
|
||||||
../../../../src/obidmscolumn_idx.c
|
|
||||||
../../../../src/obidmscolumn_int.c
|
|
||||||
../../../../src/obidmscolumn_int.h
|
|
||||||
../../../../src/obidmscolumn_qual.h
|
|
||||||
../../../../src/obidmscolumn_qual.c
|
|
||||||
../../../../src/obidmscolumn_seq.c
|
|
||||||
../../../../src/obidmscolumn_seq.h
|
|
||||||
../../../../src/obidmscolumn_str.c
|
|
||||||
../../../../src/obidmscolumn_str.h
|
|
||||||
../../../../src/obidmscolumn.h
|
|
||||||
../../../../src/obidmscolumn.c
|
|
||||||
../../../../src/obidmscolumndir.h
|
|
||||||
../../../../src/obidmscolumndir.c
|
|
||||||
../../../../src/obierrno.h
|
|
||||||
../../../../src/obierrno.c
|
|
||||||
../../../../src/obilittlebigman.h
|
|
||||||
../../../../src/obilittlebigman.c
|
|
||||||
../../../../src/obitypes.h
|
|
||||||
../../../../src/obitypes.c
|
|
||||||
../../../../src/obiview.h
|
|
||||||
../../../../src/obiview.c
|
|
||||||
../../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../../src/uint8_indexer.h
|
|
||||||
../../../../src/uint8_indexer.c
|
|
||||||
../../../../src/upperband.h
|
|
||||||
../../../../src/upperband.c
|
|
||||||
../../../../src/utils.h
|
|
||||||
../../../../src/utils.c
|
|
@ -1,41 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from obitools3.obidms.capi.obidms cimport OBIDMS_p
|
|
||||||
from obitools3.obidms.capi.obitypes cimport const_char_p
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "obi_align.h" nogil:
|
|
||||||
|
|
||||||
int obi_lcs_align_one_column(OBIDMS_p dms,
|
|
||||||
const_char_p seq_view_name,
|
|
||||||
const_char_p seq_column_name,
|
|
||||||
const_char_p seq_elt_name,
|
|
||||||
const_char_p id_column_name,
|
|
||||||
const_char_p output_view_name,
|
|
||||||
const_char_p output_view_comments,
|
|
||||||
bint print_seq,
|
|
||||||
bint print_count,
|
|
||||||
double threshold,
|
|
||||||
bint normalize,
|
|
||||||
int reference,
|
|
||||||
bint similarity_mode,
|
|
||||||
int thread_count)
|
|
||||||
|
|
||||||
|
|
||||||
int obi_lcs_align_two_columns(OBIDMS_p dms,
|
|
||||||
const_char_p seq1_view_name,
|
|
||||||
const_char_p seq2_view_name,
|
|
||||||
const_char_p seq1_column_name,
|
|
||||||
const_char_p seq2_column_name,
|
|
||||||
const_char_p seq1_elt_name,
|
|
||||||
const_char_p seq2_elt_name,
|
|
||||||
const_char_p id1_column_name,
|
|
||||||
const_char_p id2_column_name,
|
|
||||||
const_char_p output_view_name,
|
|
||||||
const_char_p output_view_comments,
|
|
||||||
bint print_seq,
|
|
||||||
bint print_count,
|
|
||||||
double threshold,
|
|
||||||
bint normalize,
|
|
||||||
int reference,
|
|
||||||
bint similarity_mode);
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../../src/bloom.h
|
|
||||||
../../../../src/bloom.c
|
|
||||||
../../../../src/char_str_indexer.h
|
|
||||||
../../../../src/char_str_indexer.c
|
|
||||||
../../../../src/crc64.h
|
|
||||||
../../../../src/crc64.c
|
|
||||||
../../../../src/dna_seq_indexer.h
|
|
||||||
../../../../src/dna_seq_indexer.c
|
|
||||||
../../../../src/encode.h
|
|
||||||
../../../../src/encode.c
|
|
||||||
../../../../src/hashtable.h
|
|
||||||
../../../../src/hashtable.c
|
|
||||||
../../../../src/murmurhash2.h
|
|
||||||
../../../../src/murmurhash2.c
|
|
||||||
../../../../src/obi_align.h
|
|
||||||
../../../../src/obi_align.c
|
|
||||||
../../../../src/obiavl.h
|
|
||||||
../../../../src/obiavl.c
|
|
||||||
../../../../src/obiblob_indexer.h
|
|
||||||
../../../../src/obiblob_indexer.c
|
|
||||||
../../../../src/obiblob.h
|
|
||||||
../../../../src/obiblob.c
|
|
||||||
../../../../src/obidebug.h
|
|
||||||
../../../../src/obidms_taxonomy.h
|
|
||||||
../../../../src/obidms_taxonomy.c
|
|
||||||
../../../../src/obidms.h
|
|
||||||
../../../../src/obidms.c
|
|
||||||
../../../../src/obidmscolumn_blob.c
|
|
||||||
../../../../src/obidmscolumn_blob.h
|
|
||||||
../../../../src/obidmscolumn_bool.c
|
|
||||||
../../../../src/obidmscolumn_bool.h
|
|
||||||
../../../../src/obidmscolumn_char.c
|
|
||||||
../../../../src/obidmscolumn_char.h
|
|
||||||
../../../../src/obidmscolumn_float.c
|
|
||||||
../../../../src/obidmscolumn_float.h
|
|
||||||
../../../../src/obidmscolumn_idx.h
|
|
||||||
../../../../src/obidmscolumn_idx.c
|
|
||||||
../../../../src/obidmscolumn_int.c
|
|
||||||
../../../../src/obidmscolumn_int.h
|
|
||||||
../../../../src/obidmscolumn_qual.h
|
|
||||||
../../../../src/obidmscolumn_qual.c
|
|
||||||
../../../../src/obidmscolumn_seq.c
|
|
||||||
../../../../src/obidmscolumn_seq.h
|
|
||||||
../../../../src/obidmscolumn_str.c
|
|
||||||
../../../../src/obidmscolumn_str.h
|
|
||||||
../../../../src/obidmscolumn.h
|
|
||||||
../../../../src/obidmscolumn.c
|
|
||||||
../../../../src/obidmscolumndir.h
|
|
||||||
../../../../src/obidmscolumndir.c
|
|
||||||
../../../../src/obierrno.h
|
|
||||||
../../../../src/obierrno.c
|
|
||||||
../../../../src/obilittlebigman.h
|
|
||||||
../../../../src/obilittlebigman.c
|
|
||||||
../../../../src/obitypes.h
|
|
||||||
../../../../src/obitypes.c
|
|
||||||
../../../../src/obiview.h
|
|
||||||
../../../../src/obiview.c
|
|
||||||
../../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../../src/uint8_indexer.h
|
|
||||||
../../../../src/uint8_indexer.c
|
|
||||||
../../../../src/upperband.h
|
|
||||||
../../../../src/upperband.c
|
|
||||||
../../../../src/utils.h
|
|
||||||
../../../../src/utils.c
|
|
@ -1,12 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .obitypes cimport const_char_p
|
|
||||||
|
|
||||||
cdef extern from "obidms.h" nogil:
|
|
||||||
struct OBIDMS_t:
|
|
||||||
const_char_p dms_name
|
|
||||||
|
|
||||||
ctypedef OBIDMS_t* OBIDMS_p
|
|
||||||
|
|
||||||
OBIDMS_p obi_dms(const_char_p dms_name)
|
|
||||||
int obi_close_dms(OBIDMS_p dms)
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../../src/bloom.h
|
|
||||||
../../../../src/bloom.c
|
|
||||||
../../../../src/char_str_indexer.h
|
|
||||||
../../../../src/char_str_indexer.c
|
|
||||||
../../../../src/crc64.h
|
|
||||||
../../../../src/crc64.c
|
|
||||||
../../../../src/dna_seq_indexer.h
|
|
||||||
../../../../src/dna_seq_indexer.c
|
|
||||||
../../../../src/encode.h
|
|
||||||
../../../../src/encode.c
|
|
||||||
../../../../src/hashtable.h
|
|
||||||
../../../../src/hashtable.c
|
|
||||||
../../../../src/murmurhash2.h
|
|
||||||
../../../../src/murmurhash2.c
|
|
||||||
../../../../src/obi_align.h
|
|
||||||
../../../../src/obi_align.c
|
|
||||||
../../../../src/obiavl.h
|
|
||||||
../../../../src/obiavl.c
|
|
||||||
../../../../src/obiblob_indexer.h
|
|
||||||
../../../../src/obiblob_indexer.c
|
|
||||||
../../../../src/obiblob.h
|
|
||||||
../../../../src/obiblob.c
|
|
||||||
../../../../src/obidebug.h
|
|
||||||
../../../../src/obidms_taxonomy.h
|
|
||||||
../../../../src/obidms_taxonomy.c
|
|
||||||
../../../../src/obidms.h
|
|
||||||
../../../../src/obidms.c
|
|
||||||
../../../../src/obidmscolumn_blob.c
|
|
||||||
../../../../src/obidmscolumn_blob.h
|
|
||||||
../../../../src/obidmscolumn_bool.c
|
|
||||||
../../../../src/obidmscolumn_bool.h
|
|
||||||
../../../../src/obidmscolumn_char.c
|
|
||||||
../../../../src/obidmscolumn_char.h
|
|
||||||
../../../../src/obidmscolumn_float.c
|
|
||||||
../../../../src/obidmscolumn_float.h
|
|
||||||
../../../../src/obidmscolumn_idx.h
|
|
||||||
../../../../src/obidmscolumn_idx.c
|
|
||||||
../../../../src/obidmscolumn_int.c
|
|
||||||
../../../../src/obidmscolumn_int.h
|
|
||||||
../../../../src/obidmscolumn_qual.h
|
|
||||||
../../../../src/obidmscolumn_qual.c
|
|
||||||
../../../../src/obidmscolumn_seq.c
|
|
||||||
../../../../src/obidmscolumn_seq.h
|
|
||||||
../../../../src/obidmscolumn_str.c
|
|
||||||
../../../../src/obidmscolumn_str.h
|
|
||||||
../../../../src/obidmscolumn.h
|
|
||||||
../../../../src/obidmscolumn.c
|
|
||||||
../../../../src/obidmscolumndir.h
|
|
||||||
../../../../src/obidmscolumndir.c
|
|
||||||
../../../../src/obierrno.h
|
|
||||||
../../../../src/obierrno.c
|
|
||||||
../../../../src/obilittlebigman.h
|
|
||||||
../../../../src/obilittlebigman.c
|
|
||||||
../../../../src/obitypes.h
|
|
||||||
../../../../src/obitypes.c
|
|
||||||
../../../../src/obiview.h
|
|
||||||
../../../../src/obiview.c
|
|
||||||
../../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../../src/uint8_indexer.h
|
|
||||||
../../../../src/uint8_indexer.c
|
|
||||||
../../../../src/upperband.h
|
|
||||||
../../../../src/upperband.c
|
|
||||||
../../../../src/utils.h
|
|
||||||
../../../../src/utils.c
|
|
@ -1,227 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from ..capi.obidms cimport OBIDMS_p
|
|
||||||
from ..capi.obitypes cimport const_char_p, \
|
|
||||||
OBIType_t, \
|
|
||||||
obiversion_t, \
|
|
||||||
obiint_t, \
|
|
||||||
obibool_t, \
|
|
||||||
obichar_t, \
|
|
||||||
obifloat_t, \
|
|
||||||
index_t, \
|
|
||||||
time_t
|
|
||||||
|
|
||||||
from libc.stdint cimport uint8_t
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "obidmscolumn.h" nogil:
|
|
||||||
|
|
||||||
struct Column_reference_t :
|
|
||||||
const_char_p column_name
|
|
||||||
obiversion_t version
|
|
||||||
|
|
||||||
ctypedef Column_reference_t* Column_reference_p
|
|
||||||
|
|
||||||
struct OBIDMS_column_header_t:
|
|
||||||
size_t header_size
|
|
||||||
size_t data_size
|
|
||||||
index_t line_count
|
|
||||||
index_t lines_used
|
|
||||||
index_t nb_elements_per_line
|
|
||||||
const_char_p elements_names
|
|
||||||
OBIType_t returned_data_type
|
|
||||||
OBIType_t stored_data_type
|
|
||||||
time_t creation_date
|
|
||||||
obiversion_t version
|
|
||||||
obiversion_t cloned_from
|
|
||||||
const_char_p name
|
|
||||||
const_char_p indexer_name
|
|
||||||
Column_reference_t associated_column
|
|
||||||
const_char_p comments
|
|
||||||
|
|
||||||
ctypedef OBIDMS_column_header_t* OBIDMS_column_header_p
|
|
||||||
|
|
||||||
struct OBIDMS_column_t:
|
|
||||||
OBIDMS_p dms
|
|
||||||
OBIDMS_column_header_p header
|
|
||||||
bint writable
|
|
||||||
|
|
||||||
ctypedef OBIDMS_column_t* OBIDMS_column_p
|
|
||||||
|
|
||||||
int obi_close_column(OBIDMS_column_p column)
|
|
||||||
|
|
||||||
obiversion_t obi_column_get_latest_version_from_name(OBIDMS_p dms,
|
|
||||||
const_char_p column_name)
|
|
||||||
|
|
||||||
OBIDMS_column_header_p obi_column_get_header_from_name(OBIDMS_p dms,
|
|
||||||
const_char_p column_name,
|
|
||||||
obiversion_t version_number)
|
|
||||||
|
|
||||||
int obi_close_header(OBIDMS_column_header_p header)
|
|
||||||
|
|
||||||
char* obi_get_elements_names(OBIDMS_column_p column)
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "obidmscolumn_int.h" nogil:
|
|
||||||
|
|
||||||
int obi_column_set_obiint_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
obiint_t value)
|
|
||||||
|
|
||||||
int obi_column_set_obiint_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
obiint_t value)
|
|
||||||
|
|
||||||
obiint_t obi_column_get_obiint_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
obiint_t obi_column_get_obiint_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
cdef extern from "obidmscolumn_bool.h" nogil:
|
|
||||||
|
|
||||||
int obi_column_set_obibool_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
obibool_t value)
|
|
||||||
|
|
||||||
int obi_column_set_obibool_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
obibool_t value)
|
|
||||||
|
|
||||||
obibool_t obi_column_get_obibool_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
obibool_t obi_column_get_obibool_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
cdef extern from "obidmscolumn_char.h" nogil:
|
|
||||||
|
|
||||||
int obi_column_set_obichar_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
obichar_t value)
|
|
||||||
|
|
||||||
int obi_column_set_obichar_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
obichar_t value)
|
|
||||||
|
|
||||||
obichar_t obi_column_get_obichar_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
obichar_t obi_column_get_obichar_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
cdef extern from "obidmscolumn_float.h" nogil:
|
|
||||||
|
|
||||||
int obi_column_set_obifloat_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
obifloat_t value)
|
|
||||||
|
|
||||||
int obi_column_set_obifloat_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
obifloat_t value)
|
|
||||||
|
|
||||||
obifloat_t obi_column_get_obifloat_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
obifloat_t obi_column_get_obifloat_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
cdef extern from "obidmscolumn_str.h" nogil:
|
|
||||||
|
|
||||||
int obi_column_set_obistr_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
int obi_column_set_obistr_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
const_char_p obi_column_get_obistr_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
const_char_p obi_column_get_obistr_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
cdef extern from "obidmscolumn_seq.h" nogil:
|
|
||||||
|
|
||||||
int obi_column_set_obiseq_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
int obi_column_set_obiseq_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
char* obi_column_get_obiseq_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
char* obi_column_get_obiseq_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "obidmscolumn_qual.h" nogil:
|
|
||||||
|
|
||||||
int obi_column_set_obiqual_char_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
int obi_column_set_obiqual_char_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
int obi_column_set_obiqual_int_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
const uint8_t* value,
|
|
||||||
int value_length)
|
|
||||||
|
|
||||||
int obi_column_set_obiqual_int_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
const uint8_t* value,
|
|
||||||
int value_length)
|
|
||||||
|
|
||||||
char* obi_column_get_obiqual_char_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
char* obi_column_get_obiqual_char_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
const uint8_t* obi_column_get_obiqual_int_with_elt_name(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
int* value_length)
|
|
||||||
|
|
||||||
const uint8_t* obi_column_get_obiqual_int_with_elt_idx(OBIDMS_column_p column,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
int* value_length)
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../../src/bloom.h
|
|
||||||
../../../../src/bloom.c
|
|
||||||
../../../../src/char_str_indexer.h
|
|
||||||
../../../../src/char_str_indexer.c
|
|
||||||
../../../../src/crc64.h
|
|
||||||
../../../../src/crc64.c
|
|
||||||
../../../../src/dna_seq_indexer.h
|
|
||||||
../../../../src/dna_seq_indexer.c
|
|
||||||
../../../../src/encode.h
|
|
||||||
../../../../src/encode.c
|
|
||||||
../../../../src/hashtable.h
|
|
||||||
../../../../src/hashtable.c
|
|
||||||
../../../../src/murmurhash2.h
|
|
||||||
../../../../src/murmurhash2.c
|
|
||||||
../../../../src/obi_align.h
|
|
||||||
../../../../src/obi_align.c
|
|
||||||
../../../../src/obiavl.h
|
|
||||||
../../../../src/obiavl.c
|
|
||||||
../../../../src/obiblob_indexer.h
|
|
||||||
../../../../src/obiblob_indexer.c
|
|
||||||
../../../../src/obiblob.h
|
|
||||||
../../../../src/obiblob.c
|
|
||||||
../../../../src/obidebug.h
|
|
||||||
../../../../src/obidms_taxonomy.h
|
|
||||||
../../../../src/obidms_taxonomy.c
|
|
||||||
../../../../src/obidms.h
|
|
||||||
../../../../src/obidms.c
|
|
||||||
../../../../src/obidmscolumn_blob.c
|
|
||||||
../../../../src/obidmscolumn_blob.h
|
|
||||||
../../../../src/obidmscolumn_bool.c
|
|
||||||
../../../../src/obidmscolumn_bool.h
|
|
||||||
../../../../src/obidmscolumn_char.c
|
|
||||||
../../../../src/obidmscolumn_char.h
|
|
||||||
../../../../src/obidmscolumn_float.c
|
|
||||||
../../../../src/obidmscolumn_float.h
|
|
||||||
../../../../src/obidmscolumn_idx.h
|
|
||||||
../../../../src/obidmscolumn_idx.c
|
|
||||||
../../../../src/obidmscolumn_int.c
|
|
||||||
../../../../src/obidmscolumn_int.h
|
|
||||||
../../../../src/obidmscolumn_qual.h
|
|
||||||
../../../../src/obidmscolumn_qual.c
|
|
||||||
../../../../src/obidmscolumn_seq.c
|
|
||||||
../../../../src/obidmscolumn_seq.h
|
|
||||||
../../../../src/obidmscolumn_str.c
|
|
||||||
../../../../src/obidmscolumn_str.h
|
|
||||||
../../../../src/obidmscolumn.h
|
|
||||||
../../../../src/obidmscolumn.c
|
|
||||||
../../../../src/obidmscolumndir.h
|
|
||||||
../../../../src/obidmscolumndir.c
|
|
||||||
../../../../src/obierrno.h
|
|
||||||
../../../../src/obierrno.c
|
|
||||||
../../../../src/obilittlebigman.h
|
|
||||||
../../../../src/obilittlebigman.c
|
|
||||||
../../../../src/obitypes.h
|
|
||||||
../../../../src/obitypes.c
|
|
||||||
../../../../src/obiview.h
|
|
||||||
../../../../src/obiview.c
|
|
||||||
../../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../../src/uint8_indexer.h
|
|
||||||
../../../../src/uint8_indexer.c
|
|
||||||
../../../../src/upperband.h
|
|
||||||
../../../../src/upperband.c
|
|
||||||
../../../../src/utils.h
|
|
||||||
../../../../src/utils.c
|
|
@ -1,5 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "obierrno.h" nogil:
|
|
||||||
extern int obi_errno
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../../src/bloom.h
|
|
||||||
../../../../src/bloom.c
|
|
||||||
../../../../src/char_str_indexer.h
|
|
||||||
../../../../src/char_str_indexer.c
|
|
||||||
../../../../src/crc64.h
|
|
||||||
../../../../src/crc64.c
|
|
||||||
../../../../src/dna_seq_indexer.h
|
|
||||||
../../../../src/dna_seq_indexer.c
|
|
||||||
../../../../src/encode.h
|
|
||||||
../../../../src/encode.c
|
|
||||||
../../../../src/hashtable.h
|
|
||||||
../../../../src/hashtable.c
|
|
||||||
../../../../src/murmurhash2.h
|
|
||||||
../../../../src/murmurhash2.c
|
|
||||||
../../../../src/obi_align.h
|
|
||||||
../../../../src/obi_align.c
|
|
||||||
../../../../src/obiavl.h
|
|
||||||
../../../../src/obiavl.c
|
|
||||||
../../../../src/obiblob_indexer.h
|
|
||||||
../../../../src/obiblob_indexer.c
|
|
||||||
../../../../src/obiblob.h
|
|
||||||
../../../../src/obiblob.c
|
|
||||||
../../../../src/obidebug.h
|
|
||||||
../../../../src/obidms_taxonomy.h
|
|
||||||
../../../../src/obidms_taxonomy.c
|
|
||||||
../../../../src/obidms.h
|
|
||||||
../../../../src/obidms.c
|
|
||||||
../../../../src/obidmscolumn_blob.c
|
|
||||||
../../../../src/obidmscolumn_blob.h
|
|
||||||
../../../../src/obidmscolumn_bool.c
|
|
||||||
../../../../src/obidmscolumn_bool.h
|
|
||||||
../../../../src/obidmscolumn_char.c
|
|
||||||
../../../../src/obidmscolumn_char.h
|
|
||||||
../../../../src/obidmscolumn_float.c
|
|
||||||
../../../../src/obidmscolumn_float.h
|
|
||||||
../../../../src/obidmscolumn_idx.h
|
|
||||||
../../../../src/obidmscolumn_idx.c
|
|
||||||
../../../../src/obidmscolumn_int.c
|
|
||||||
../../../../src/obidmscolumn_int.h
|
|
||||||
../../../../src/obidmscolumn_qual.h
|
|
||||||
../../../../src/obidmscolumn_qual.c
|
|
||||||
../../../../src/obidmscolumn_seq.c
|
|
||||||
../../../../src/obidmscolumn_seq.h
|
|
||||||
../../../../src/obidmscolumn_str.c
|
|
||||||
../../../../src/obidmscolumn_str.h
|
|
||||||
../../../../src/obidmscolumn.h
|
|
||||||
../../../../src/obidmscolumn.c
|
|
||||||
../../../../src/obidmscolumndir.h
|
|
||||||
../../../../src/obidmscolumndir.c
|
|
||||||
../../../../src/obierrno.h
|
|
||||||
../../../../src/obierrno.c
|
|
||||||
../../../../src/obilittlebigman.h
|
|
||||||
../../../../src/obilittlebigman.c
|
|
||||||
../../../../src/obitypes.h
|
|
||||||
../../../../src/obitypes.c
|
|
||||||
../../../../src/obiview.h
|
|
||||||
../../../../src/obiview.c
|
|
||||||
../../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../../src/uint8_indexer.h
|
|
||||||
../../../../src/uint8_indexer.c
|
|
||||||
../../../../src/upperband.h
|
|
||||||
../../../../src/upperband.c
|
|
||||||
../../../../src/utils.h
|
|
||||||
../../../../src/utils.c
|
|
@ -1,65 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .obitypes cimport const_char_p
|
|
||||||
from .obidms cimport OBIDMS_p
|
|
||||||
from libc.stdint cimport int32_t
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "obidms_taxonomy.h" nogil:
|
|
||||||
|
|
||||||
struct ecotxnode :
|
|
||||||
int32_t taxid
|
|
||||||
int32_t rank
|
|
||||||
int32_t farest
|
|
||||||
ecotxnode* parent
|
|
||||||
char* name
|
|
||||||
char* preferred_name
|
|
||||||
|
|
||||||
ctypedef ecotxnode ecotx_t
|
|
||||||
|
|
||||||
|
|
||||||
struct ecotxidx_t :
|
|
||||||
int32_t count
|
|
||||||
int32_t max_taxid
|
|
||||||
int32_t buffer_size
|
|
||||||
ecotx_t* taxon
|
|
||||||
|
|
||||||
|
|
||||||
struct OBIDMS_taxonomy_t :
|
|
||||||
# ecorankidx_t* ranks
|
|
||||||
# econameidx_t* names
|
|
||||||
ecotxidx_t* taxa
|
|
||||||
|
|
||||||
ctypedef OBIDMS_taxonomy_t* OBIDMS_taxonomy_p
|
|
||||||
|
|
||||||
|
|
||||||
OBIDMS_taxonomy_p obi_read_taxonomy(OBIDMS_p dms, const_char_p taxonomy_name, bint read_alternative_names)
|
|
||||||
|
|
||||||
OBIDMS_taxonomy_p obi_read_taxdump(const_char_p taxdump)
|
|
||||||
|
|
||||||
int obi_write_taxonomy(OBIDMS_p dms, OBIDMS_taxonomy_p tax, const_char_p tax_name)
|
|
||||||
|
|
||||||
int obi_close_taxonomy(OBIDMS_taxonomy_p taxonomy)
|
|
||||||
|
|
||||||
ecotx_t* obi_taxo_get_parent_at_rank(ecotx_t* taxon, int32_t rankidx)
|
|
||||||
|
|
||||||
ecotx_t* obi_taxo_get_taxon_with_taxid(OBIDMS_taxonomy_p taxonomy, int32_t taxid)
|
|
||||||
|
|
||||||
bint obi_taxo_is_taxon_under_taxid(ecotx_t* taxon, int32_t other_taxid)
|
|
||||||
|
|
||||||
ecotx_t* obi_taxo_get_species(ecotx_t* taxon, OBIDMS_taxonomy_p taxonomy)
|
|
||||||
|
|
||||||
ecotx_t* obi_taxo_get_genus(ecotx_t* taxon, OBIDMS_taxonomy_p taxonomy)
|
|
||||||
|
|
||||||
ecotx_t* obi_taxo_get_family(ecotx_t* taxon, OBIDMS_taxonomy_p taxonomy)
|
|
||||||
|
|
||||||
ecotx_t* obi_taxo_get_kingdom(ecotx_t* taxon, OBIDMS_taxonomy_p taxonomy)
|
|
||||||
|
|
||||||
ecotx_t* obi_taxo_get_superkingdom(ecotx_t* taxon, OBIDMS_taxonomy_p taxonomy)
|
|
||||||
|
|
||||||
int obi_taxo_add_local_taxon(OBIDMS_taxonomy_p tax, const char* name, const char* rank_name, int32_t parent_taxid, int32_t min_taxid)
|
|
||||||
|
|
||||||
int obi_taxo_add_preferred_name_with_taxid(OBIDMS_taxonomy_p tax, int32_t taxid, const char* preferred_name)
|
|
||||||
|
|
||||||
int obi_taxo_add_preferred_name_with_taxon(OBIDMS_taxonomy_p tax, ecotx_t* taxon, const char* preferred_name)
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../../src/bloom.h
|
|
||||||
../../../../src/bloom.c
|
|
||||||
../../../../src/char_str_indexer.h
|
|
||||||
../../../../src/char_str_indexer.c
|
|
||||||
../../../../src/crc64.h
|
|
||||||
../../../../src/crc64.c
|
|
||||||
../../../../src/dna_seq_indexer.h
|
|
||||||
../../../../src/dna_seq_indexer.c
|
|
||||||
../../../../src/encode.h
|
|
||||||
../../../../src/encode.c
|
|
||||||
../../../../src/hashtable.h
|
|
||||||
../../../../src/hashtable.c
|
|
||||||
../../../../src/murmurhash2.h
|
|
||||||
../../../../src/murmurhash2.c
|
|
||||||
../../../../src/obi_align.h
|
|
||||||
../../../../src/obi_align.c
|
|
||||||
../../../../src/obiavl.h
|
|
||||||
../../../../src/obiavl.c
|
|
||||||
../../../../src/obiblob_indexer.h
|
|
||||||
../../../../src/obiblob_indexer.c
|
|
||||||
../../../../src/obiblob.h
|
|
||||||
../../../../src/obiblob.c
|
|
||||||
../../../../src/obidebug.h
|
|
||||||
../../../../src/obidms_taxonomy.h
|
|
||||||
../../../../src/obidms_taxonomy.c
|
|
||||||
../../../../src/obidms.h
|
|
||||||
../../../../src/obidms.c
|
|
||||||
../../../../src/obidmscolumn_blob.c
|
|
||||||
../../../../src/obidmscolumn_blob.h
|
|
||||||
../../../../src/obidmscolumn_bool.c
|
|
||||||
../../../../src/obidmscolumn_bool.h
|
|
||||||
../../../../src/obidmscolumn_char.c
|
|
||||||
../../../../src/obidmscolumn_char.h
|
|
||||||
../../../../src/obidmscolumn_float.c
|
|
||||||
../../../../src/obidmscolumn_float.h
|
|
||||||
../../../../src/obidmscolumn_idx.h
|
|
||||||
../../../../src/obidmscolumn_idx.c
|
|
||||||
../../../../src/obidmscolumn_int.c
|
|
||||||
../../../../src/obidmscolumn_int.h
|
|
||||||
../../../../src/obidmscolumn_qual.h
|
|
||||||
../../../../src/obidmscolumn_qual.c
|
|
||||||
../../../../src/obidmscolumn_seq.c
|
|
||||||
../../../../src/obidmscolumn_seq.h
|
|
||||||
../../../../src/obidmscolumn_str.c
|
|
||||||
../../../../src/obidmscolumn_str.h
|
|
||||||
../../../../src/obidmscolumn.h
|
|
||||||
../../../../src/obidmscolumn.c
|
|
||||||
../../../../src/obidmscolumndir.h
|
|
||||||
../../../../src/obidmscolumndir.c
|
|
||||||
../../../../src/obierrno.h
|
|
||||||
../../../../src/obierrno.c
|
|
||||||
../../../../src/obilittlebigman.h
|
|
||||||
../../../../src/obilittlebigman.c
|
|
||||||
../../../../src/obitypes.h
|
|
||||||
../../../../src/obitypes.c
|
|
||||||
../../../../src/obiview.h
|
|
||||||
../../../../src/obiview.c
|
|
||||||
../../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../../src/uint8_indexer.h
|
|
||||||
../../../../src/uint8_indexer.c
|
|
||||||
../../../../src/upperband.h
|
|
||||||
../../../../src/upperband.c
|
|
||||||
../../../../src/utils.h
|
|
||||||
../../../../src/utils.c
|
|
@ -1,55 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
|
|
||||||
from libc.stdint cimport int32_t, int64_t, uint8_t
|
|
||||||
|
|
||||||
from posix.types cimport time_t
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from *:
|
|
||||||
ctypedef char* const_char_p "const char*"
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "encode.h" nogil:
|
|
||||||
bint only_ATGC(const_char_p seq)
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "obitypes.h" nogil:
|
|
||||||
|
|
||||||
enum OBIType:
|
|
||||||
OBI_VOID,
|
|
||||||
OBI_INT,
|
|
||||||
OBI_FLOAT,
|
|
||||||
OBI_BOOL,
|
|
||||||
OBI_CHAR,
|
|
||||||
OBI_QUAL,
|
|
||||||
OBI_STR,
|
|
||||||
OBI_SEQ,
|
|
||||||
OBI_IDX
|
|
||||||
|
|
||||||
|
|
||||||
ctypedef OBIType OBIType_t
|
|
||||||
|
|
||||||
enum OBIBool:
|
|
||||||
pass
|
|
||||||
|
|
||||||
ctypedef OBIBool obibool_t
|
|
||||||
ctypedef int32_t obiint_t
|
|
||||||
ctypedef double obifloat_t
|
|
||||||
ctypedef char obichar_t
|
|
||||||
ctypedef int64_t index_t
|
|
||||||
|
|
||||||
ctypedef int32_t obiversion_t
|
|
||||||
|
|
||||||
extern obiint_t OBIInt_NA
|
|
||||||
extern index_t OBIIdx_NA
|
|
||||||
extern obifloat_t OBIFloat_NA
|
|
||||||
extern obichar_t OBIChar_NA
|
|
||||||
extern obibool_t OBIBool_NA
|
|
||||||
extern const_char_p OBISeq_NA
|
|
||||||
extern const_char_p OBIStr_NA
|
|
||||||
extern const_char_p OBIQual_char_NA
|
|
||||||
extern uint8_t* OBIQual_int_NA
|
|
||||||
|
|
||||||
const_char_p name_data_type(int data_type)
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../../src/bloom.h
|
|
||||||
../../../../src/bloom.c
|
|
||||||
../../../../src/char_str_indexer.h
|
|
||||||
../../../../src/char_str_indexer.c
|
|
||||||
../../../../src/crc64.h
|
|
||||||
../../../../src/crc64.c
|
|
||||||
../../../../src/dna_seq_indexer.h
|
|
||||||
../../../../src/dna_seq_indexer.c
|
|
||||||
../../../../src/encode.h
|
|
||||||
../../../../src/encode.c
|
|
||||||
../../../../src/hashtable.h
|
|
||||||
../../../../src/hashtable.c
|
|
||||||
../../../../src/murmurhash2.h
|
|
||||||
../../../../src/murmurhash2.c
|
|
||||||
../../../../src/obi_align.h
|
|
||||||
../../../../src/obi_align.c
|
|
||||||
../../../../src/obiavl.h
|
|
||||||
../../../../src/obiavl.c
|
|
||||||
../../../../src/obiblob_indexer.h
|
|
||||||
../../../../src/obiblob_indexer.c
|
|
||||||
../../../../src/obiblob.h
|
|
||||||
../../../../src/obiblob.c
|
|
||||||
../../../../src/obidebug.h
|
|
||||||
../../../../src/obidms_taxonomy.h
|
|
||||||
../../../../src/obidms_taxonomy.c
|
|
||||||
../../../../src/obidms.h
|
|
||||||
../../../../src/obidms.c
|
|
||||||
../../../../src/obidmscolumn_blob.c
|
|
||||||
../../../../src/obidmscolumn_blob.h
|
|
||||||
../../../../src/obidmscolumn_bool.c
|
|
||||||
../../../../src/obidmscolumn_bool.h
|
|
||||||
../../../../src/obidmscolumn_char.c
|
|
||||||
../../../../src/obidmscolumn_char.h
|
|
||||||
../../../../src/obidmscolumn_float.c
|
|
||||||
../../../../src/obidmscolumn_float.h
|
|
||||||
../../../../src/obidmscolumn_idx.h
|
|
||||||
../../../../src/obidmscolumn_idx.c
|
|
||||||
../../../../src/obidmscolumn_int.c
|
|
||||||
../../../../src/obidmscolumn_int.h
|
|
||||||
../../../../src/obidmscolumn_qual.h
|
|
||||||
../../../../src/obidmscolumn_qual.c
|
|
||||||
../../../../src/obidmscolumn_seq.c
|
|
||||||
../../../../src/obidmscolumn_seq.h
|
|
||||||
../../../../src/obidmscolumn_str.c
|
|
||||||
../../../../src/obidmscolumn_str.h
|
|
||||||
../../../../src/obidmscolumn.h
|
|
||||||
../../../../src/obidmscolumn.c
|
|
||||||
../../../../src/obidmscolumndir.h
|
|
||||||
../../../../src/obidmscolumndir.c
|
|
||||||
../../../../src/obierrno.h
|
|
||||||
../../../../src/obierrno.c
|
|
||||||
../../../../src/obilittlebigman.h
|
|
||||||
../../../../src/obilittlebigman.c
|
|
||||||
../../../../src/obitypes.h
|
|
||||||
../../../../src/obitypes.c
|
|
||||||
../../../../src/obiview.h
|
|
||||||
../../../../src/obiview.c
|
|
||||||
../../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../../src/uint8_indexer.h
|
|
||||||
../../../../src/uint8_indexer.c
|
|
||||||
../../../../src/upperband.h
|
|
||||||
../../../../src/upperband.c
|
|
||||||
../../../../src/utils.h
|
|
||||||
../../../../src/utils.c
|
|
@ -1,12 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
|
|
||||||
from posix.types cimport time_t
|
|
||||||
|
|
||||||
from ..capi.obitypes cimport const_char_p
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "utils.h" nogil:
|
|
||||||
|
|
||||||
const_char_p obi_format_date(time_t date)
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
../../../../src/bloom.h
|
|
||||||
../../../../src/bloom.c
|
|
||||||
../../../../src/char_str_indexer.h
|
|
||||||
../../../../src/char_str_indexer.c
|
|
||||||
../../../../src/crc64.h
|
|
||||||
../../../../src/crc64.c
|
|
||||||
../../../../src/dna_seq_indexer.h
|
|
||||||
../../../../src/dna_seq_indexer.c
|
|
||||||
../../../../src/encode.h
|
|
||||||
../../../../src/encode.c
|
|
||||||
../../../../src/hashtable.h
|
|
||||||
../../../../src/hashtable.c
|
|
||||||
../../../../src/murmurhash2.h
|
|
||||||
../../../../src/murmurhash2.c
|
|
||||||
../../../../src/obi_align.h
|
|
||||||
../../../../src/obi_align.c
|
|
||||||
../../../../src/obiavl.h
|
|
||||||
../../../../src/obiavl.c
|
|
||||||
../../../../src/obiblob_indexer.h
|
|
||||||
../../../../src/obiblob_indexer.c
|
|
||||||
../../../../src/obiblob.h
|
|
||||||
../../../../src/obiblob.c
|
|
||||||
../../../../src/obidebug.h
|
|
||||||
../../../../src/obidms_taxonomy.h
|
|
||||||
../../../../src/obidms_taxonomy.c
|
|
||||||
../../../../src/obidms.h
|
|
||||||
../../../../src/obidms.c
|
|
||||||
../../../../src/obidmscolumn_blob.c
|
|
||||||
../../../../src/obidmscolumn_blob.h
|
|
||||||
../../../../src/obidmscolumn_bool.c
|
|
||||||
../../../../src/obidmscolumn_bool.h
|
|
||||||
../../../../src/obidmscolumn_char.c
|
|
||||||
../../../../src/obidmscolumn_char.h
|
|
||||||
../../../../src/obidmscolumn_float.c
|
|
||||||
../../../../src/obidmscolumn_float.h
|
|
||||||
../../../../src/obidmscolumn_idx.h
|
|
||||||
../../../../src/obidmscolumn_idx.c
|
|
||||||
../../../../src/obidmscolumn_int.c
|
|
||||||
../../../../src/obidmscolumn_int.h
|
|
||||||
../../../../src/obidmscolumn_qual.h
|
|
||||||
../../../../src/obidmscolumn_qual.c
|
|
||||||
../../../../src/obidmscolumn_seq.c
|
|
||||||
../../../../src/obidmscolumn_seq.h
|
|
||||||
../../../../src/obidmscolumn_str.c
|
|
||||||
../../../../src/obidmscolumn_str.h
|
|
||||||
../../../../src/obidmscolumn.h
|
|
||||||
../../../../src/obidmscolumn.c
|
|
||||||
../../../../src/obidmscolumndir.h
|
|
||||||
../../../../src/obidmscolumndir.c
|
|
||||||
../../../../src/obierrno.h
|
|
||||||
../../../../src/obierrno.c
|
|
||||||
../../../../src/obilittlebigman.h
|
|
||||||
../../../../src/obilittlebigman.c
|
|
||||||
../../../../src/obitypes.h
|
|
||||||
../../../../src/obitypes.c
|
|
||||||
../../../../src/obiview.h
|
|
||||||
../../../../src/obiview.c
|
|
||||||
../../../../src/sse_banded_LCS_alignment.h
|
|
||||||
../../../../src/sse_banded_LCS_alignment.c
|
|
||||||
../../../../src/uint8_indexer.h
|
|
||||||
../../../../src/uint8_indexer.c
|
|
||||||
../../../../src/upperband.h
|
|
||||||
../../../../src/upperband.c
|
|
||||||
../../../../src/utils.h
|
|
||||||
../../../../src/utils.c
|
|
@ -1,294 +0,0 @@
|
|||||||
#cython: language_level=3
|
|
||||||
|
|
||||||
from .obitypes cimport const_char_p, \
|
|
||||||
OBIType_t, \
|
|
||||||
obiversion_t, \
|
|
||||||
obiint_t, \
|
|
||||||
obibool_t, \
|
|
||||||
obichar_t, \
|
|
||||||
obifloat_t, \
|
|
||||||
index_t, \
|
|
||||||
time_t
|
|
||||||
from ..capi.obidms cimport OBIDMS_p
|
|
||||||
from ..capi.obidmscolumn cimport OBIDMS_column_p, \
|
|
||||||
Column_reference_t, \
|
|
||||||
Column_reference_p
|
|
||||||
|
|
||||||
from libc.stdint cimport uint8_t
|
|
||||||
|
|
||||||
|
|
||||||
cdef extern from "obiview.h" nogil:
|
|
||||||
|
|
||||||
extern const_char_p VIEW_TYPE_NUC_SEQS
|
|
||||||
extern const_char_p NUC_SEQUENCE_COLUMN
|
|
||||||
extern const_char_p ID_COLUMN
|
|
||||||
extern const_char_p DEFINITION_COLUMN
|
|
||||||
extern const_char_p QUALITY_COLUMN
|
|
||||||
|
|
||||||
|
|
||||||
struct Alias_column_pair_t :
|
|
||||||
Column_reference_t column_refs
|
|
||||||
const_char_p alias
|
|
||||||
|
|
||||||
ctypedef Alias_column_pair_t* Alias_column_pair_p
|
|
||||||
|
|
||||||
|
|
||||||
struct Obiview_infos_t :
|
|
||||||
time_t creation_date
|
|
||||||
const_char_p name
|
|
||||||
const_char_p created_from
|
|
||||||
const_char_p view_type
|
|
||||||
bint all_lines
|
|
||||||
Column_reference_t line_selection
|
|
||||||
index_t line_count
|
|
||||||
int column_count
|
|
||||||
Alias_column_pair_p column_references
|
|
||||||
const_char_p comments
|
|
||||||
|
|
||||||
ctypedef Obiview_infos_t* Obiview_infos_p
|
|
||||||
|
|
||||||
|
|
||||||
struct Obiview_t :
|
|
||||||
Obiview_infos_p infos
|
|
||||||
OBIDMS_p dms
|
|
||||||
bint read_only
|
|
||||||
OBIDMS_column_p line_selection
|
|
||||||
OBIDMS_column_p columns
|
|
||||||
int nb_predicates
|
|
||||||
# TODO declarations for column dictionary and predicate function array?
|
|
||||||
|
|
||||||
ctypedef Obiview_t* Obiview_p
|
|
||||||
|
|
||||||
|
|
||||||
Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const_char_p view_name, Obiview_p view_to_clone, index_t* line_selection, const_char_p comments, bint quality_column)
|
|
||||||
|
|
||||||
Obiview_p obi_new_view(OBIDMS_p dms, const_char_p view_name, Obiview_p view_to_clone, index_t* line_selection, const_char_p comments)
|
|
||||||
|
|
||||||
Obiview_p obi_new_view_cloned_from_name(OBIDMS_p dms, const_char_p view_name, const_char_p view_to_clone_name, index_t* line_selection, const_char_p comments)
|
|
||||||
|
|
||||||
Obiview_p obi_new_view_nuc_seqs_cloned_from_name(OBIDMS_p dms, const_char_p view_name, const_char_p view_to_clone_name, index_t* line_selection, const_char_p comments, bint quality_column)
|
|
||||||
|
|
||||||
Obiview_infos_p obi_view_map_file(OBIDMS_p dms, const char* view_name, bint finished)
|
|
||||||
|
|
||||||
int obi_view_unmap_file(OBIDMS_p dms, Obiview_infos_p view_infos)
|
|
||||||
|
|
||||||
Obiview_p obi_open_view(OBIDMS_p dms, const_char_p view_name)
|
|
||||||
|
|
||||||
int obi_view_add_column(Obiview_p view,
|
|
||||||
const_char_p column_name,
|
|
||||||
obiversion_t version_number,
|
|
||||||
const_char_p alias,
|
|
||||||
OBIType_t data_type,
|
|
||||||
index_t nb_lines,
|
|
||||||
index_t nb_elements_per_line,
|
|
||||||
char* elements_names,
|
|
||||||
const_char_p indexer_name,
|
|
||||||
const_char_p associated_column_name,
|
|
||||||
obiversion_t associated_column_version,
|
|
||||||
const_char_p comments,
|
|
||||||
bint create)
|
|
||||||
|
|
||||||
int obi_view_delete_column(Obiview_p view, const_char_p column_name)
|
|
||||||
|
|
||||||
OBIDMS_column_p obi_view_get_column(Obiview_p view, const_char_p column_name)
|
|
||||||
|
|
||||||
OBIDMS_column_p* obi_view_get_pointer_on_column_in_view(Obiview_p view, const_char_p column_name)
|
|
||||||
|
|
||||||
int obi_view_create_column_alias(Obiview_p view, const_char_p current_name, const_char_p alias)
|
|
||||||
|
|
||||||
int obi_save_and_close_view(Obiview_p view)
|
|
||||||
|
|
||||||
|
|
||||||
# OBI_INT
|
|
||||||
int obi_set_int_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
obiint_t value)
|
|
||||||
|
|
||||||
int obi_set_int_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
obiint_t value)
|
|
||||||
|
|
||||||
obiint_t obi_get_int_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
obiint_t obi_get_int_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
|
|
||||||
# OBI_BOOL
|
|
||||||
int obi_set_bool_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
obibool_t value)
|
|
||||||
|
|
||||||
int obi_set_bool_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
obibool_t value)
|
|
||||||
|
|
||||||
obibool_t obi_get_bool_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
obibool_t obi_get_bool_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
|
|
||||||
# OBI_CHAR
|
|
||||||
int obi_set_char_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
obichar_t value)
|
|
||||||
|
|
||||||
int obi_set_char_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
obichar_t value)
|
|
||||||
|
|
||||||
obichar_t obi_get_char_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
obichar_t obi_get_char_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
|
|
||||||
# OBI_FLOAT
|
|
||||||
int obi_set_float_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
obifloat_t value)
|
|
||||||
|
|
||||||
int obi_set_float_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
obifloat_t value)
|
|
||||||
|
|
||||||
obifloat_t obi_get_float_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
obifloat_t obi_get_float_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
|
|
||||||
# OBI_QUAL
|
|
||||||
int obi_set_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
const char* value)
|
|
||||||
|
|
||||||
int obi_set_qual_int_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
const uint8_t* value,
|
|
||||||
int value_length)
|
|
||||||
|
|
||||||
char* obi_get_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
const uint8_t* obi_get_qual_int_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
int* value_length)
|
|
||||||
|
|
||||||
int obi_set_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const char* element_name,
|
|
||||||
const char* value)
|
|
||||||
|
|
||||||
int obi_set_qual_int_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const char* element_name,
|
|
||||||
const uint8_t* value,
|
|
||||||
int value_length)
|
|
||||||
|
|
||||||
char* obi_get_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const char* element_name)
|
|
||||||
|
|
||||||
const uint8_t* obi_get_qual_int_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const char* element_name,
|
|
||||||
int* value_length)
|
|
||||||
|
|
||||||
|
|
||||||
# OBI_STR
|
|
||||||
int obi_set_str_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
int obi_set_str_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
const_char_p obi_get_str_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
const_char_p obi_get_str_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
||||||
|
|
||||||
# OBI_SEQ
|
|
||||||
int obi_set_seq_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
int obi_set_seq_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx,
|
|
||||||
const_char_p value)
|
|
||||||
|
|
||||||
char* obi_get_seq_with_elt_name_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
const_char_p element_name)
|
|
||||||
|
|
||||||
char* obi_get_seq_with_elt_idx_and_col_p_in_view(Obiview_p view,
|
|
||||||
OBIDMS_column_p column_p,
|
|
||||||
index_t line_nb,
|
|
||||||
index_t element_idx)
|
|
||||||
|
|
Reference in New Issue
Block a user