eccLib 1.1.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
Macros | Typedefs | Functions | Variables
fasta.h File Reference

Header file for the FASTA module. More...

#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for fasta.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#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 PACKING_WIDTH   sizeof(packing_t) * 2
 
#define ROUND_NUM   7
 
#define PACKING_ROUND(packed_size)   (((packed_size) + ROUND_NUM) & ~ROUND_NUM)
 
#define i_Index   0xFF
 Invalid FASTA index.
 

Typedefs

typedef uint64_t packing_t
 

Functions

static void pack (uint8_t values[PACKING_WIDTH], packing_t *packed)
 Packs an array of 4-bit values into an integer.
 
bool is_valid_title (const char *title, size_t len)
 Checks if a FASTA title is valid.
 
char getIUPACchar (uint8_t index, bool rna)
 Returns IUPAC FASTA character.
 
void initialize_fasta_binary_mapping ()
 Initializes the FASTA binary mapping.
 

Variables

uint8_t fasta_binary_mapping [CHAR_MAX+1]
 A lookup table mapping FASTA characters to binary values.
 

Detailed Description

Header file for the FASTA module.

This module provides common functions that we use for handling FASTA data

Macro Definition Documentation

◆ PACKING_ROUND

#define PACKING_ROUND (   packed_size)    (((packed_size) + ROUND_NUM) & ~ROUND_NUM)

◆ PACKING_WIDTH

#define PACKING_WIDTH   sizeof(packing_t) * 2

◆ ROUND_NUM

#define ROUND_NUM   7

Typedef Documentation

◆ packing_t

typedef uint64_t packing_t