Options stuff... ;-)

This commit is contained in:
2017-07-25 13:07:03 +02:00
parent 28259cd88b
commit 0f6ae7dfa6
3 changed files with 22 additions and 9 deletions

View File

@ -21,9 +21,15 @@ default_config = { 'software' : "The OBITools",
'log' : False,
'loglevel' : 'INFO',
'progress' : True,
'inputURI' : None,
'defaultdms' : None,
'inputview' : None,
'outputview' : None
'outputview' : None,
'skip' : 0,
'only' : None,
'skiperror' : True,
'qualityformat' : 'sanger',
'moltype' : 'nuc'
}
root_config_name='obi'

View File

@ -1,17 +1,23 @@
def addInputOption(optionManager):
optionManager.add_argument(
dest='obi:inputURI',
metavar='index',
help='index root filename (produced by the oa index command)')
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",
action="store", dest="obi:skip",
metavar='<N>',
default=None,
type='int',
help="skip the N first sequences")
group.add_argument('--only',
action="store", dest="only",
action="store", dest="obi:only",
metavar='<N>',
default=None,
type='int',
@ -21,30 +27,30 @@ def addInputOption(optionManager):
"If not specified, a test is done to determine the file format")
group.add_argument('--skip-on-error',
action="store_true", dest="skiperror",
action="store_true", dest="obi:skiperror",
default=False,
help="Skip sequence entries with parse error")
group.add_argument('--quality-sanger',
action="store_const", dest="seqinformat",
action="store_const", dest="obi:qualityformat",
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",
action="store_const", dest="obi:qualityformat",
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",
action="store_const", dest="obi:moltype",
default=None,
const='nuc',
help="Input file contains nucleic sequences")
group.add_argument('--prot',
action="store_const", dest="moltype",
action="store_const", dest="obi:moltype",
default=None,
const='pep',
help="Input file contains protein sequences")

View File

@ -12,7 +12,8 @@ import time
__title__="Grep view lines that match the given predicates"
default_config = { 'inputview' : None,
'outputview' : None
'outputview' : None,
'predicates' : []
}
def addOptions(parser):