Implemented functions to build reverse complement sequences

This commit is contained in:
Celine Mercier
2018-01-05 16:08:36 +01:00
parent 428c4eb5e6
commit 156fb04e88
5 changed files with 303 additions and 25 deletions

View File

@ -20,10 +20,16 @@
#include "obitypes.h"
#define FORMATTED_TIME_LENGTH (1024) /**< The length allocated for the character string containing a formatted date.
*/
#define ONE_IF_ZERO(x) (((x)==0)?1:(x)) /**< If x is equal to 0, x takes the value 1.
*/
#define FORMATTED_TIME_LENGTH (1024) /**< The length allocated for the character string containing a formatted date.
*/
#define ONE_IF_ZERO(x) (((x)==0)?1:(x)) /**< If x is equal to 0, x takes the value 1.
*/
#define DNA_ALPHA "acgtbdefhijklmnopqrsuvwxyz#![]" /**< DNA alphabet (IUPAC).
//"ABCDEFGHIJKLMNOPQRSTUVWXYZ#![]" */
#define CDNA_ALPHA "tgcavhefdijmlknopqysabwxrz#!][" /**< Complementary DNA alphabet (IUPAC).
//"TVGHEFCDIJMLKNOPQYSAABWXRZ#!][" */
/**
* @brief Copy the content of a file into another file.
@ -155,4 +161,38 @@ void* bsearch_user_data(const void* key, const void* base, size_t num, size_t si
void qsort_user_data(void *aa, size_t n, size_t es, const void *user_data, int (*cmp)(const void *, const void *, const void *));
/**
* Function returning the reverse complement of a nucleotide sequence.
*
* @warning The sequence must be in lower case.
* @warning The sequence will be replaced by its reverse complement without being copied.
*
* @param nucAcSeq The nucleotide sequence.
*
* @returns The reverse complemented sequence.
*
* @since December 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
* @note Copied from ecoPCR source code
*/
char* reverse_complement_sequence(char* nucAcSeq);
/**
* Function returning the reverse complement of a pattern.
*
* @warning The pattern must be in lower case.
* @warning The pattern will be replaced by its reverse complement without being copied.
*
* @param nucAcSeq The pattern.
*
* @returns The reverse complemented pattern.
*
* @since December 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
* @note Copied from ecoPCR source code
*/
char* reverse_complement_pattern(char* nucAcSeq);
#endif /* UTILS_H_ */