eccLib 1.3.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
GtfList.c File Reference

Contains the implementation of the GtfList object. More...

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

Functions

static int GtfList_init (GtfList *restrict self, PyObject *args, PyObject *restrict kwds)
 Initializes a new GtfList object.
 
static PyObject * GtfList_findHost (GtfList *restrict self, PyObject *restrict gene)
 Finds the host gene of the gene in args assuming this object contains the correct host gene.
 
static int GtfList_mp_ass_subscript (GtfList *restrict self, PyObject *restrict key, PyObject *restrict value)
 Wrapper over the default setitem that performs a type check.
 
static PyObject * GtfList_append (GtfList *restrict self, PyObject *restrict new)
 Wrapper over list.append that throws a type error if the provided arg is not a GtfDict.
 
static PyObject * GtfList_inplace_concat (GtfList *restrict self, PyObject *restrict o)
 concatenates o to self
 
static PyObject * GtfList_extend (GtfList *restrict self, PyObject *restrict iterable)
 Custom list extend that does a type check.
 
static PyObject * GtfList_insert (GtfList *restrict self, PyObject *restrict args)
 A wrapper over the default list insert that does a type check.
 
static PyObject * GtfList_concat (GtfList *restrict self, PyObject *restrict other)
 non discriminatory implementation of add. Does no checks and returns a LIST
 
static PyObject * GtfList_str (GtfList *restrict self)
 Generates a complete GTF file.
 
static PyObject * GtfList_repr (GtfList *restrict self)
 Generates a representation of the GtfList object.
 
static PyObject * GtfList_sq_split (GtfList *restrict self)
 Splits the gene list into a dict of GtfLists with each GtfList having only one seqname.
 
static PyObject * GtfList_column (GtfList *restrict self, PyObject *restrict key)
 Gets the values of a column in the GtfList.
 
static PyObject * GtfList_find (GtfList *restrict self, PyObject *restrict args, PyObject *restrict kwargs)
 Finds a sequence within the GtfList.
 
static PyObject * GtfList_get_contigs (GtfList *restrict self)
 
PyObject * GtfList_new (Py_ssize_t len)
 Creates a new GtfList object.
 

Variables

static char newline = '\n'
 
static PyMethodDef GtfList_methods []
 The methods of the GtfList object.
 
static PySequenceMethods GtfListSq
 The sequence methods of the GtfList object.
 
static PyMappingMethods GtfListMap
 The mapping methods of the GtfList object.
 
PyTypeObject GtfListType
 The Python type definition for the GtfList object.
 

Detailed Description

Contains the implementation of the GtfList object.

Function Documentation

◆ GtfList_get_contigs()

static PyObject * GtfList_get_contigs ( GtfList *restrict self)
static
Here is the call graph for this function:

◆ GtfList_new()

PyObject * GtfList_new ( Py_ssize_t len)

Creates a new GtfList object.

Parameters
lenthe length of the list
Returns
a new GtfList object
Here is the caller graph for this function:

Variable Documentation

◆ GtfList_methods

PyMethodDef GtfList_methods[]
static
Initial value:
= {
{"find_closest_bound", (PyCFunction)GtfList_findHost, METH_O,
"Returns None or the approximate host gene of the provided GtfDict"},
{"append", (PyCFunction)GtfList_append, METH_O,
"Appends the provided element to the GtfList"},
{"extend", (PyCFunction)GtfList_extend, METH_O,
"Extends the gene list with the provided iterable"},
{"insert", (PyCFunction)GtfList_insert, METH_VARARGS,
"Inserts the provided object at the provided position"},
{"sq_split", (PyCFunction)GtfList_sq_split, METH_NOARGS,
"Splits this gene list by the seqnames"},
{"find", (PyCFunction)GtfList_find, METH_VARARGS | METH_KEYWORDS,
"Splits this gene list by the seqnames"},
{"column", (PyCFunction)GtfList_column, METH_O,
"Returns a list of the values of the provided key"},
{"get_contigs", (PyCFunction)GtfList_get_contigs, METH_NOARGS,
"Returns a list of the contig ranges of the genes"},
{NULL, NULL, 0, NULL}
}
static PyObject * GtfList_get_contigs(GtfList *restrict self)
Definition GtfList.c:523
static PyObject * GtfList_sq_split(GtfList *restrict self)
Splits the gene list into a dict of GtfLists with each GtfList having only one seqname.
Definition GtfList.c:348
static PyObject * GtfList_insert(GtfList *restrict self, PyObject *restrict args)
A wrapper over the default list insert that does a type check.
Definition GtfList.c:259
static PyObject * GtfList_append(GtfList *restrict self, PyObject *restrict new)
Wrapper over list.append that throws a type error if the provided arg is not a GtfDict.
Definition GtfList.c:186
static PyObject * GtfList_extend(GtfList *restrict self, PyObject *restrict iterable)
Custom list extend that does a type check.
Definition GtfList.c:239
static PyObject * GtfList_find(GtfList *restrict self, PyObject *restrict args, PyObject *restrict kwargs)
Finds a sequence within the GtfList.
Definition GtfList.c:404
static PyObject * GtfList_column(GtfList *restrict self, PyObject *restrict key)
Gets the values of a column in the GtfList.
Definition GtfList.c:377
static PyObject * GtfList_findHost(GtfList *restrict self, PyObject *restrict gene)
Finds the host gene of the gene in args assuming this object contains the correct host gene.
Definition GtfList.c:110

The methods of the GtfList object.

◆ GtfListMap

PyMappingMethods GtfListMap
static
Initial value:
= {
.mp_ass_subscript = (objobjargproc)GtfList_mp_ass_subscript}
static int GtfList_mp_ass_subscript(GtfList *restrict self, PyObject *restrict key, PyObject *restrict value)
Wrapper over the default setitem that performs a type check.
Definition GtfList.c:149

The mapping methods of the GtfList object.

◆ GtfListSq

PySequenceMethods GtfListSq
static
Initial value:
= {.sq_inplace_concat =
.sq_concat = (binaryfunc)GtfList_concat}
static PyObject * GtfList_inplace_concat(GtfList *restrict self, PyObject *restrict o)
concatenates o to self
Definition GtfList.c:207
static PyObject * GtfList_concat(GtfList *restrict self, PyObject *restrict other)
non discriminatory implementation of add. Does no checks and returns a LIST
Definition GtfList.c:287

The sequence methods of the GtfList object.

◆ newline

char newline = '\n'
static