Added functions to add new taxa to a taxonomy with handling of

associated *.ldx files
This commit is contained in:
Celine Mercier
2016-11-03 17:59:21 +01:00
parent 2504bf0fa9
commit 2d2fe5279d
5 changed files with 664 additions and 397 deletions

View File

@ -17,6 +17,10 @@
#include "obidms.h"
#define MIN_LOCAL_TAXID (10000000)
#define TAX_NAME_LEN (1024)
typedef struct {
int32_t taxid;
int32_t rank;
@ -33,11 +37,14 @@ typedef struct ecotxnode {
int32_t idx;
struct ecotxnode* parent;
char* name;
bool local;
} ecotx_t;
typedef struct {
int32_t count;
int32_t ncbi_count;
int32_t local_count;
int32_t max_taxid;
int32_t buffer_size;
ecotx_t taxon[1];
@ -74,6 +81,8 @@ typedef struct {
typedef struct OBIDMS_taxonomy_t {
char tax_name[TAX_NAME_LEN];
OBIDMS_p dms;
ecorankidx_t* ranks;
econameidx_t* names;
ecotxidx_t* taxa;
@ -109,3 +118,4 @@ int obi_write_taxonomy(OBIDMS_p dms, OBIDMS_taxonomy_p tax, const char* tax_name
OBIDMS_taxonomy_p obi_read_taxdump(const char* taxdump);
int obi_taxonomy_add_local_taxon(OBIDMS_taxonomy_p tax, const char* name, const char* rank_name, int32_t parent_taxid, int32_t min_taxid);