Changed sequence 'description' to 'definition' everywhere

This commit is contained in:
Celine Mercier
2016-04-15 16:31:43 +02:00
parent 094b2371e9
commit 2aafecc3b5
10 changed files with 30 additions and 30 deletions

View File

@ -69,7 +69,7 @@ cdef class OBIView_NUC_SEQS(OBIView):
cdef OBIDMS_column ids cdef OBIDMS_column ids
cdef OBIDMS_column sequences cdef OBIDMS_column sequences
cdef OBIDMS_column descriptions cdef OBIDMS_column definitions
cpdef delete_column(self, str column_name) cpdef delete_column(self, str column_name)

View File

@ -69,7 +69,7 @@ from .capi.obiview cimport Obiview_p, \
VIEW_TYPE_NUC_SEQS, \ VIEW_TYPE_NUC_SEQS, \
NUC_SEQUENCE_COLUMN, \ NUC_SEQUENCE_COLUMN, \
ID_COLUMN, \ ID_COLUMN, \
DESCRIPTION_COLUMN DEFINITION_COLUMN
from libc.stdlib cimport malloc from libc.stdlib cimport malloc
from cpython.pycapsule cimport PyCapsule_New, PyCapsule_GetPointer from cpython.pycapsule cimport PyCapsule_New, PyCapsule_GetPointer
@ -529,7 +529,7 @@ cdef class OBIView_NUC_SEQS(OBIView):
self.ids = self.columns[bytes2str(ID_COLUMN)] self.ids = self.columns[bytes2str(ID_COLUMN)]
self.sequences = self.columns[bytes2str(NUC_SEQUENCE_COLUMN)] self.sequences = self.columns[bytes2str(NUC_SEQUENCE_COLUMN)]
self.descriptions = self.columns[bytes2str(DESCRIPTION_COLUMN)] self.definitions = self.columns[bytes2str(DEFINITION_COLUMN)]
cpdef delete_column(self, str column_name) : cpdef delete_column(self, str column_name) :
@ -542,7 +542,7 @@ cdef class OBIView_NUC_SEQS(OBIView):
cdef OBIDMS_column_header_p header cdef OBIDMS_column_header_p header
cdef str column_n cdef str column_n
if ((column_name == bytes2str(ID_COLUMN)) or (column_name == bytes2str(NUC_SEQUENCE_COLUMN)) or (column_name == bytes2str(DESCRIPTION_COLUMN))) : if ((column_name == bytes2str(ID_COLUMN)) or (column_name == bytes2str(NUC_SEQUENCE_COLUMN)) or (column_name == bytes2str(DEFINITION_COLUMN))) :
raise Exception("Can't delete an obligatory column from a NUC_SEQS view") raise Exception("Can't delete an obligatory column from a NUC_SEQS view")
view = self.pointer view = self.pointer

View File

@ -5,13 +5,13 @@ from ._obidms cimport OBIView_line
cdef class OBI_Seq(dict) : cdef class OBI_Seq(dict) :
cdef str id cdef str id
cdef str description cdef str definition
cdef str sequence cdef str sequence
cpdef set_id(self, str id) cpdef set_id(self, str id)
cpdef get_id(self) cpdef get_id(self)
cpdef set_description(self, str description) cpdef set_definition(self, str definition)
cpdef get_description(self) cpdef get_definition(self)
cpdef get_sequence(self) cpdef get_sequence(self)
@ -23,8 +23,8 @@ cdef class OBI_Nuc_Seq(OBI_Seq) :
cdef class OBI_Nuc_Seq_Stored(OBIView_line) : cdef class OBI_Nuc_Seq_Stored(OBIView_line) :
cpdef set_id(self, str id) cpdef set_id(self, str id)
cpdef get_id(self) cpdef get_id(self)
cpdef set_description(self, str description) cpdef set_definition(self, str definition)
cpdef get_description(self) cpdef get_definition(self)
cpdef set_sequence(self, str sequence) cpdef set_sequence(self, str sequence)
cpdef get_sequence(self) cpdef get_sequence(self)
# cpdef str reverse_complement(self) # cpdef str reverse_complement(self)

View File

@ -4,15 +4,15 @@ from obitools3.utils cimport bytes2str, str2bytes
from .capi.obiview cimport NUC_SEQUENCE_COLUMN, \ from .capi.obiview cimport NUC_SEQUENCE_COLUMN, \
ID_COLUMN, \ ID_COLUMN, \
DESCRIPTION_COLUMN DEFINITION_COLUMN
cdef class OBI_Seq(dict) : cdef class OBI_Seq(dict) :
def __init__(self, str id, str seq, str description=None) : def __init__(self, str id, str seq, str definition=None) :
self.set_id(id) self.set_id(id)
self.set_sequence(seq) self.set_sequence(seq)
if description is not None : if definition is not None :
self.set_description(description) self.set_definition(definition)
cpdef set_id(self, str id) : cpdef set_id(self, str id) :
self.id = id self.id = id
@ -21,12 +21,12 @@ cdef class OBI_Seq(dict) :
cpdef get_id(self) : cpdef get_id(self) :
return self.id return self.id
cpdef set_description(self, str description) : cpdef set_definition(self, str definition) :
self.description = description self.definition = definition
self[bytes2str(DESCRIPTION_COLUMN)] = description self[bytes2str(DEFINITION_COLUMN)] = definition
cpdef get_description(self) : cpdef get_definition(self) :
return self.description # TODO no return self.definition
cpdef get_sequence(self) : cpdef get_sequence(self) :
return self.sequence return self.sequence
@ -53,11 +53,11 @@ cdef class OBI_Nuc_Seq_Stored(OBIView_line) :
cpdef get_id(self) : cpdef get_id(self) :
return self[bytes2str(ID_COLUMN)] return self[bytes2str(ID_COLUMN)]
cpdef set_description(self, str description) : cpdef set_definition(self, str definition) :
self[bytes2str(DESCRIPTION_COLUMN)] = description self[bytes2str(DEFINITION_COLUMN)] = definition
cpdef get_description(self) : cpdef get_definition(self) :
return self[bytes2str(DESCRIPTION_COLUMN)] return self[bytes2str(DEFINITION_COLUMN)]
cpdef set_sequence(self, str sequence) : cpdef set_sequence(self, str sequence) :
self[bytes2str(NUC_SEQUENCE_COLUMN)] = sequence self[bytes2str(NUC_SEQUENCE_COLUMN)] = sequence

View File

@ -18,7 +18,7 @@ cdef extern from "obiview.h" nogil:
extern const_char_p VIEW_TYPE_NUC_SEQS extern const_char_p VIEW_TYPE_NUC_SEQS
extern const_char_p NUC_SEQUENCE_COLUMN extern const_char_p NUC_SEQUENCE_COLUMN
extern const_char_p ID_COLUMN extern const_char_p ID_COLUMN
extern const_char_p DESCRIPTION_COLUMN extern const_char_p DEFINITION_COLUMN
struct Column_reference_t : struct Column_reference_t :
const_char_p column_name const_char_p column_name

View File

@ -577,7 +577,7 @@ int obi_dms_unlist_indexer(OBIDMS_p dms, Obi_indexer_p indexer)
for (i=0; i < indexers_list->nb_opened_indexers; i++) for (i=0; i < indexers_list->nb_opened_indexers; i++)
{ {
if (!strcmp(((indexers_list->indexers)[i])->name, indexer->name)) // TODO it references something in AVL_group struct if (!strcmp(((indexers_list->indexers)[i])->name, indexer->name)) // TODO get_name function indexer
{ // Found the indexer. Rearrange list { // Found the indexer. Rearrange list
(indexers_list->nb_opened_indexers)--; (indexers_list->nb_opened_indexers)--;
(indexers_list->indexers)[i] = (indexers_list->indexers)[indexers_list->nb_opened_indexers]; (indexers_list->indexers)[i] = (indexers_list->indexers)[indexers_list->nb_opened_indexers];

View File

@ -42,7 +42,7 @@
*/ */
typedef int32_t obiversion_t; /**< TODO double typedef int32_t obiversion_t; /**< TODO put dans obitypes.h
*/ */

View File

@ -558,7 +558,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
if (((data_type == OBI_STR) || (data_type == OBI_SEQ)) && (strcmp(indexer_name, "") == 0)) if (((data_type == OBI_STR) || (data_type == OBI_SEQ)) && (strcmp(indexer_name, "") == 0))
{ // TODO make function in obiblob_indexer.c and discuss the fact that it's here { // TODO make function in obiblob_indexer.c and discuss the fact that it's here
strcpy(final_indexer_name, column_name); strcpy(final_indexer_name, column_name);
strcat(final_indexer_name, "_indexer"); strcat(final_indexer_name, "_indexer"); // TODO _version_indexer
} }
else else
strcpy(final_indexer_name, indexer_name); strcpy(final_indexer_name, indexer_name);

View File

@ -310,8 +310,8 @@ Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p v
obidebug(1, "Error adding an obligatory column in a nucleotide sequences view"); obidebug(1, "Error adding an obligatory column in a nucleotide sequences view");
return NULL; return NULL;
} }
// Adding description column // Adding definition column
if (obi_view_add_column(view, DESCRIPTION_COLUMN, -1, OBI_STR, 0, 1, DESCRIPTION_COLUMN, DESCRIPTION_INDEXER, "Descriptions", true) < 0) if (obi_view_add_column(view, DEFINITION_COLUMN, -1, OBI_STR, 0, 1, DEFINITION_COLUMN, DEFINITION_INDEXER, "Definitions", true) < 0)
{ {
obidebug(1, "Error adding an obligatory column in a nucleotide sequences view"); obidebug(1, "Error adding an obligatory column in a nucleotide sequences view");
return NULL; return NULL;

View File

@ -42,8 +42,8 @@
#define ID_COLUMN "ID" #define ID_COLUMN "ID"
#define ID_INDEXER "ID_INDEXER" #define ID_INDEXER "ID_INDEXER"
#define DESCRIPTION_COLUMN "DESCRIPTION" #define DEFINITION_COLUMN "DEFINITION"
#define DESCRIPTION_INDEXER "DESCRIPTION_INDEXER" #define DEFINITION_INDEXER "DEFINITION_INDEXER"
#define LINES_COLUMN_NAME "LINES" #define LINES_COLUMN_NAME "LINES"