Added atexit command to obi import, obi uniq and obi less
This commit is contained in:
@ -12,6 +12,7 @@ from obitools3.dms.view.view cimport View
|
|||||||
from obitools3.dms.view.typed_view.view_NUC_SEQS cimport View_NUC_SEQS
|
from obitools3.dms.view.typed_view.view_NUC_SEQS cimport View_NUC_SEQS
|
||||||
from obitools3.dms.column.column cimport Column
|
from obitools3.dms.column.column cimport Column
|
||||||
from obitools3.dms.obiseq cimport Nuc_Seq
|
from obitools3.dms.obiseq cimport Nuc_Seq
|
||||||
|
from obitools3.dms import DMS
|
||||||
|
|
||||||
from obitools3.utils cimport tobytes, \
|
from obitools3.utils cimport tobytes, \
|
||||||
get_obitype, \
|
get_obitype, \
|
||||||
@ -82,6 +83,7 @@ def run(config):
|
|||||||
cdef bytes NA_value
|
cdef bytes NA_value
|
||||||
global obi_errno
|
global obi_errno
|
||||||
|
|
||||||
|
DMS.obi_atexit()
|
||||||
|
|
||||||
logger("info","obi import : imports file into an DMS")
|
logger("info","obi import : imports file into an DMS")
|
||||||
|
|
||||||
@ -238,6 +240,6 @@ def run(config):
|
|||||||
print("\n")
|
print("\n")
|
||||||
print(view.__repr__())
|
print(view.__repr__())
|
||||||
|
|
||||||
input[0].close() # TODO
|
input[0].close() # TODO ?
|
||||||
output[0].close()
|
output[0].close()
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from obitools3.apps.optiongroups import addSequenceInputOption
|
from obitools3.apps.optiongroups import addSequenceInputOption
|
||||||
from obitools3.uri.decode import open_uri
|
from obitools3.uri.decode import open_uri
|
||||||
|
from obitools3.dms import DMS
|
||||||
|
|
||||||
|
|
||||||
__title__="Less equivalent"
|
__title__="Less equivalent"
|
||||||
@ -26,6 +27,8 @@ def run(config):
|
|||||||
cdef object entries
|
cdef object entries
|
||||||
cdef int n
|
cdef int n
|
||||||
|
|
||||||
|
DMS.obi_atexit()
|
||||||
|
|
||||||
input = open_uri(config['obi']['inputURI'])
|
input = open_uri(config['obi']['inputURI'])
|
||||||
|
|
||||||
entries = input[1]
|
entries = input[1]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#cython: language_level=3
|
#cython: language_level=3
|
||||||
|
|
||||||
from obitools3.apps.progress cimport ProgressBar # @UnresolvedImport
|
from obitools3.apps.progress cimport ProgressBar # @UnresolvedImport
|
||||||
from obitools3.dms.dms cimport DMS
|
from obitools3.dms import DMS
|
||||||
from obitools3.dms.view.view cimport View, Line
|
from obitools3.dms.view.view cimport View, Line
|
||||||
from obitools3.dms.view.typed_view.view_NUC_SEQS cimport View_NUC_SEQS
|
from obitools3.dms.view.typed_view.view_NUC_SEQS cimport View_NUC_SEQS
|
||||||
from obitools3.dms.column.column cimport Column, Column_line
|
from obitools3.dms.column.column cimport Column, Column_line
|
||||||
@ -44,6 +44,7 @@ def addOptions(parser):
|
|||||||
"used to group sequences before dereplication "
|
"used to group sequences before dereplication "
|
||||||
"(option can be used several times).")
|
"(option can be used several times).")
|
||||||
|
|
||||||
|
# TODO discuss
|
||||||
# group.add_argument('--prefix', '-p',
|
# group.add_argument('--prefix', '-p',
|
||||||
# action="store_true", dest="uniq:prefix",
|
# action="store_true", dest="uniq:prefix",
|
||||||
# default=False,
|
# default=False,
|
||||||
@ -400,7 +401,6 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, li
|
|||||||
merge_taxonomy_classification(o_view, taxonomy)
|
merge_taxonomy_classification(o_view, taxonomy)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def run(config):
|
def run(config):
|
||||||
|
|
||||||
cdef tuple input
|
cdef tuple input
|
||||||
@ -411,6 +411,8 @@ def run(config):
|
|||||||
cdef View_NUC_SEQS o_view
|
cdef View_NUC_SEQS o_view
|
||||||
cdef ProgressBar pb
|
cdef ProgressBar pb
|
||||||
|
|
||||||
|
DMS.obi_atexit()
|
||||||
|
|
||||||
logger("info","obi uniq")
|
logger("info","obi uniq")
|
||||||
|
|
||||||
input = open_uri(config['obi']['inputURI'])
|
input = open_uri(config['obi']['inputURI'])
|
||||||
@ -435,13 +437,7 @@ def run(config):
|
|||||||
# Initialize the progress bar
|
# Initialize the progress bar
|
||||||
pb = ProgressBar(len(entries), config, seconde=5)
|
pb = ProgressBar(len(entries), config, seconde=5)
|
||||||
|
|
||||||
# TODO
|
uniq_sequences(entries, o_view, pb, mergedKeys_list=config['uniq']['merge'], taxonomy=taxo, mergeIds=config['uniq']['mergeids'], categories=config['uniq']['categories'])
|
||||||
# if options.prefix:
|
|
||||||
# usm = uniqPrefixSequence
|
|
||||||
# else:
|
|
||||||
usm = uniq_sequences
|
|
||||||
|
|
||||||
usm(entries, o_view, pb, mergedKeys_list=config['uniq']['merge'], taxonomy=taxo, mergeIds=config['uniq']['mergeids'], categories=config['uniq']['categories'])
|
|
||||||
|
|
||||||
print("\n")
|
print("\n")
|
||||||
print(repr(o_view))
|
print(repr(o_view))
|
||||||
|
Reference in New Issue
Block a user