C: Added a function to get a nucleotide at a specific index in an

encoded sequence
This commit is contained in:
Celine Mercier
2019-01-21 17:18:02 +01:00
parent 2a6a112d29
commit 9f6bba183f
2 changed files with 48 additions and 0 deletions

View File

@ -108,6 +108,24 @@ bool only_IUPAC_DNA(const char* seq);
bool is_a_DNA_seq(const char* seq);
/**
* @brief Returns a nucleotide from a DNA sequence encoded
* with each nucleotide on 2 or 4 bits.
*
* @param seq The encoded sequence.
* @param idx The index (in the decoded sequence) of the nucleotide to get.
* @param encoding An integer indicating whether the sequence is encoded with each nucleotide on 2 or 4 bits.
*
* @returns The (still encoded) nucleotide at the given index.
* @retval 255 if an error occurred.
*
* @see decode_seq_on_2_bits() and decode_seq_on_4_bits()
* @since January 2019
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
byte_t get_nucleotide_from_encoded_seq(byte_t* seq, int32_t idx, uint8_t encoding);
/**
* @brief Encodes a DNA sequence with each nucleotide coded on 2 bits.
*