XT-neighbor
Macros | Functions | Variables
codec.cu File Reference

A collection of conversion operations turning CDR3 strings into numerical representation. More...

#include "util.cu"
#include <string.h>

Macros

#define CODEC_DEF
 

Functions

int char_encode (char amino_acid)
 encode character into 5 bit value (0-31). More...
 
Int3 str_encode (char *str)
 encode peptide string into int3 struct with 6 characters encoded into an integer. More...
 
char * str_decode (Int3 binary)
 decode binary form into peptide string. More...
 
__device__ __host__ int len_decode (Int3 binary)
 find the string length in original form. More...
 
__device__ __host__ Int3 remove_char (Int3 binary, int position)
 remove one character from the string in binary form (without turning it into the original string form). More...
 
void print_int3_arr (Int3 *arr, int n)
 conviniently print Int3* in readable form. More...
 

Variables

const int A_CHAR = (int)'A'
 
const int BEFORE_A_CHAR = A_CHAR - 1
 
const int Y_CHAR = (int) 'Y'
 
const int ESTIMATE_LENGTH = 18
 
const int MAX_INPUT_LENGTH = 500
 

Detailed Description

A collection of conversion operations turning CDR3 strings into numerical representation.

Also includes utilities to directly edit the representation.

Macro Definition Documentation

◆ CODEC_DEF

#define CODEC_DEF

Function Documentation

◆ char_encode()

int char_encode ( char  amino_acid)

encode character into 5 bit value (0-31).

-1 for non amino acid character

◆ len_decode()

__device__ __host__ int len_decode ( Int3  binary)

find the string length in original form.

◆ print_int3_arr()

void print_int3_arr ( Int3 arr,
int  n 
)

conviniently print Int3* in readable form.

◆ remove_char()

__device__ __host__ Int3 remove_char ( Int3  binary,
int  position 
)

remove one character from the string in binary form (without turning it into the original string form).

◆ str_decode()

char* str_decode ( Int3  binary)

decode binary form into peptide string.

◆ str_encode()

Int3 str_encode ( char *  str)

encode peptide string into int3 struct with 6 characters encoded into an integer.

Variable Documentation

◆ A_CHAR

const int A_CHAR = (int)'A'

◆ BEFORE_A_CHAR

const int BEFORE_A_CHAR = A_CHAR - 1

◆ ESTIMATE_LENGTH

const int ESTIMATE_LENGTH = 18

◆ MAX_INPUT_LENGTH

const int MAX_INPUT_LENGTH = 500

◆ Y_CHAR

const int Y_CHAR = (int) 'Y'