C: Added a function to get a nucleotide at a specific index in an
encoded sequence
This commit is contained in:
18
src/encode.h
18
src/encode.h
@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user