Module providing functions for handling FASTA data.
More...
|
| #define | firstEl(b) (b & 0x0F) |
| | Gets the first 4 bits of a byte.
|
| |
| #define | secondEl(b) (b & 0xF0) >> 4 |
| | Gets the second 4 bits of a byte.
|
| |
| #define | toByte(a, b) (uint8_t)a | (b << 4) |
| | Combines two 4 bit numbers into a byte.
|
| |
| #define | i_Index 0xFF |
| | Invalid FASTA index.
|
| |
Module providing functions for handling FASTA data.
◆ firstEl
| #define firstEl |
( |
|
b | ) |
(b & 0x0F) |
Gets the first 4 bits of a byte.
- Parameters
-
| b | the byte to get the first 4 bits from |
◆ i_Index
◆ secondEl
| #define secondEl |
( |
|
b | ) |
(b & 0xF0) >> 4 |
Gets the second 4 bits of a byte.
- Parameters
-
| b | the byte to get the second 4 bits from |
◆ toByte
| #define toByte |
( |
|
a, |
|
|
|
b |
|
) |
| (uint8_t)a | (b << 4) |
Combines two 4 bit numbers into a byte.
- Parameters
-
| a | the first 4 bit number |
| b | the second 4 bit number |
◆ getIUPACchar()
| char getIUPACchar |
( |
uint8_t |
index, |
|
|
bool |
rna |
|
) |
| |
Returns IUPAC FASTA character.
- Parameters
-
| index | the code to convert to a character |
| rna | if true, T will be converted to U |
- Returns
- the IUPAC character
- Warning
- index must be less than 16, else the function will go out of bounds
◆ initialize_fasta_binary_mapping()
| void initialize_fasta_binary_mapping |
( |
| ) |
|
Initializes the FASTA binary mapping.
◆ is_valid_title()
| bool is_valid_title |
( |
const char * |
title, |
|
|
size_t |
len |
|
) |
| |
Checks if a FASTA title is valid.
- Parameters
-
| title | the title to check |
| len | the length of the title |
- Returns
- true if the title is valid, false otherwise
◆ pack()
| static void pack |
( |
uint8_t |
values[PACKING_WIDTH], |
|
|
packing_t * |
packed |
|
) |
| |
|
inlinestatic |
Packs an array of 4-bit values into an integer.
- Parameters
-
| values | the array of 4-bit values to pack |
| packed | the packed value |
◆ fasta_binary_mapping
| uint8_t fasta_binary_mapping[CHAR_MAX+1] |
|
extern |
A lookup table mapping FASTA characters to binary values.
- Warning
- This table is initialized in the initialize_fasta_binary_mapping