Module providing functions for handling GTF data.
More...
|
| 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.
|
| |
| bool | validGTFLineToParse (const char *line, size_t len) |
| | Determines if the provided line is a valid GTF line that can be parsed safely.
|
| |
Module providing functions for handling GTF data.
- See also
- https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md
◆ CORE_FIELD_COUNT
| #define CORE_FIELD_COUNT 8 |
The number of core fields in a GTF line.
This is better than using ATTRIBUTES, as it's more descriptive
◆ DEFAULT_ATTR_SIZE
| #define DEFAULT_ATTR_SIZE 64 |
How many attributes should be allocated by default.
- See also
- GtfDict
◆ gtfFields
Enum containing the fields that a GTF line can contain.
- See also
- GtfDict
-
keywords
| Enumerator |
|---|
| SEQNAME | |
| SOURCE | |
| FEATURE | |
| START | |
| END | |
| SCORE | |
| REVERSE | |
| FRAME | |
| ATTRIBUTES | |
◆ createGTFdict()
| 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.
- Parameters
-
| token | the GTF line to parse. It should contain a minimum of 7 \t, else it will throw an error |
| attr_tp | a mapping containing the callable to use to convert the attribute values to the correct type, or None |
| attr_keys | a hashmap containing the keys of the attributes |
| attr_vals | a hashmap containing the values of the attributes |
- Returns
- a PyObject* pointing to an object of type dict, or NULL on error
- See also
- occurrence_t
-
GtfDict
◆ validGTFLineToParse()
| bool validGTFLineToParse |
( |
const char * |
line, |
|
|
size_t |
len |
|
) |
| |
Determines if the provided line is a valid GTF line that can be parsed safely.
A line is considered valid if it doesn't start with a # and contains at least one \t
- Parameters
-
| line | the line to check |
| len | the length of the line |
- Returns
- true or false depending on line validity
◆ keyword_sizes
Array containing the sizes of the keywords.
◆ keyword_types
Array containing the types of the keywords.
◆ keywords
Array containing the keywords of the GTF fields.