Added possibility to specify the offset for encoding and decoding

sequence quality character strings
This commit is contained in:
Celine Mercier
2017-07-27 19:24:41 +02:00
parent 99ceed5fff
commit 15d383fa8b
6 changed files with 95 additions and 61 deletions

View File

@ -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);
/**