Add a first group of options
This commit is contained in:
50
python/obitools3/apps/optiongroups/__init__.py
Normal file
50
python/obitools3/apps/optiongroups/__init__.py
Normal 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")
|
@ -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')
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user