obi test: minor changes

This commit is contained in:
Celine Mercier
2017-07-05 14:37:27 +02:00
parent 20c72af697
commit 3f5fef10b9

View File

@ -1,3 +1,5 @@
#cython: language_level=3
from obitools3.apps.progress cimport ProgressBar # TODO I absolutely don't understand why it doesn't work without that line from obitools3.apps.progress cimport ProgressBar # TODO I absolutely don't understand why it doesn't work without that line
from obitools3.dms.view.view import View, Line_selection from obitools3.dms.view.view import View, Line_selection
from obitools3.dms.view.typed_view.view_NUC_SEQS import View_NUC_SEQS from obitools3.dms.view.typed_view.view_NUC_SEQS import View_NUC_SEQS
@ -5,15 +7,19 @@ from obitools3.dms.dms import DMS
from obitools3.dms.column import Column from obitools3.dms.column import Column
from obitools3.dms.taxo.taxo import OBI_Taxonomy from obitools3.dms.taxo.taxo import OBI_Taxonomy
from obitools3.utils cimport str2bytes from obitools3.utils cimport str2bytes
from obitools3.dms.capi.obitypes cimport OBI_INT, \
OBI_FLOAT, \
OBI_BOOL, \
OBI_CHAR, \
OBI_STR, \
OBI_SEQ
import shutil import shutil
import string import string
import random import random
VIEW_TYPES = ["", "NUC_SEQS_VIEW"] VIEW_TYPES = ["", "NUC_SEQS_VIEW"]
#COL_TYPES = ["OBI_BOOL", "OBI_CHAR", "OBI_FLOAT", "OBI_INT", "OBI_SEQ", "OBI_STR"] COL_TYPES = [OBI_INT, OBI_FLOAT, OBI_BOOL, OBI_CHAR, OBI_STR, OBI_SEQ]
COL_TYPES = [1, 2, 3, 4, 6, 7]
NUC_SEQUENCE_COLUMN = "NUC_SEQ" NUC_SEQUENCE_COLUMN = "NUC_SEQ"
ID_COLUMN = "ID" ID_COLUMN = "ID"
DEFINITION_COLUMN = "DEFINITION" DEFINITION_COLUMN = "DEFINITION"
@ -35,7 +41,6 @@ default_config = {
} }
def test_taxo(config, infos): def test_taxo(config, infos):
tax1 = OBI_Taxonomy.open(infos['dms'], config['obi']['taxo'], taxdump=True) tax1 = OBI_Taxonomy.open(infos['dms'], config['obi']['taxo'], taxdump=True)
tax1.write(TAXTEST) tax1.write(TAXTEST)
@ -309,11 +314,12 @@ def addOptions(parser):
help="Name of the default DMS for reading and writing data. " help="Name of the default DMS for reading and writing data. "
"Default: /tmp/test_dms") "Default: /tmp/test_dms")
group.add_argument('--taxo','-t', group.add_argument('--taxo','-t', # TODO I don't understand why the option is not registered if it is not set
action="store", dest="obi:taxo", action="store", dest="obi:taxo",
metavar='<TAXDUMP PATH>', metavar='<TAXDUMP PATH>',
default='', # TODO not None because if it's None, the option is not entered in the option dictionary.
type=str, type=str,
help="Path to a taxdump to test the taxonomy.") # TODO help="Path to a taxdump to test the taxonomy.")
group=parser.add_argument_group('obi test specific options') group=parser.add_argument_group('obi test specific options')
@ -419,6 +425,7 @@ def run(config):
#print(infos) #print(infos)
if config['obi']['taxo'] != '' :
test_taxo(config, infos) test_taxo(config, infos)
infos['view'].close() infos['view'].close()