Reworked a bit alignment API

This commit is contained in:
Celine Mercier
2016-08-12 15:56:07 +02:00
parent 92cad61417
commit ad8e10f2d1
3 changed files with 11 additions and 25 deletions

View File

@ -8,10 +8,6 @@ __title__="Aligns one sequence column with itself or two sequence columns"
default_config = { 'inputview' : None,
'skip' : 0,
'only' : None,
'skiperror' : False,
'moltype' : 'nuc',
}
def addOptions(parser):
@ -31,8 +27,7 @@ def addOptions(parser):
metavar='<INPUT VIEW NAME>',
default=None,
type=str,
help="Name of the input view, either raw if the view is in the default DMS,"
" or in the form 'dms:view' if it is in another DMS.")
help="Name of the input view.")
# TODO eventually 2nd view, or 2nd column?
@ -41,8 +36,7 @@ def addOptions(parser):
metavar='<OUTPUT VIEW NAME>',
default=None,
type=str,
help="Name of the output view, either raw if the view is in the default DMS,"
" or in the form 'dms:view' if it is in another DMS.")
help="Name of the output view.")
group=parser.add_argument_group('obi align specific options')
@ -106,16 +100,17 @@ def run(config):
# TODO Open input view 2 if there is one
# Create output view if necessary
if config['obi']['outputview'] is not None :
oview = d.new_view(config['obi']['outputview'])
else :
oview = None
# Create output view
oview = d.new_view(config['obi']['outputview'])
# TODO Take other alignment types into account when they'll be implemented
# Call cython alignment function
iview.align(output_view=oview)
iview.align(oview)
iview.save_and_close()
oview.save_and_close()
d.close()
print("Done.")