Add a first group of options

This commit is contained in:
2017-07-25 11:14:30 +02:00
parent 59dd0a8a8c
commit b24be84b0a
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,50 @@
def addInputOption(optionManager):
group = optionManager.add_argument_group("Restriction to a sub-part options",
"Allow to limit analysis to a sub-part of the data file")
group.add_argument('--skip',
action="store", dest="skip",
metavar='<N>',
default=None,
type='int',
help="skip the N first sequences")
group.add_argument('--only',
action="store", dest="only",
metavar='<N>',
default=None,
type='int',
help="treat only N sequences")
group = optionManager.add_argument_group("Input format options",
"If not specified, a test is done to determine the file format")
group.add_argument('--skip-on-error',
action="store_true", dest="skiperror",
default=False,
help="Skip sequence entries with parse error")
group.add_argument('--quality-sanger',
action="store_const", dest="seqinformat",
default=None,
const='sanger',
help="Input file is in sanger fastq nucleic format (standard fastq)")
group.add_argument('--quality-solexa',
action="store_const", dest="seqinformat",
default=None,
const='solexa',
help="Input file is in fastq nucleic format produced by solexa sequencer")
group.add_argument('--nuc',
action="store_const", dest="moltype",
default=None,
const='nuc',
help="Input file contains nucleic sequences")
group.add_argument('--prot',
action="store_const", dest="moltype",
default=None,
const='pep',
help="Input file contains protein sequences")

View File

@ -4,6 +4,8 @@ from obitools3.apps.progress cimport ProgressBar # @UnresolvedImport
from obitools3.dms.dms import DMS # TODO cimport doesn't work from obitools3.dms.dms import DMS # TODO cimport doesn't work
from obitools3.dms.view.view import View, Line_selection # TODO cimport doesn't work from obitools3.dms.view.view import View, Line_selection # TODO cimport doesn't work
from obitools3.apps.optiongroups import addInputOption
from functools import reduce from functools import reduce
import time import time
@ -15,6 +17,8 @@ default_config = { 'inputview' : None,
def addOptions(parser): def addOptions(parser):
addInputOption(parser)
# TODO put this common group somewhere else but I don't know where # TODO put this common group somewhere else but I don't know where
group=parser.add_argument_group('DMS and view options') group=parser.add_argument_group('DMS and view options')