Fixed a bug when sending a DMS path to a C function from Cython

This commit is contained in:
Celine Mercier
2019-08-18 19:43:51 +02:00
parent 13952358b3
commit 66441e0aef
6 changed files with 18 additions and 7 deletions

View File

@ -229,7 +229,7 @@ def run(config):
# Call cython alignment function
# Using default ID columns of the view. TODO discuss adding option
align_columns(i_dms.full_path, \
align_columns(i_dms.name_with_full_path, \
i_view_name, \
o_view_name, \
input_view_2_n = i_view_name_2, \

View File

@ -81,7 +81,7 @@ def run(config):
input_view_name.append("taxonomy/"+config['obi']['taxoURI'].split("/")[-1])
comments = View.print_config(config, "build_ref_db", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name)
if build_reference_db(i_dms.full_path, tobytes(i_view_name), tobytes(taxonomy_name), tobytes(o_view_name), comments, config['build_ref_db']['threshold']) < 0:
if build_reference_db(i_dms.name_with_full_path, tobytes(i_view_name), tobytes(taxonomy_name), tobytes(o_view_name), comments, config['build_ref_db']['threshold']) < 0:
raise Exception("Error building a reference database")
# If the input and output DMS are not the same, export result view to output DMS

View File

@ -107,7 +107,7 @@ def run(config):
command_line = " ".join(sys.argv[1:])
comments = View.print_config(config, "clean", command_line, input_dms_name=[i_dms_name], input_view_name=[i_view_name])
if obi_clean(i_dms.full_path, tobytes(i_view_name), tobytes(config['clean']['sample-tag-name']), tobytes(o_view_name), comments, \
if obi_clean(i_dms.name_with_full_path, tobytes(i_view_name), tobytes(config['clean']['sample-tag-name']), tobytes(o_view_name), comments, \
config['clean']['distance'], config['clean']['ratio'], config['clean']['heads-only'], config['clean']['thread-count']) < 0:
raise Exception("Error running obiclean")

View File

@ -178,8 +178,8 @@ def run(config):
# TODO: primers in comments?
if obi_ecopcr(i_dms.full_path, tobytes(i_view_name), tobytes(taxonomy_name), \
o_dms.full_path, tobytes(o_view_name), comments, \
if obi_ecopcr(i_dms.name_with_full_path, tobytes(i_view_name), tobytes(taxonomy_name), \
o_dms.name_with_full_path, tobytes(o_view_name), comments, \
tobytes(config['ecopcr']['primer1']), tobytes(config['ecopcr']['primer2']), \
config['ecopcr']['error'], \
config['ecopcr']['min-length'], config['ecopcr']['max-length'], \

View File

@ -101,7 +101,7 @@ def run(config):
input_view_name.append("taxonomy/"+config['obi']['taxoURI'].split("/")[-1])
comments = View.print_config(config, "ecotag", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name)
if obi_ecotag(i_dms.full_path, tobytes(i_view_name), \
if obi_ecotag(i_dms.name_with_full_path, tobytes(i_view_name), \
tobytes(ref_dms_name), tobytes(ref_view_name), \
tobytes(taxo_dms_name), tobytes(taxonomy_name), \
tobytes(o_view_name), comments,

View File

@ -122,13 +122,24 @@ cdef class DMS(OBIWrapper):
@property
def full_path(self) :
'''
Returns the full path of the DMS directory
Returns the full path including the name with the extension of the DMS directory
@rtype: bytes
'''
return <bytes> self.pointer().directory_path
# DMS name with full path property getter
@property
def name_with_full_path(self) :
'''
Returns the full path with the name (meaning without the '.obidms' extension) of the DMS directory
@rtype: bytes
'''
return <bytes> self.full_path[:-7]
# command history DOT graph property getter in the form of a bytes string
@property
def dot_history_graph(self):