eccLib 1.1.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
gtf.h
Go to the documentation of this file.
1
6#ifndef GTF_H
7#define GTF_H
8
9#include <Python.h>
10#include <stdlib.h>
11
12#include "../classes/GtfDict.h"
13#include "../common.h"
14
27#define DEFAULT_ATTR_SIZE \
28 64 // well how often do you see a GTF line with more than 64 attributes?
29
43GtfDict *createGTFdict(const occurrence_t *restrict token, PyObject *attr_tp,
44 hashmap_t *restrict attr_keys,
45 hashmap_t *restrict attr_vals);
46
57bool validGTFLineToParse(const char *line, size_t len);
58
66char *gtf_percent_encode(const char *restrict str, size_t len,
67 size_t *restrict outLen);
68
77 SOURCE = 1,
79 START = 3,
80 END = 4,
81 SCORE = 5,
83 FRAME = 7,
84 ATTRIBUTES = 8
85};
86
92#define CORE_FIELD_COUNT 8
93
98extern const char *keywords[CORE_FIELD_COUNT];
99
104extern const uint8_t keyword_sizes[CORE_FIELD_COUNT];
105
106#define GFF3_FASTA_HEADER "##FASTA"
107
108#endif
GtfDict * createGTFdict(const occurrence_t *restrict token, PyObject *attr_tp, hashmap_t *restrict attr_keys, hashmap_t *restrict attr_vals)
Parses a singular GTF line into a Python dict.
const char * keywords[CORE_FIELD_COUNT]
Array containing the keywords of the GTF fields.
Definition gtf.c:473
bool validGTFLineToParse(const char *line, size_t len)
Determines if the provided line is a valid GTF line that can be parsed safely.
Definition gtf.c:22
#define CORE_FIELD_COUNT
The number of core fields in a GTF line.
Definition gtf.h:92
const uint8_t keyword_sizes[CORE_FIELD_COUNT]
Array containing the sizes of the keywords.
Definition gtf.c:476
gtfFields
Enum containing the fields that a GTF line can contain.
Definition gtf.h:75
@ SOURCE
Definition gtf.h:77
@ SEQNAME
Definition gtf.h:76
@ START
Definition gtf.h:79
@ FRAME
Definition gtf.h:83
@ ATTRIBUTES
Definition gtf.h:84
@ REVERSE
Definition gtf.h:82
@ FEATURE
Definition gtf.h:78
@ END
Definition gtf.h:80
@ SCORE
Definition gtf.h:81
char * gtf_percent_encode(const char *restrict str, size_t len, size_t *restrict outLen)
Percent encodes restricted GTF characters.
Definition gtf.c:451
A dict that holds GTF data.
Definition GtfDict.h:30
An occurrence of a token in a string.
Definition common.h:30