Major update: New column type to store sequence qualities. Closes #41

This commit is contained in:
Celine Mercier
2016-05-20 16:45:22 +02:00
parent ffff91e76c
commit 3b59043ea8
33 changed files with 962 additions and 267 deletions

View File

@ -1,17 +1,17 @@
/****************************************************************************
* DNA sequence indexer header file *
* uint8 indexer header file *
****************************************************************************/
/**
* @file dna_seq_indexer.h
* @file uint8_indexer.h
* @author Celine Mercier
* @date April 12th 2016
* @brief Header file for the functions handling the indexing of DNA sequences.
* @date May 4th 2016
* @brief Header file for the functions handling the indexing of uint8 arrays.
*/
#ifndef DNA_SEQ_INDEXER_H_
#define DNA_SEQ_INDEXER_H_
#ifndef UINT8_INDEXER_H_
#define UINT8_INDEXER_H_
#include <stdlib.h>
@ -24,64 +24,69 @@
/**
* @brief Converts a DNA sequence to a blob.
* @brief Converts an uint8 array to a blob.
*
* @warning The blob must be freed by the caller.
*
* @param value The DNA sequence to convert.
* @param value The uint8 array to convert.
* @param value_length The length of the uint8 array to convert.
*
* @returns A pointer to the blob created.
* @returns A pointer on the blob created.
* @retval NULL if an error occurred.
*
* @since November 2015
* @since May 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
Obi_blob_p obi_seq_to_blob(const char* seq);
Obi_blob_p obi_uint8_to_blob(const uint8_t* value, int value_length);
/**
* @brief Converts a blob to a DNA sequence.
* @brief Converts a blob to an uint8 array.
*
* @warning The array returned is mapped.
*
* @param value_b The blob to convert.
*
* @returns A pointer to the DNA sequence contained in the blob.
* @returns A pointer on the uint8 array contained in the blob.
* @retval NULL if an error occurred.
*
* @since November 2015
* @since May 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
char* obi_blob_to_seq(Obi_blob_p value_b);
const uint8_t* obi_blob_to_uint8(Obi_blob_p value_b);
/**
* @brief Stores a DNA sequence in an indexer and returns the index.
* @brief Stores an uint8 array in an indexer and returns the index.
*
* @param indexer The indexer structure.
* @param value The DNA sequence to index.
* @param value The uint8 array to index.
* @param value_length The length of the uint8 array to index.
*
* @returns The index referring to the stored DNA sequence in the indexer.
* @returns The index referring to the stored uint8 array in the indexer.
*
* @since April 2016
* @since May 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
index_t obi_index_dna_seq(Obi_indexer_p indexer, const char* value);
index_t obi_index_uint8(Obi_indexer_p indexer, const uint8_t* value, int value_length);
/**
* @brief Retrieves a DNA sequence from an indexer.
* @brief Retrieves an uint8 array from an indexer.
*
* @warning The DNA sequence returned must be freed by the caller.
* @warning The array returned is mapped.
*
* @param indexer The indexer structure.
* @param idx The index referring to the DNA sequence to retrieve in the indexer.
* @param idx The index referring to the uint8 array to retrieve in the indexer.
* @param value_length A pointer on an integer to store the length of the array retrieved.
*
* @returns A pointer on the DNA sequence.
* @returns A pointer on the uint8 array.
*
* @since April 2016
* @since May 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
char* obi_retrieve_dna_seq(Obi_indexer_p indexer, index_t idx);
const uint8_t* obi_retrieve_uint8(Obi_indexer_p indexer, index_t idx, int* value_length);
#endif /* DNA_SEQ_INDEXER_H_ */
#endif /* UINT8_INDEXER_H_ */