eccLib 1.1.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
FastaBuff

All methods and objects related to the FastaBuff object. More...

Data Structures

struct  FastaBuff
 A buffer that holds packed uint4 FASTA data. More...
 

Functions

static int FastaBuff_init (FastaBuff *self, PyObject *restrict args, PyObject *restrict kwds)
 Initializes a FastaBuff object.
 
static Py_ssize_t FastaBuff_len (FastaBuff *self)
 Returns the length of the FastaBuff.
 
static PyObject * FastaBuff_str (FastaBuff *self)
 Converts the FastaBuff to a string.
 
static int FastaBuff_setItem (FastaBuff *self, Py_ssize_t index, PyObject *value)
 Sets a part of the sequence.
 
static int FastaBuff_contains (FastaBuff *restrict self, PyObject *restrict value)
 Checks if the FastaBuff contains the specified value.
 
static PyObject * FastaBuff_index (FastaBuff *restrict self, PyObject *restrict args)
 Returns the index of the first occurrence of the specified value in this FastaBuff.
 
static PyObject * FastaBuff_count (FastaBuff *restrict self, PyObject *restrict args)
 Counts the number of occurrences of the specified value in this FastaBuff.
 
static PyObject * FastaBuff_dump (FastaBuff *restrict self, PyObject *args)
 Converts the FastaBuff to a bytes object.
 
static PyObject * FastaBuff_get_annotated (FastaBuff *restrict self, PyObject *restrict args)
 Returns the annotated sequence.
 
static PyObject * FastaBuff_richcompare (FastaBuff *restrict self, PyObject *restrict other, const int op)
 FastaBuff comparison function.
 
static PyObject * FastaBuff_getSubscript (FastaBuff *restrict self, PyObject *restrict key)
 Gets a subsequence of the FastaBuff.
 
static PyObject * FastaBuff_find (FastaBuff *restrict self, PyObject *restrict args)
 Finds occurrences of the specified sequence in this FastaBuff.
 
static void FastaBuff_dealloc (FastaBuff *self)
 Deallocates the FastaBuff.
 

Variables

PyTypeObject FastaBuffType
 The Python type definition for the FastaBuff object.
 

Detailed Description

All methods and objects related to the FastaBuff object.

The FastaBuff object is a memory efficient buffer for FASTA data. It stores the data in a packed format, with each byte containing two 4 bit values. This allows for a 50% reduction in memory usage compared to a regular byte array. The object also provides methods for easy manipulation of the data.

Function Documentation

◆ FastaBuff_contains()

static int FastaBuff_contains ( FastaBuff *restrict  self,
PyObject *restrict  value 
)
static

Checks if the FastaBuff contains the specified value.

Parameters
selfthe FastaBuff to search in
valuethe value to search for
Returns
1 if the FastaBuff contains the value, 0 if it does not, -1 on error
Here is the call graph for this function:

◆ FastaBuff_count()

static PyObject * FastaBuff_count ( FastaBuff *restrict  self,
PyObject *restrict  args 
)
static

Counts the number of occurrences of the specified value in this FastaBuff.

Parameters
selfthe FastaBuff to search in
argsthe arguments to search for
Returns
the number of occurrences of the specified value
Here is the call graph for this function:

◆ FastaBuff_dealloc()

static void FastaBuff_dealloc ( FastaBuff self)
static

Deallocates the FastaBuff.

Parameters
selfthe FastaBuff to deallocate

◆ FastaBuff_dump()

static PyObject * FastaBuff_dump ( FastaBuff *restrict  self,
PyObject *  args 
)
static

Converts the FastaBuff to a bytes object.

Parameters
selfthe FastaBuff to convert
argsunused
Returns
the bytes representation of the FastaBuff

◆ FastaBuff_find()

static PyObject * FastaBuff_find ( FastaBuff *restrict  self,
PyObject *restrict  args 
)
static

Finds occurrences of the specified sequence in this FastaBuff.

Parameters
selfthe FastaBuff to search in
argsthe arguments to search for
Returns
a list of the indices of the first occurrence of the specified sequence in this FastaBuff.
Here is the call graph for this function:

◆ FastaBuff_get_annotated()

static PyObject * FastaBuff_get_annotated ( FastaBuff *restrict  self,
PyObject *restrict  args 
)
static

Returns the annotated sequence.

Parameters
selfthe FastaBuff to get the annotated sequence from
argsthe arguments to get the annotated sequence with
Returns
the annotated sequence
Here is the call graph for this function:

◆ FastaBuff_getSubscript()

static PyObject * FastaBuff_getSubscript ( FastaBuff *restrict  self,
PyObject *restrict  key 
)
static

Gets a subsequence of the FastaBuff.

Parameters
selfthe FastaBuff to get the subsequence from
keythe key to get the subsequence with
Returns
the subsequence
Here is the call graph for this function:

◆ FastaBuff_index()

static PyObject * FastaBuff_index ( FastaBuff *restrict  self,
PyObject *restrict  args 
)
static

Returns the index of the first occurrence of the specified value in this FastaBuff.

Parameters
selfthe FastaBuff to search in
argsthe arguments to search for
Returns
the index of the first occurrence of the specified value, or -1 on error
Here is the call graph for this function:

◆ FastaBuff_init()

static int FastaBuff_init ( FastaBuff self,
PyObject *restrict  args,
PyObject *restrict  kwds 
)
static

Initializes a FastaBuff object.

Parameters
selfthe FastaBuff to initialize
argsthe arguments to initialize the FastaBuff with
kwdsthe keyword arguments to initialize the FastaBuff with. Should always be NULL
Here is the call graph for this function:

◆ FastaBuff_len()

static Py_ssize_t FastaBuff_len ( FastaBuff self)
static

Returns the length of the FastaBuff.

Parameters
selfthe FastaBuff to get the length of
Returns
the length of the FastaBuff

◆ FastaBuff_richcompare()

static PyObject * FastaBuff_richcompare ( FastaBuff *restrict  self,
PyObject *restrict  other,
const int  op 
)
static

FastaBuff comparison function.

Parameters
selfthe FastaBuff to compare
otherthe other object to compare
opthe operation to perform
Returns
the result of the comparison
Here is the call graph for this function:

◆ FastaBuff_setItem()

static int FastaBuff_setItem ( FastaBuff self,
Py_ssize_t  index,
PyObject *  value 
)
static

Sets a part of the sequence.

Parameters
selfthe FastaBuff to set the part in
indexthe index to set the part at
valuethe value to set
Returns
0 on success, -1 on error

◆ FastaBuff_str()

static PyObject * FastaBuff_str ( FastaBuff self)
static

Converts the FastaBuff to a string.

Parameters
selfthe FastaBuff to convert
Returns
the string representation of the FastaBuff
Here is the call graph for this function:

Variable Documentation

◆ FastaBuffType

PyTypeObject FastaBuffType
extern

The Python type definition for the FastaBuff object.