First version of automatic ID and COUNT columns, to discuss (for now,

columns created when NUC_SEQ views are closed if the columns don't
already exist)
This commit is contained in:
Celine Mercier
2017-07-17 17:31:09 +02:00
parent 1e57bfacb4
commit c88df2e12c
4 changed files with 200 additions and 5 deletions

View File

@ -55,6 +55,8 @@
#define COUNT_COLUMN "COUNT" /**< The name of the column containing the sequence counts
* in NUC_SEQS_VIEW views.
*/
#define ID_PREFIX "seq" /**< The default prefix of sequence identifiers in automatic ID columns.
*/
/**
@ -409,6 +411,20 @@ int obi_view_delete_column(Obiview_p view, const char* column_name);
OBIDMS_column_p obi_view_get_column(Obiview_p view, const char* column_name);
/**
* @brief Checks if a column exists in a view.
*
* @param view A pointer on the view.
* @param column_name The name of the column in the view.
*
* @returns A boolean indicating whether or not the column exists in the view.
*
* @since July 2017
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
bool obi_view_column_exists(Obiview_p view, const char* column_name);
/**
* @brief Gets the pointer on the pointer on a column from its name in a view.
*
@ -527,6 +543,25 @@ int obi_save_and_close_view(Obiview_p view);
int obi_create_auto_count_column(Obiview_p view);
/**
* @brief Creates an OBI_STR column with the line count of the view it belongs to, and sets all lines with automatic identifiers
* with the form prefix_index.
*
* @warning The number of lines set corresponds to the line count of the view.
*
* @param view A pointer on the view.
* @param prefix The prefix of automatic ids. The ids have the form prefix_index. If NULL, the default ID_PREFIX is used.
*
* @returns A value indicating the success of the operation.
* @retval 0 if the operation was successfully completed.
* @retval -1 if an error occurred.
*
* @since July 2017
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_create_auto_id_column(Obiview_p view, const char* prefix);
/**
* @brief Recovers an obiblob from an OBIDMS column containing indices referring to obiblobs,
* using the index of the element in the line, and the column pointer, in the context of a view.