Complete the input option group functions
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
def addInputOption(optionManager):
|
||||
def __addInputOption(optionManager):
|
||||
|
||||
optionManager.add_argument(
|
||||
dest='obi:inputURI',
|
||||
@ -23,34 +23,141 @@ def addInputOption(optionManager):
|
||||
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")
|
||||
|
||||
|
||||
def __addSequenceInputOption(optionManager):
|
||||
group = optionManager.add_argument_group("Input format options for sequence files")
|
||||
|
||||
group.add_argument('--fasta',
|
||||
action="store_const", dest="obi:format",
|
||||
default=None,
|
||||
const=b'fasta',
|
||||
help="Input file is in sanger fasta format")
|
||||
|
||||
group.add_argument('--fastq',
|
||||
action="store_const", dest="obi:format",
|
||||
default=None,
|
||||
const=b'fastq',
|
||||
help="Input file is in fastq format")
|
||||
|
||||
group.add_argument('--embl',
|
||||
action="store_const", dest="obi:format",
|
||||
default=None,
|
||||
const=b'embl',
|
||||
help="Input file is in embl nucleic format")
|
||||
|
||||
group.add_argument('--genbank',
|
||||
action="store_const", dest="obi:format",
|
||||
default=None,
|
||||
const=b'genbank',
|
||||
help="Input file is in genbank nucleic format")
|
||||
|
||||
group.add_argument('--ngsfilter',
|
||||
action="store_const", dest="obi:format",
|
||||
default=None,
|
||||
const=b'ngsfilter',
|
||||
help="Input file is a ngsfilter file")
|
||||
|
||||
group.add_argument('--ecopcr-result',
|
||||
action="store_const", dest="obi:format",
|
||||
default=None,
|
||||
const=b'ecopcr',
|
||||
help="Input file is the result of an ecoPCR (version 2)")
|
||||
|
||||
group.add_argument('--ecoprimers-result',
|
||||
action="store_const", dest="obi:format",
|
||||
default=None,
|
||||
const=b'ecoprimers',
|
||||
help="Input file is the result of an ecoprimers")
|
||||
|
||||
group.add_argument('--skip-on-error',
|
||||
action="store_true", dest="obi:skiperror",
|
||||
default=False,
|
||||
help="Skip sequence entries with parse error")
|
||||
|
||||
group.add_argument('--no-quality',
|
||||
action="store_true", dest="obi:noquality",
|
||||
default=False,
|
||||
help="Do not import fastQ quality")
|
||||
|
||||
group.add_argument('--quality-sanger',
|
||||
action="store_const", dest="obi:qualityformat",
|
||||
default=None,
|
||||
const='sanger',
|
||||
help="Input file is in sanger fastq nucleic format (standard fastq)")
|
||||
const=b'sanger',
|
||||
help="Fastq quality is encoded following sanger format (standard fastq)")
|
||||
|
||||
group.add_argument('--quality-solexa',
|
||||
action="store_const", dest="obi:qualityformat",
|
||||
default=None,
|
||||
const='solexa',
|
||||
help="Input file is in fastq nucleic format produced by solexa sequencer")
|
||||
const=b'solexa',
|
||||
help="Fastq quality is encoded following solexa sequencer format")
|
||||
|
||||
group.add_argument('--nuc',
|
||||
action="store_const", dest="obi:moltype",
|
||||
default=None,
|
||||
const='nuc',
|
||||
const=b'nuc',
|
||||
help="Input file contains nucleic sequences")
|
||||
|
||||
group.add_argument('--prot',
|
||||
action="store_const", dest="obi:moltype",
|
||||
default=None,
|
||||
const='pep',
|
||||
const=b'pep',
|
||||
help="Input file contains protein sequences")
|
||||
|
||||
def __addTabularInputOption(optionManager):
|
||||
group = optionManager.add_argument_group("Input format options for tabular files")
|
||||
|
||||
group.add_argument('--header',
|
||||
action="store_true", dest="obi:header",
|
||||
default=False,
|
||||
help="First line of tabular file contains column names")
|
||||
|
||||
group.add_argument('--sep',
|
||||
action="store", dest="obi:sep",
|
||||
default=None,
|
||||
type="bytes",
|
||||
help="Column separator")
|
||||
|
||||
group.add_argument('--dec',
|
||||
action="store", dest="obi:dec",
|
||||
default=b".",
|
||||
type="bytes",
|
||||
help="Decimal separator")
|
||||
|
||||
group.add_argument('--na-string',
|
||||
action="store", dest="obi:nastring",
|
||||
default=b"NA",
|
||||
type="bytes",
|
||||
help="String associated to Non Available (NA) values")
|
||||
|
||||
group.add_argument('--strip-white',
|
||||
action="store_false", dest="obi:stripwhite",
|
||||
default=True,
|
||||
help="Remove white chars at the beginning and the end of values")
|
||||
|
||||
group.add_argument('--blank-line-skip',
|
||||
action="store_false", dest="obi:blanklineskip",
|
||||
default=True,
|
||||
help="Skip empty lines")
|
||||
|
||||
group.add_argument('--comment-char',
|
||||
action="store", dest="obi:commentchar",
|
||||
default=b"#",
|
||||
type="bytes",
|
||||
help="Lines starting by this char are considered as comment")
|
||||
|
||||
def addMinimalOption(optionManager):
|
||||
__addInputOption(optionManager)
|
||||
|
||||
def addSequenceInputOption(optionManager):
|
||||
__addInputOption(optionManager)
|
||||
__addSequenceInputOption(optionManager)
|
||||
|
||||
def addTabularInputOption(optionManager):
|
||||
__addInputOption(optionManager)
|
||||
__addTabularInputOption(optionManager)
|
||||
|
||||
def addAllInputOption(optionManager):
|
||||
__addInputOption(optionManager)
|
||||
__addSequenceInputOption(optionManager)
|
||||
__addTabularInputOption(optionManager)
|
||||
|
Reference in New Issue
Block a user