eccLib 1.1.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
GtfDict.h
Go to the documentation of this file.
1
6#ifndef GTFDICT_H
7#define GTFDICT_H
8
9#include <Python.h>
10
11// The third-party hashmap library is used to store the attributes
12#include "../hashmap_ext.h"
13
30typedef struct {
31 PyObject_HEAD union { // note the two ways of accessing the same data
36 PyObject *core[8];
40 struct {
41 PyObject *seqname;
42 PyObject *source;
43 PyObject *feature;
44 PyObject *start;
45 PyObject *end;
46 PyObject *score;
47 PyObject *reverse;
48 PyObject *frame;
49 };
50 };
55 struct hashmap_s attributes;
56} GtfDict;
57
62extern PyTypeObject GtfDictType;
63
70#define GtfDict_check(o) PyType_IsSubtype(Py_TYPE(o), &GtfDictType)
71
80int GtfDict_containsValue(GtfDict *self, PyObject *other);
81
89char *GtfDictToGTF(GtfDict *self, size_t *len);
90
97PyObject *GtfDict_keys(GtfDict *restrict self);
98
106PyObject *GtfDict_getitem(GtfDict *restrict self, PyObject *restrict key);
107
108#endif
char * GtfDictToGTF(GtfDict *self, size_t *len)
Generates a valid GTF line based on the GtfDict.
int GtfDict_containsValue(GtfDict *self, PyObject *other)
Internal function for checking if the other dict is contained within self. Linked as contains and con...
PyObject * GtfDict_getitem(GtfDict *restrict self, PyObject *restrict key)
A custom getitem that also checks the core attributes.
Definition GtfDict.c:725
PyObject * GtfDict_keys(GtfDict *restrict self)
GtfDict.keys()
Definition GtfDict.c:810
PyTypeObject GtfDictType
The Python type definition for the GtfDict object.
Definition GtfDict.c:1155
A dict that holds GTF data.
Definition GtfDict.h:30
PyObject * frame
Definition GtfDict.h:48
PyObject * score
Definition GtfDict.h:46
PyObject * feature
Definition GtfDict.h:43
PyObject * source
Definition GtfDict.h:42
PyObject * end
Definition GtfDict.h:45
PyObject * start
Definition GtfDict.h:44
PyObject * reverse
Definition GtfDict.h:47
PyObject * seqname
Definition GtfDict.h:41