26 dest = src = probestring;
28 while ((c=*(src++))) {
31 case 'a': *(dest++) =
PT_A;
break;
33 case 'c': *(dest++) =
PT_C;
break;
35 case 'g': *(dest++) =
PT_G;
break;
39 case 't': *(dest++) =
PT_T;
break;
41 case 'n': *(dest++) =
PT_N;
break;
71 uchar PT_compressed::translate[256];
72 bool PT_compressed::translation_initialized =
false;
74 #if defined(COUNT_COMPRESSES_BASES)
84 compressed.
createFrom(reinterpret_cast<unsigned char*>(seq), seqsize);
91 char *
readable_probe(
const char *compressed_probe,
size_t len,
char T_or_U) {
95 if (smart_tab.isNull()) {
97 memset(tab,
'?', 256);
113 char *
result = ARB_alloc<char>(len+1);
114 for (
size_t i = 0; i<len; ++i) {
141 gb_species = gb_species_;
153 data_missing =
false;
161 error =
GBS_global_string(
"Could not read data in '%s' for species '%s'\n(Reason: %s)",
167 error =
GBS_global_string(
"Sequence too long in '%s' of '%s'\n(Hint: format alignment to fix this problem)",
174 uint32_t checksum =
GB_checksum(seq, seqlen, 1,
".-");
207 if (!gb_species_data) {
212 int data_missing = 0;
224 printf(
"Database contains %li species\n", icount);
227 arb_progress progress(
"Preparing sequence data", icount);
229 gb_species && !
error;
242 gb_species = gb_next;
244 if (error) progress.
done();
250 if (gb_master_data) error =
GB_delete(gb_master_data);
251 free(master_data_name);
255 printf(
"\n%i species were ignored because of missing data.\n", data_missing);
258 printf(
"\nAll species contain data in alignment '%s'.\n", ali_name);
296 printf(
"Database contains %li species\n", icount);
309 error = pid.
init(gb_species);
318 if (error) progress.
done();
331 unsigned int max_size;
struct probe_input_data * data
GB_ERROR GB_begin_transaction(GBDATA *gbd)
GB_ERROR PT_prepare_species_sequence(GBDATA *gb_species, const char *alignment_name, bool &data_missing, PT_compressed &compressed)
GBDATA * GB_open(const char *path, const char *opent)
GB_ERROR GB_commit_transaction(GBDATA *gbd)
static GB_ERROR tab(GBL_command_arguments *args, bool pretab)
GB_ERROR GB_write_bytes(GBDATA *gbd, const char *s, long size)
long GBS_write_hash(GB_HASH *hs, const char *key, long val)
CONSTEXPR_INLINE unsigned char safeCharIndex(char c)
GB_ERROR GB_end_transaction(GBDATA *gbd, GB_ERROR error)
const unsigned * get_offsets() const
GB_ERROR PT_prepare_data(GBDATA *gb_main)
const char * GBS_global_string(const char *templat,...)
long GBT_get_alignment_len(GBDATA *gb_main, const char *aliname)
static char * alignment_name
uint32_t GB_checksum(const char *seq, long length, int ignore_case, const char *exclude)
size_t get_allowed_size() const
const char * get_seq() const
GBDATA * expect_entry(GBDATA *gb_species, const char *entry_name)
void createFrom(const unsigned char *const seq, const size_t length)
GB_ERROR GB_delete(GBDATA *&source)
GBDATA * GBT_first_species_rel_species_data(GBDATA *gb_species_data)
size_t GB_read_string_count(GBDATA *gbd)
GB_ERROR GB_await_error()
long GB_read_count(GBDATA *gbd)
int abs_2_rel(int abs) const
GB_ERROR PT_init_input_data()
TYPE * ARB_alloc(size_t nelem)
size_t probe_compress_sequence(char *seq, size_t seqsize)
GBDATA * GB_create(GBDATA *father, const char *key, GB_TYPES type)
long GB_number_of_subentries(GBDATA *gbd)
char * readable_probe(const char *compressed_probe, size_t len, char T_or_U)
int compress_data(char *probestring)
#define SmartMallocPtr(type)
static void error(const char *msg)
long PT_abs_2_ecoli_rel(long pos)
ARB_ERROR probe_read_data_base(const char *name, bool readOnly)
void PT_build_species_hash()
void init(const char *seq, int size)
char * GBT_get_default_ref(GBDATA *)
GBDATA * GBT_find_sequence(GBDATA *gb_species, const char *aliname)
GB_ERROR GB_write_int(GBDATA *gbd, long i)
bool GB_is_writeablefile(const char *filename)
GB_ERROR GB_export_errorf(const char *templat,...)
GB_ERROR GB_write_ints(GBDATA *gbd, const GB_UINT4 *i, long size)
char * GB_read_string(GBDATA *gbd)
GBDATA * GBT_next_species(GBDATA *gb_species)
char * GBT_get_default_alignment(GBDATA *gb_main)
GBDATA * GBT_find_SAI_rel_SAI_data(GBDATA *gb_sai_data, const char *name)
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
GBDATA * GBT_get_SAI_data(GBDATA *gb_main)
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
GB_CSTR GBT_get_name_or_description(GBDATA *gb_item)
GBDATA * GB_entry(GBDATA *father, const char *key)
char * GBS_global_string_copy(const char *templat,...)
GB_HASH * GBS_create_hash(long estimated_elements, GB_CASE case_sens)
GBDATA * GBT_get_species_data(GBDATA *gb_main)