Added possibility to specify the offset for encoding and decoding
sequence quality character strings
This commit is contained in:
@ -3,24 +3,24 @@
|
||||
|
||||
from ...capi.obitypes cimport index_t
|
||||
|
||||
from ..column cimport Column, \
|
||||
Column_multi_elts
|
||||
from ..column_idx cimport Column_idx, \
|
||||
Column_multi_elts_idx
|
||||
|
||||
|
||||
cdef class Column_qual(Column) :
|
||||
cdef class Column_qual(Column_idx) :
|
||||
|
||||
cpdef object get_line(self, index_t line_nb)
|
||||
cpdef object get_str_line(self, index_t line_nb)
|
||||
cpdef object get_str_line(self, index_t line_nb, int offset=*)
|
||||
cpdef set_line(self, index_t line_nb, object value)
|
||||
cpdef set_str_line(self, index_t line_nb, object value)
|
||||
cpdef set_str_line(self, index_t line_nb, object value, int offset=*)
|
||||
|
||||
|
||||
cdef class Column_multi_elts_qual(Column_multi_elts) :
|
||||
cdef class Column_multi_elts_qual(Column_multi_elts_idx) :
|
||||
|
||||
cpdef object get_item(self, index_t line_nb, object elt_id)
|
||||
cpdef object get_str_item(self, index_t line_nb, object elt_id)
|
||||
cpdef object get_str_item(self, index_t line_nb, object elt_id, int offset=*)
|
||||
cpdef object get_line(self, index_t line_nb)
|
||||
cpdef object get_str_line(self, index_t line_nb)
|
||||
cpdef object get_str_line(self, index_t line_nb, int offset=*)
|
||||
cpdef set_item(self, index_t line_nb, object elt_id, object value)
|
||||
cpdef set_str_item(self, index_t line_nb, object elt_id, object value)
|
||||
cpdef set_str_item(self, index_t line_nb, object elt_id, object value, int offset=*)
|
||||
|
@ -6,6 +6,8 @@ from ..column cimport register_column_class
|
||||
|
||||
from ...view.view cimport View
|
||||
|
||||
from ..column cimport Column
|
||||
|
||||
from obitools3.utils cimport tobytes, bytes2str, \
|
||||
obi_errno_to_exception
|
||||
|
||||
@ -28,7 +30,9 @@ from libc.stdint cimport uint8_t
|
||||
from libc.stdlib cimport malloc
|
||||
|
||||
|
||||
cdef class Column_qual(Column):
|
||||
# TODO detect type of value and call set_item_str if str or bytes
|
||||
|
||||
cdef class Column_qual(Column_idx):
|
||||
|
||||
@staticmethod
|
||||
def new(View view,
|
||||
@ -59,12 +63,12 @@ cdef class Column_qual(Column):
|
||||
return result
|
||||
|
||||
|
||||
cpdef object get_str_line(self, index_t line_nb):
|
||||
cpdef object get_str_line(self, index_t line_nb, int offset=-1):
|
||||
global obi_errno
|
||||
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(), line_nb, 0)
|
||||
value = obi_get_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, 0, offset)
|
||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=None, error_message="Problem getting a value from a column")
|
||||
if value == OBIQual_char_NA :
|
||||
result = None
|
||||
@ -91,19 +95,19 @@ cdef class Column_qual(Column):
|
||||
free(value_b)
|
||||
|
||||
|
||||
cpdef set_str_line(self, index_t line_nb, object value):
|
||||
cpdef set_str_line(self, index_t line_nb, object value, int offset=-1):
|
||||
global obi_errno
|
||||
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(), line_nb, 0, OBIQual_char_NA) < 0:
|
||||
if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, 0, OBIQual_char_NA, offset) < 0:
|
||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=None, error_message="Problem setting a value in a column")
|
||||
else :
|
||||
value_b = tobytes(value)
|
||||
if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, 0, value_b) < 0:
|
||||
if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, 0, value_b, offset) < 0:
|
||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=None, error_message="Problem setting a value in a column")
|
||||
|
||||
|
||||
cdef class Column_multi_elts_qual(Column_multi_elts):
|
||||
cdef class Column_multi_elts_qual(Column_multi_elts_idx):
|
||||
|
||||
cpdef object get_item(self, index_t line_nb, object elt_id):
|
||||
global obi_errno
|
||||
@ -126,15 +130,15 @@ cdef class Column_multi_elts_qual(Column_multi_elts):
|
||||
return result
|
||||
|
||||
|
||||
cpdef object get_str_item(self, index_t line_nb, object elt_id):
|
||||
cpdef object get_str_item(self, index_t line_nb, object elt_id, int offset=-1):
|
||||
global obi_errno
|
||||
cdef char* value
|
||||
cdef object result
|
||||
if type(elt_id) == int :
|
||||
value = obi_get_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, elt_id)
|
||||
value = obi_get_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, elt_id, offset)
|
||||
else :
|
||||
elt_name = tobytes(elt_id)
|
||||
value = obi_get_qual_char_with_elt_name_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, elt_name)
|
||||
value = obi_get_qual_char_with_elt_name_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, elt_name, offset)
|
||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=elt_id, error_message="Problem getting a value from a column")
|
||||
if value == OBIQual_char_NA :
|
||||
result = None
|
||||
@ -176,7 +180,7 @@ cdef class Column_multi_elts_qual(Column_multi_elts):
|
||||
return result
|
||||
|
||||
|
||||
cpdef object get_str_line(self, index_t line_nb) :
|
||||
cpdef object get_str_line(self, index_t line_nb, int offset=-1) :
|
||||
global obi_errno
|
||||
cdef char* value
|
||||
cdef object value_in_result
|
||||
@ -192,7 +196,7 @@ cdef class Column_multi_elts_qual(Column_multi_elts):
|
||||
column_p = self.pointer()
|
||||
elements_names = self.elements_names
|
||||
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(), line_nb, i)
|
||||
value = obi_get_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i, offset)
|
||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
||||
if value != OBIQual_char_NA :
|
||||
value_in_result = bytes2str(value)
|
||||
@ -232,7 +236,7 @@ cdef class Column_multi_elts_qual(Column_multi_elts):
|
||||
free(value_b)
|
||||
|
||||
|
||||
cpdef set_str_item(self, index_t line_nb, object elt_id, object value):
|
||||
cpdef set_str_item(self, index_t line_nb, object elt_id, object value, int offset=-1):
|
||||
global obi_errno
|
||||
cdef bytes value_b
|
||||
cdef bytes elt_name
|
||||
@ -243,11 +247,11 @@ cdef class Column_multi_elts_qual(Column_multi_elts):
|
||||
value_b = tobytes(value)
|
||||
|
||||
if type(elt_id) == int :
|
||||
if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, elt_id, value_b) < 0 :
|
||||
if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, elt_id, value_b, offset) < 0 :
|
||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=elt_id, error_message="Problem setting a value in a column")
|
||||
else :
|
||||
elt_name = tobytes(elt_id)
|
||||
if obi_set_qual_char_with_elt_name_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, elt_name, value_b) < 0:
|
||||
if obi_set_qual_char_with_elt_name_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, elt_name, value_b, offset) < 0:
|
||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=elt_id, error_message="Problem setting a value in a column")
|
||||
|
||||
|
||||
|
@ -26,13 +26,16 @@
|
||||
*
|
||||
**********************************************************************/
|
||||
|
||||
int obi_column_set_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx, const char* value)
|
||||
int obi_column_set_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx, const char* value, int offset)
|
||||
{
|
||||
uint8_t* int_value;
|
||||
int int_value_length;
|
||||
int i;
|
||||
int ret_value;
|
||||
|
||||
if (offset == -1)
|
||||
offset = QUALITY_ASCII_BASE;
|
||||
|
||||
// Check NA value
|
||||
if (value == OBIQual_char_NA)
|
||||
{
|
||||
@ -45,7 +48,7 @@ int obi_column_set_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t lin
|
||||
|
||||
// Convert in uint8_t array to index in that format
|
||||
for (i=0; i<int_value_length; i++)
|
||||
int_value[i] = ((uint8_t)(value[i])) - QUALITY_ASCII_BASE;
|
||||
int_value[i] = ((uint8_t)(value[i])) - offset;
|
||||
ret_value = obi_column_set_obiqual_int_with_elt_idx(column, line_nb, element_idx, int_value, int_value_length);
|
||||
free(int_value);
|
||||
}
|
||||
@ -101,13 +104,16 @@ int obi_column_set_obiqual_int_with_elt_idx(OBIDMS_column_p column, index_t line
|
||||
}
|
||||
|
||||
|
||||
char* obi_column_get_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx)
|
||||
char* obi_column_get_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx, int offset)
|
||||
{
|
||||
char* value;
|
||||
const uint8_t* int_value;
|
||||
int int_value_length;
|
||||
int i;
|
||||
|
||||
if (offset == -1)
|
||||
offset = QUALITY_ASCII_BASE;
|
||||
|
||||
int_value = obi_column_get_obiqual_int_with_elt_idx(column, line_nb, element_idx, &int_value_length);
|
||||
|
||||
// Check NA
|
||||
@ -118,7 +124,7 @@ char* obi_column_get_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t l
|
||||
|
||||
// Encode int quality to char quality
|
||||
for (i=0; i<int_value_length; i++)
|
||||
value[i] = (char)(int_value[i] + QUALITY_ASCII_BASE);
|
||||
value[i] = (char)(int_value[i] + offset);
|
||||
|
||||
value[i] = '\0';
|
||||
|
||||
@ -143,13 +149,13 @@ const uint8_t* obi_column_get_obiqual_int_with_elt_idx(OBIDMS_column_p column, i
|
||||
}
|
||||
|
||||
|
||||
int obi_column_set_obiqual_char_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name, const char* value)
|
||||
int obi_column_set_obiqual_char_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name, const char* value, int offset)
|
||||
{
|
||||
index_t element_idx = obi_column_get_element_index_from_name(column, element_name);
|
||||
if (element_idx == OBIIdx_NA)
|
||||
return -1;
|
||||
|
||||
return obi_column_set_obiqual_char_with_elt_idx(column, line_nb, element_idx, value);
|
||||
return obi_column_set_obiqual_char_with_elt_idx(column, line_nb, element_idx, value, offset);
|
||||
}
|
||||
|
||||
|
||||
@ -163,13 +169,13 @@ int obi_column_set_obiqual_int_with_elt_name(OBIDMS_column_p column, index_t lin
|
||||
}
|
||||
|
||||
|
||||
char* obi_column_get_obiqual_char_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name)
|
||||
char* obi_column_get_obiqual_char_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name, int offset)
|
||||
{
|
||||
index_t element_idx = obi_column_get_element_index_from_name(column, element_name);
|
||||
if (element_idx == OBIIdx_NA)
|
||||
return OBIQual_char_NA;
|
||||
|
||||
return obi_column_get_obiqual_char_with_elt_idx(column, line_nb, element_idx);
|
||||
return obi_column_get_obiqual_char_with_elt_idx(column, line_nb, element_idx, offset);
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "obitypes.h"
|
||||
|
||||
|
||||
#define QUALITY_ASCII_BASE (33) /**< The ASCII base of sequence quality.
|
||||
#define QUALITY_ASCII_BASE (33) /**< The default ASCII base of sequence quality.
|
||||
* Used to convert sequence qualities from characters to integers
|
||||
* and the other way around.
|
||||
*/
|
||||
@ -40,6 +40,8 @@
|
||||
* @param line_nb The number of the line where the value should be set.
|
||||
* @param element_idx The index of the element that should be set in the line.
|
||||
* @param value The value that should be set, in the character string format.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around. If -1, the default base is used.
|
||||
*
|
||||
* @returns An integer value indicating the success of the operation.
|
||||
* @retval 0 on success.
|
||||
@ -48,7 +50,7 @@
|
||||
* @since May 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
int obi_column_set_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx, const char* value);
|
||||
int obi_column_set_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx, const char* value, int offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -84,6 +86,8 @@ int obi_column_set_obiqual_int_with_elt_idx(OBIDMS_column_p column, index_t line
|
||||
* @param column A pointer as returned by obi_create_column().
|
||||
* @param line_nb The number of the line where the value should be recovered.
|
||||
* @param element_idx The index of the element that should be recovered in the line.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around. If -1, the default base is used.
|
||||
*
|
||||
* @returns The recovered value, in the character string format.
|
||||
* @retval OBIQual_char_NA the NA value of the type if an error occurred and obi_errno is set.
|
||||
@ -91,7 +95,7 @@ int obi_column_set_obiqual_int_with_elt_idx(OBIDMS_column_p column, index_t line
|
||||
* @since May 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
char* obi_column_get_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx);
|
||||
char* obi_column_get_obiqual_char_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx, int offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -126,6 +130,8 @@ const uint8_t* obi_column_get_obiqual_int_with_elt_idx(OBIDMS_column_p column, i
|
||||
* @param line_nb The number of the line where the value should be set.
|
||||
* @param element_name The name of the element that should be set in the line.
|
||||
* @param value The value that should be set, in the character string format.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around. If -1, the default base is used.
|
||||
*
|
||||
* @returns An integer value indicating the success of the operation.
|
||||
* @retval 0 on success.
|
||||
@ -134,7 +140,7 @@ const uint8_t* obi_column_get_obiqual_int_with_elt_idx(OBIDMS_column_p column, i
|
||||
* @since May 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
int obi_column_set_obiqual_char_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name, const char* value);
|
||||
int obi_column_set_obiqual_char_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name, const char* value, int offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -170,6 +176,8 @@ int obi_column_set_obiqual_int_with_elt_name(OBIDMS_column_p column, index_t lin
|
||||
* @param column A pointer as returned by obi_create_column() or obi_clone_column().
|
||||
* @param line_nb The number of the line where the value should be recovered.
|
||||
* @param element_name The name of the element that should be recovered in the line.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around. If -1, the default base is used.
|
||||
*
|
||||
* @returns The recovered value, in the character string format.
|
||||
* @retval OBIQual_char_NA the NA value of the type if an error occurred and obi_errno is set.
|
||||
@ -177,7 +185,7 @@ int obi_column_set_obiqual_int_with_elt_name(OBIDMS_column_p column, index_t lin
|
||||
* @since May 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
char* obi_column_get_obiqual_char_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name);
|
||||
char* obi_column_get_obiqual_char_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name, int offset);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -2942,11 +2942,11 @@ obiint_t obi_get_int_with_elt_name_and_col_name_in_view(Obiview_p view, const ch
|
||||
|
||||
/*********** FOR QUAL COLUMNS ***********/
|
||||
|
||||
int obi_set_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, index_t element_idx, const char* value)
|
||||
int obi_set_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, index_t element_idx, const char* value, int offset)
|
||||
{
|
||||
if (prepare_to_set_value_in_column(view, &column, &line_nb) < 0)
|
||||
return -1;
|
||||
return obi_column_set_obiqual_char_with_elt_idx(column, line_nb, element_idx, value);
|
||||
return obi_column_set_obiqual_char_with_elt_idx(column, line_nb, element_idx, value, offset);
|
||||
}
|
||||
|
||||
|
||||
@ -2958,11 +2958,11 @@ int obi_set_qual_int_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_colum
|
||||
}
|
||||
|
||||
|
||||
char* obi_get_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, index_t element_idx)
|
||||
char* obi_get_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, index_t element_idx, int offset)
|
||||
{
|
||||
if (prepare_to_get_value_from_column(view, &line_nb) < 0)
|
||||
return OBIQual_char_NA;
|
||||
return obi_column_get_obiqual_char_with_elt_idx(column, line_nb, element_idx);
|
||||
return obi_column_get_obiqual_char_with_elt_idx(column, line_nb, element_idx, offset);
|
||||
}
|
||||
|
||||
|
||||
@ -2974,12 +2974,12 @@ const uint8_t* obi_get_qual_int_with_elt_idx_and_col_p_in_view(Obiview_p view, O
|
||||
}
|
||||
|
||||
|
||||
int obi_set_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, const char* element_name, const char* value)
|
||||
int obi_set_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, const char* element_name, const char* value, int offset)
|
||||
{
|
||||
index_t element_idx = obi_column_get_element_index_from_name(column, element_name);
|
||||
if (element_idx == OBIIdx_NA)
|
||||
return -1;
|
||||
return obi_set_qual_char_with_elt_idx_and_col_p_in_view(view, column, line_nb, element_idx, value);
|
||||
return obi_set_qual_char_with_elt_idx_and_col_p_in_view(view, column, line_nb, element_idx, value, offset);
|
||||
}
|
||||
|
||||
|
||||
@ -2992,12 +2992,12 @@ int obi_set_qual_int_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_colu
|
||||
}
|
||||
|
||||
|
||||
char* obi_get_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, const char* element_name)
|
||||
char* obi_get_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, const char* element_name, int offset)
|
||||
{
|
||||
index_t element_idx = obi_column_get_element_index_from_name(column, element_name);
|
||||
if (element_idx == OBIIdx_NA)
|
||||
return OBIQual_char_NA;
|
||||
return obi_get_qual_char_with_elt_idx_and_col_p_in_view(view, column, line_nb, element_idx);
|
||||
return obi_get_qual_char_with_elt_idx_and_col_p_in_view(view, column, line_nb, element_idx, offset);
|
||||
}
|
||||
|
||||
|
||||
@ -3010,43 +3010,43 @@ const uint8_t* obi_get_qual_int_with_elt_name_and_col_p_in_view(Obiview_p view,
|
||||
}
|
||||
|
||||
|
||||
int obi_set_qual_char_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name, const char* value)
|
||||
int obi_set_qual_char_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name, const char* value, int offset)
|
||||
{
|
||||
OBIDMS_column_p column_p;
|
||||
column_p = obi_view_get_column(view, column_name);
|
||||
if (column_p == NULL)
|
||||
return -1;
|
||||
return obi_set_qual_char_with_elt_name_and_col_p_in_view(view, column_p, line_nb, element_name, value);
|
||||
return obi_set_qual_char_with_elt_name_and_col_p_in_view(view, column_p, line_nb, element_name, value, offset);
|
||||
}
|
||||
|
||||
|
||||
int obi_set_qual_char_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx, const char* value)
|
||||
int obi_set_qual_char_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx, const char* value, int offset)
|
||||
{
|
||||
OBIDMS_column_p column_p;
|
||||
column_p = obi_view_get_column(view, column_name);
|
||||
if (column_p == NULL)
|
||||
return -1;
|
||||
return obi_set_qual_char_with_elt_idx_and_col_p_in_view(view, column_p, line_nb, element_idx, value);
|
||||
return obi_set_qual_char_with_elt_idx_and_col_p_in_view(view, column_p, line_nb, element_idx, value, offset);
|
||||
}
|
||||
|
||||
|
||||
char* obi_get_qual_char_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx)
|
||||
char* obi_get_qual_char_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx, int offset)
|
||||
{
|
||||
OBIDMS_column_p column_p;
|
||||
column_p = obi_view_get_column(view, column_name);
|
||||
if (column_p == NULL)
|
||||
return OBIQual_char_NA;
|
||||
return obi_get_qual_char_with_elt_idx_and_col_p_in_view(view, column_p, line_nb, element_idx);
|
||||
return obi_get_qual_char_with_elt_idx_and_col_p_in_view(view, column_p, line_nb, element_idx, offset);
|
||||
}
|
||||
|
||||
|
||||
char* obi_get_qual_char_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name)
|
||||
char* obi_get_qual_char_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name, int offset)
|
||||
{
|
||||
OBIDMS_column_p column_p;
|
||||
column_p = obi_view_get_column(view, column_name);
|
||||
if (column_p == NULL)
|
||||
return OBIQual_char_NA;
|
||||
return obi_get_qual_char_with_elt_name_and_col_p_in_view(view, column_p, line_nb, element_name);
|
||||
return obi_get_qual_char_with_elt_name_and_col_p_in_view(view, column_p, line_nb, element_name, offset);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1276,6 +1276,8 @@ obiint_t obi_get_int_with_elt_name_and_col_name_in_view(Obiview_p view, const ch
|
||||
* @param line_nb The number of the line where the value should be set.
|
||||
* @param element_idx The index of the element that should be set in the line.
|
||||
* @param value The value that should be set, in the character string format.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around.
|
||||
*
|
||||
* @returns An integer value indicating the success of the operation.
|
||||
* @retval 0 on success.
|
||||
@ -1284,7 +1286,7 @@ obiint_t obi_get_int_with_elt_name_and_col_name_in_view(Obiview_p view, const ch
|
||||
* @since May 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
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_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 offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -1301,6 +1303,8 @@ int obi_set_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_colu
|
||||
* @param line_nb The number of the line where the value should be set.
|
||||
* @param element_idx The index of the element that should be set in the line.
|
||||
* @param value The value that should be set, in the character string format.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around.
|
||||
*
|
||||
* @returns An integer value indicating the success of the operation.
|
||||
* @retval 0 on success.
|
||||
@ -1309,7 +1313,7 @@ int obi_set_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_colu
|
||||
* @since August 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
int obi_set_qual_char_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx, const char* value);
|
||||
int obi_set_qual_char_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx, const char* value, int offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -1375,6 +1379,8 @@ int obi_set_qual_int_with_elt_idx_and_col_name_in_view(Obiview_p view, const cha
|
||||
* @param column_p A pointer as returned by obi_create_column().
|
||||
* @param line_nb The number of the line where the value should be recovered.
|
||||
* @param element_idx The index of the element that should be recovered in the line.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around.
|
||||
*
|
||||
* @returns The recovered value, in the character string format.
|
||||
* @retval OBIQual_char_NA the NA value of the type if an error occurred and obi_errno is set.
|
||||
@ -1382,7 +1388,7 @@ int obi_set_qual_int_with_elt_idx_and_col_name_in_view(Obiview_p view, const cha
|
||||
* @since May 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
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);
|
||||
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, int offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -1396,6 +1402,8 @@ char* obi_get_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_co
|
||||
* @param column_name The alias of the column in the view.
|
||||
* @param line_nb The number of the line where the value should be recovered.
|
||||
* @param element_idx The index of the element that should be recovered in the line.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around.
|
||||
*
|
||||
* @returns The recovered value, in the character string format.
|
||||
* @retval OBIQual_char_NA the NA value of the type if an error occurred and obi_errno is set.
|
||||
@ -1403,7 +1411,7 @@ char* obi_get_qual_char_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_co
|
||||
* @since August 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
char* obi_get_qual_char_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx);
|
||||
char* obi_get_qual_char_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx, int offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -1464,6 +1472,8 @@ const uint8_t* obi_get_qual_int_with_elt_idx_and_col_name_in_view(Obiview_p view
|
||||
* @param line_nb The number of the line where the value should be set.
|
||||
* @param element_name The name of the element that should be set in the line.
|
||||
* @param value The value that should be set, in the character string format.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around.
|
||||
*
|
||||
* @returns An integer value indicating the success of the operation.
|
||||
* @retval 0 on success.
|
||||
@ -1472,7 +1482,7 @@ const uint8_t* obi_get_qual_int_with_elt_idx_and_col_name_in_view(Obiview_p view
|
||||
* @since May 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
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_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 offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -1489,6 +1499,8 @@ int obi_set_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_col
|
||||
* @param line_nb The number of the line where the value should be set.
|
||||
* @param element_name The name of the element that should be set in the line.
|
||||
* @param value The value that should be set, in the character string format.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around.
|
||||
*
|
||||
* @returns An integer value indicating the success of the operation.
|
||||
* @retval 0 on success.
|
||||
@ -1497,7 +1509,7 @@ int obi_set_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_col
|
||||
* @since August 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
int obi_set_qual_char_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name, const char* value);
|
||||
int obi_set_qual_char_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name, const char* value, int offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -1563,6 +1575,8 @@ int obi_set_qual_int_with_elt_name_and_col_name_in_view(Obiview_p view, const ch
|
||||
* @param column_p A pointer as returned by obi_create_column() or obi_clone_column().
|
||||
* @param line_nb The number of the line where the value should be recovered.
|
||||
* @param element_name The name of the element that should be recovered in the line.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around.
|
||||
*
|
||||
* @returns The recovered value, in the character string format.
|
||||
* @retval OBIQual_char_NA the NA value of the type if an error occurred and obi_errno is set.
|
||||
@ -1570,7 +1584,7 @@ int obi_set_qual_int_with_elt_name_and_col_name_in_view(Obiview_p view, const ch
|
||||
* @since May 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
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);
|
||||
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, int offset);
|
||||
|
||||
|
||||
/**
|
||||
@ -1584,6 +1598,8 @@ char* obi_get_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_c
|
||||
* @param column_name The alias of the column in the view.
|
||||
* @param line_nb The number of the line where the value should be recovered.
|
||||
* @param element_name The name of the element that should be recovered in the line.
|
||||
* @param offset The ASCII base of sequence quality, used to convert sequence qualities from characters to integers
|
||||
* and the other way around.
|
||||
*
|
||||
* @returns The recovered value, in the character string format.
|
||||
* @retval OBIQual_char_NA the NA value of the type if an error occurred and obi_errno is set.
|
||||
@ -1591,7 +1607,7 @@ char* obi_get_qual_char_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_c
|
||||
* @since August 2016
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
char* obi_get_qual_char_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name);
|
||||
char* obi_get_qual_char_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name, int offset);
|
||||
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user