Commands: updated for JSON formatted comments with history
This commit is contained in:
@ -9,16 +9,16 @@ from obitools3.dms.view import RollbackException
|
||||
from functools import reduce
|
||||
from obitools3.apps.config import logger
|
||||
from obitools3.utils cimport tobytes
|
||||
from obitools3.dms.capi.obiview cimport QUALITY_COLUMN
|
||||
import time
|
||||
import math
|
||||
|
||||
from obitools3.dms.capi.obiview cimport NUC_SEQUENCE_COLUMN, \
|
||||
ID_COLUMN, \
|
||||
DEFINITION_COLUMN, \
|
||||
QUALITY_COLUMN, \
|
||||
COUNT_COLUMN
|
||||
|
||||
import time
|
||||
import math
|
||||
import sys
|
||||
|
||||
|
||||
__title__="Annotate views with new tags and edit existing annotations"
|
||||
|
||||
@ -285,10 +285,10 @@ def run(config):
|
||||
output_view_name = uri[0]
|
||||
|
||||
# Clone output view from input view
|
||||
o_view = i_view.clone(output_view_name, comments=i_view.comments+b"\nobi annotate") # TODO comments
|
||||
o_view = i_view.clone(output_view_name, comments=i_view.comments) # TODO comments
|
||||
if o_view is None:
|
||||
raise Exception("Couldn't create output view")
|
||||
|
||||
|
||||
if 'taxoURI' in config['obi'] : # TODO default None problem
|
||||
taxo_uri = open_uri(config['obi']['taxoURI'])
|
||||
if taxo_uri is None:
|
||||
@ -341,6 +341,16 @@ def run(config):
|
||||
|
||||
except Exception, e:
|
||||
raise RollbackException("obi annotate error, rollbacking view: "+str(e), o_view)
|
||||
|
||||
# Save command config in View and DMS comments
|
||||
command_line = " ".join(sys.argv[1:])
|
||||
input_dms_name=[input[0].name]
|
||||
input_view_name=[input[1].name]
|
||||
if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None:
|
||||
input_dms_name.append(config['obi']['taxoURI'].split("/", 1)[0])
|
||||
input_view_name.append(config['obi']['taxoURI'].split("/", 1)[1])
|
||||
o_view.write_config(config, "annotate", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name)
|
||||
input[0].record_command_line(command_line) # TODO assuming same dms
|
||||
|
||||
print("\n")
|
||||
print(repr(o_view))
|
||||
|
Reference in New Issue
Block a user