eccLib 1.3.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
Functions | Variables
GtfDict.c File Reference

Implementation of the GtfDict class. More...

#include "GtfDict.h"
#include <stdbool.h>
#include <stdlib.h>
#include <Python.h>
#include "../../formats/gtf.h"
#include "GtfDictViews.h"
Include dependency graph for GtfDict.c:

Functions

static int GtfDict_init_state (GtfDict *self)
 Initializes the state of a GtfDict object.
 
static GtfDictGtfDict_new (PyTypeObject *type, PyObject *args, PyObject *kwargs)
 Creates a new GtfDict object.
 
static int GtfDict_init (GtfDict *restrict self, PyObject *restrict args, PyObject *restrict kwargs)
 GtfDict.__init__()
 
static PyObject * GtfDict_getattro (GtfDict *restrict self, PyObject *restrict attr)
 A wrapper over the dict getattro that also acts as a getter for the 7 key GTF keys.
 
static int set_core_field (GtfDict *restrict self, unsigned char i, PyObject *restrict value)
 Sets a core field value by index.
 
static int GtfDict_setattro (GtfDict *restrict self, PyObject *restrict attr, PyObject *restrict value)
 A wrapper over the dict setattro that also acts as a setter for the 7 key GTF keys.
 
static PyObject * GtfDict_richcompare (GtfDict *restrict self, PyObject *restrict other, const int op)
 A custom GtfDict richcompare.
 
static PyObject * GtfDict_overlaps (GtfDict *restrict self, PyObject *restrict other)
 A custom method that determines if self overlaps with a different GtfDict.
 
int GtfDict_containsValue (GtfDict *restrict self, PyObject *restrict other)
 
static PyObject * GtfDict_contains (GtfDict *restrict self, PyObject *restrict other)
 Wrapper over GtfDict_containsValue() that allows for this method to be used as standalone.
 
static PyObject * GtfDict_coverage (GtfDict *restrict self, PyObject *restrict other)
 A custom method that returns the percentage of the gene that is covered by the other GtfDict.
 
static Py_ssize_t GtfDict_len (GtfDict *restrict self)
 Custom len method that returns actually the result of subtracting start from end.
 
static PyObject * GtfDict_str (GtfDict *restrict self)
 returns the GTF representation of the GtfDict
 
PyObject * GtfDict_getitem (GtfDict *restrict self, PyObject *restrict key)
 A custom getitem that also checks the core attributes.
 
static int GtfDict_setitem (GtfDict *restrict self, PyObject *restrict key, PyObject *restrict value)
 A custom setitem that also checks the core attributes.
 
static PyObject * GtfDict_view_new (GtfDict *self, PyTypeObject *type)
 
PyObject * GtfDict_keys (GtfDict *restrict self)
 GtfDict.keys()
 
static PyObject * GtfDict_values (GtfDict *restrict self)
 A function that returns the values of the GtfDict.
 
static PyObject * GtfDict_items (GtfDict *restrict self)
 A custom items method that also checks the core attributes.
 
static PyObject * GtfDict_iter (GtfDict *restrict self)
 Returns the iterator for the GtfDict.
 
static PyObject * GtfDict_pop (GtfDict *restrict self, PyObject *restrict args)
 A custom pop method that also checks the core attributes.
 
static PyObject * GtfDict_get (GtfDict *restrict self, PyObject *restrict args)
 A custom get method that also allows for a default value to be provided.
 
static PyObject * GtfDict_update (GtfDict *restrict self, PyObject *restrict args, PyObject *restrict kwargs)
 A custom update method that also checks the core attributes.
 
static void GtfDict_free_state (GtfDict *self)
 Frees the state of a GtfDict object.
 
static PyObject * GtfDict_clear (GtfDict *self)
 Clears the contents of a GtfDict object.
 
static int iterate_popitem (void *const context, void *const value)
 
static PyObject * GtfDict_popitem (GtfDict *self)
 
static PyObject * GtfDict_setdefault (GtfDict *self, PyObject *args)
 
static void GtfDict_dealloc (GtfDict *restrict self)
 Custom deallocator that deallocates all the core attributes.
 
static PyObject * GtfDict_repr (PyObject *restrict self)
 A custom repr method that returns a dict representation of the GtfDict.
 
static int iterate_store (void *const context, void *const e)
 
static PyObject * GtfDict_attributes (GtfDict *restrict self)
 Returns a dict representation of the attributes of the GtfDict.
 
static PyObject * GtfDict_getstate (GtfDict *restrict self)
 Returns the state of the GtfDict as a tuple.
 
static PyObject * GtfDict_setstate (PyObject *self, PyObject *state)
 Creates a new GtfDict from a state tuple.
 

Variables

static PyMethodDef GtfDict_methods []
 All the methods of the GtfDict class.
 
static PySequenceMethods GtfDictSeq
 The sequence methods of the GtfDict class.
 
static PyMappingMethods GtfDictMap
 The mapping methods of the GtfDict class.
 
PyTypeObject GtfDictType
 The Python type definition for the GtfDict object.
 

Detailed Description

Implementation of the GtfDict class.

Function Documentation

◆ GtfDict_containsValue()

int GtfDict_containsValue ( GtfDict *restrict  self,
PyObject *restrict  other 
)
Here is the caller graph for this function:

◆ GtfDict_popitem()

static PyObject * GtfDict_popitem ( GtfDict self)
static
Here is the call graph for this function:

◆ GtfDict_setdefault()

static PyObject * GtfDict_setdefault ( GtfDict self,
PyObject *  args 
)
static
Here is the call graph for this function:

◆ GtfDict_view_new()

static PyObject * GtfDict_view_new ( GtfDict self,
PyTypeObject *  type 
)
static
Here is the caller graph for this function:

◆ iterate_popitem()

static int iterate_popitem ( void *const  context,
void *const  value 
)
static
Here is the caller graph for this function:

◆ iterate_store()

static int iterate_store ( void *const  context,
void *const  e 
)
static
Here is the caller graph for this function:

◆ set_core_field()

static int set_core_field ( GtfDict *restrict  self,
unsigned char  i,
PyObject *restrict  value 
)
static

Sets a core field value by index.

Parameters
self
ithe index of the core field to set
valuethe value to set
Returns
-1 on error
Here is the caller graph for this function:

Variable Documentation

◆ GtfDict_methods

PyMethodDef GtfDict_methods[]
static

All the methods of the GtfDict class.

◆ GtfDictMap

PyMappingMethods GtfDictMap
static
Initial value:
= {
.mp_subscript = (binaryfunc)GtfDict_getitem,
.mp_ass_subscript = (objobjargproc)GtfDict_setitem}
PyObject * GtfDict_getitem(GtfDict *restrict self, PyObject *restrict key)
A custom getitem that also checks the core attributes.
Definition GtfDict.c:594
static int GtfDict_setitem(GtfDict *restrict self, PyObject *restrict key, PyObject *restrict value)
A custom setitem that also checks the core attributes.
Definition GtfDict.c:625

The mapping methods of the GtfDict class.

◆ GtfDictSeq

PySequenceMethods GtfDictSeq
static
Initial value:
= {.sq_contains =
(objobjproc)GtfDict_containsValue,
.sq_length = (lenfunc)GtfDict_len}
int GtfDict_containsValue(GtfDict *restrict self, PyObject *restrict other)
Definition GtfDict.c:443
static Py_ssize_t GtfDict_len(GtfDict *restrict self)
Custom len method that returns actually the result of subtracting start from end.
Definition GtfDict.c:570

The sequence methods of the GtfDict class.