ARB
Classes | Macros | Functions
adseqcompr.cxx File Reference
#include <arb_progress.h>
#include <arb_file.h>
#include <arb_misc.h>
#include <arb_diff.h>
#include "ad_cb.h"
#include "gb_key.h"
#include "TreeNode.h"
#include <climits>
Include dependency graph for adseqcompr.cxx:

Go to the source code of this file.

Classes

struct  CompressionRoot
 
class  FINAL_TYPE< SEQTYPE >
 xml element More...
 
struct  Consensus
 
struct  Sequence
 
struct  MasterSequence
 

Macros

#define MAX_SEQUENCE_PER_MASTER   50
 
#define MAX_NUMBER   0x7fffffff
 

Functions

static Consensusg_b_new_Consensus (long len)
 
static void g_b_delete_Consensus (Consensus *gcon)
 
static void g_b_Consensus_add (Consensus *gcon, unsigned char *seq, long seq_len)
 
static charg_b_Consensus_get_sequence (Consensus *gcon)
 
static int g_b_count_leafs (CompressionTree *node)
 
static void g_b_put_sequences_in_container (CompressionTree *ctree, Sequence *seqs, MasterSequence **masters, Consensus *gcon)
 
static void g_b_create_master (CompressionTree *node, Sequence *seqs, MasterSequence **masters, int my_master, const char *ali_name, long seq_len, arb_progress &progress)
 
static void subtract_sons_from_tree (CompressionTree *node, int subtract)
 
static int set_masters_with_sons (CompressionTree *node, int wantedSons, long *mcount)
 
static int maxCompressionSteps (CompressionTree *node)
 
static int init_indices_and_count_sons (CompressionTree *node, long *scount, const char *ali_name)
 
static void distribute_masters (CompressionTree *tree, long *mcount, int *max_masters)
 
 STATIC_ASSERT (MAX_NUMBER<=INT_MAX)
 
int g_b_read_number2 (const unsigned char *&s)
 
void g_b_put_number2 (int i, unsigned char *&s)
 
static chargb_compress_seq_by_master (const char *master, size_t master_len, int master_index, GBQUARK q, const char *seq, size_t seq_len, size_t *memsize, int old_flag)
 
static chargb_compress_sequence_by_master (GBDATA *gbd, const char *master, size_t master_len, int master_index, GBQUARK q, const char *seq, size_t seq_len, size_t *memsize)
 
static GB_ERROR compress_sequence_tree (GBCONTAINER *gb_main, CompressionTree *tree, const char *ali_name)
 
GB_ERROR GBT_compress_sequence_tree2 (GBDATA *gbd, const char *tree_name, const char *ali_name)
 
static charg_b_uncompress_single_sequence_by_master (const char *s, const char *master, size_t size, size_t *new_size)
 
chargb_uncompress_by_sequence (GBDATA *gbd, const char *ss, size_t size, GB_ERROR *error, size_t *new_size)
 

Macro Definition Documentation

#define MAX_SEQUENCE_PER_MASTER   50
#define MAX_NUMBER   0x7fffffff

Definition at line 324 of file adseqcompr.cxx.

Referenced by g_b_put_number2(), and g_b_read_number2().

Function Documentation

static Consensus* g_b_new_Consensus ( long  len)
static

Definition at line 81 of file adseqcompr.cxx.

References Consensus::con, and Consensus::len.

Referenced by g_b_create_master().

static void g_b_delete_Consensus ( Consensus gcon)
static

Definition at line 94 of file adseqcompr.cxx.

References Consensus::con.

Referenced by g_b_create_master().

static void g_b_Consensus_add ( Consensus gcon,
unsigned char seq,
long  seq_len 
)
static
static char* g_b_Consensus_get_sequence ( Consensus gcon)
static

Definition at line 147 of file adseqcompr.cxx.

References Consensus::con, Consensus::len, max, s, seq, and Consensus::used.

Referenced by g_b_create_master().

static int g_b_count_leafs ( CompressionTree *  node)
static

Definition at line 173 of file adseqcompr.cxx.

References NULp.

Referenced by compress_sequence_tree().

static void g_b_put_sequences_in_container ( CompressionTree *  ctree,
Sequence seqs,
MasterSequence **  masters,
Consensus gcon 
)
static
static void g_b_create_master ( CompressionTree *  node,
Sequence seqs,
MasterSequence **  masters,
int  my_master,
const char ali_name,
long  seq_len,
arb_progress progress 
)
static
static void subtract_sons_from_tree ( CompressionTree *  node,
int  subtract 
)
static

Definition at line 239 of file adseqcompr.cxx.

Referenced by set_masters_with_sons().

static int set_masters_with_sons ( CompressionTree *  node,
int  wantedSons,
long mcount 
)
static

Definition at line 246 of file adseqcompr.cxx.

References gb_assert, MAX_SEQUENCE_PER_MASTER, and subtract_sons_from_tree().

Referenced by distribute_masters().

static int maxCompressionSteps ( CompressionTree *  node)
static

Definition at line 271 of file adseqcompr.cxx.

References GBS_global_string_copy().

Referenced by distribute_masters().

static int init_indices_and_count_sons ( CompressionTree *  node,
long scount,
const char ali_name 
)
static

Definition at line 289 of file adseqcompr.cxx.

References GBT_find_sequence().

Referenced by compress_sequence_tree().

static void distribute_masters ( CompressionTree *  tree,
long mcount,
int max_masters 
)
static
STATIC_ASSERT ( MAX_NUMBER<=  INT_MAX)
int g_b_read_number2 ( const unsigned char *&  s)
inline

Definition at line 327 of file adseqcompr.cxx.

References gb_assert, MAX_NUMBER, and result.

Referenced by gb_uncompress_by_sequence().

void g_b_put_number2 ( int  i,
unsigned char *&  s 
)
inline

Definition at line 359 of file adseqcompr.cxx.

References gb_assert, and MAX_NUMBER.

Referenced by gb_compress_seq_by_master().

static char* gb_compress_seq_by_master ( const char master,
size_t  master_len,
int  master_index,
GBQUARK  q,
const char seq,
size_t  seq_len,
size_t *  memsize,
int  old_flag 
)
static
static char* gb_compress_sequence_by_master ( GBDATA gbd,
const char master,
size_t  master_len,
int  master_index,
GBQUARK  q,
const char seq,
size_t  seq_len,
size_t *  memsize 
)
static
static GB_ERROR compress_sequence_tree ( GBCONTAINER gb_main,
CompressionTree *  tree,
const char ali_name 
)
static
GB_ERROR GBT_compress_sequence_tree2 ( GBDATA gbd,
const char tree_name,
const char ali_name 
)
static char* g_b_uncompress_single_sequence_by_master ( const char s,
const char master,
size_t  size,
size_t *  new_size 
)
static

Definition at line 960 of file adseqcompr.cxx.

References buffer, gb_assert, GB_give_other_buffer(), and GB_internal_error().

Referenced by gb_uncompress_by_sequence().

char* gb_uncompress_by_sequence ( GBDATA gbd,
const char ss,
size_t  size,
GB_ERROR error,
size_t *  new_size 
)