Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parser_grp.add_argument('-t', '--ft-type',
help="The feature of interest.",
default='gene',
choices=['gene', 'transcript', 'tss', 'tts'],
required=False)
parser_grp.add_argument('-n', '--names',
help="The key(s) that should be used as name in the output BED file.",
default="gene_id,gene_name",
metavar="NAME",
type=str)
parser_grp.add_argument('-p', '--slop-value',
help="Look until this number of nucleotides in 5' and 3' direction",
default=0,
type=arg_formatter.ranged_num(lowest=0, highest=None,
val_type="int", linc=True),
required=False)
parser_grp.add_argument('-u', '--uncollapse',
help='Write one peak to gene/distance per line (no comma separated list).',
action="store_true")
parser_grp.add_argument('-g', '--gene-centric',
help='Print --feature-type coordinate and the peak list and associated distance.',
action="store_true")
parser_grp.add_argument('-c', '--chrom-info',
help='Tabulated file (chr as column 1, sizes as column 2.)',
default=None,
action=CheckChromFile,
required=True)
parser_grp.add_argument('-t', '--ft-type',
help='If input is a GTF, the region to analyse.',
default='promoter',
choices=['promoter',
'tts',
'transcript',
'user_regions',
'single_nuc'],
type=str,
required=False)
parser_grp.add_argument('-p', '--pseudo-count',
help='Pseudo-count to add to all values.',
default=0,
type=arg_formatter.ranged_num(lowest=0, highest=None,
val_type="float", linc=True),
required=False)
parser_grp.add_argument('-u', '--upstream',
help="Extend the region of interest in 5' by a given value.",
default=1000,
type=arg_formatter.ranged_num(lowest=0, highest=None,
val_type="int", linc=True),
required=False)
parser_grp.add_argument('-d', '--downstream',
help="Extend the region of interest in 3' by a given value.",
default=1000,
type=arg_formatter.ranged_num(lowest=0, highest=None,
val_type="int", linc=True),
required=False)
parser_grp.add_argument('-m', '--more-keys',
help='A comma separated list of key used for labeling the genome. See Notes.',
type=str,
default=None,
required=False)
parser_grp.add_argument('-n', '--no-basic-feature',
help="No statistics for basic features of GTF. Concentrates on --more-bed and --more-keys.",
action="store_true",
required=False)
# --------------------- Backend ------------------------------------------ #
parser_grp.add_argument('-k', '--nb-threads',
help='Number of threads for multiprocessing.',
type=arg_formatter.ranged_num(0, None),
default=1,
required=False)
parser_grp.add_argument('-s', '--seed',
help='Numpy random seed.',
type=arg_formatter.ranged_num(None, None),
default=42,
required=False)
parser_grp.add_argument('-mn', '--minibatch-nb',
help='Number of minibatches of shuffles.',
type=arg_formatter.ranged_num(0, None),
default=10,
required=False)
parser_grp.add_argument('-ms', '--minibatch-size',
help="Path to the GTF file. Default to STDIN",
default=sys.stdin,
metavar="GTF",
type=arg_formatter.FormattedFile(mode='r', file_ext=('gtf', 'gtf.gz')))
parser_grp.add_argument('-o', '--outputfile',
help="Output file.",
default=sys.stdout,
metavar="GTF",
type=arg_formatter.FormattedFile(mode='w', file_ext=('gtf')))
parser_grp.add_argument('-n', '--number',
help="The number of transcripts or gene to select.",
default=1,
metavar="NUMBER",
type=arg_formatter.ranged_num(lowest=1,
highest=None,
linc=True,
val_type='int'),
required=False)
parser_grp.add_argument('-t', '--ft-type',
help="The type of feature.",
default="transcript",
choices=["gene", "transcript"],
required=False)
parser_grp.add_argument('-s', '--seed-value',
help="Seed value for the random number generator.",
default=None,
metavar="SEED",
type=arg_formatter.ranged_num(lowest=1,
parser_grp.add_argument('-m', '--max-transcript',
help="The maximum number of transcripts to select for each gene.",
default=1,
metavar="MAX",
type=arg_formatter.ranged_num(lowest=1,
highest=None,
linc=True,
val_type='int'),
required=False)
parser_grp.add_argument('-s', '--seed-value',
help="Seed value for the random number generator.",
default=None,
metavar="SEED",
type=arg_formatter.ranged_num(lowest=1,
highest=None,
linc=True,
val_type='int'),
required=False)
return parser
help='A comma-separated list of values.',
default=None,
metavar="VALUE",
type=str)
parser_mut.add_argument('-f', '--file-with-values',
help='A file containing values as a single column.',
default=None,
metavar="FILE",
type=argparse.FileType("r"))
parser_grp.add_argument('-c', '--col',
help='The column number (one-based) that contains the values in the file. File is tab-delimited.',
default=1,
metavar="COL",
type=arg_formatter.ranged_num(lowest=1,
highest=None,
linc=True,
val_type='int'),
required=False)
parser_grp.add_argument('-n', '--invert-match',
help='Not/invert match. Select lines whose selected key is not associated'
' with the selected values.',
action="store_true")
parser_grp.add_argument('-b', '--bed-format',
help='Ask for bed format output.',
action="store_true")
parser_grp.add_argument('-m', '--names',
help="If Bed output. The key(s) that should be used as name.",
def make_parser():
"""The main argument parser."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser_grp.add_argument('inputfiles',
help="Complete paths to the OLOGRAM output files",
type=arg_formatter.FormattedFile(mode='r', file_ext=('txt')),
nargs='+')
parser_grp.add_argument('-pw', '--pdf-width',
help='Output pdf file width (inches).',
type=arg_formatter.ranged_num(0, None),
default=None,
required=False)
parser_grp.add_argument('-ph', '--pdf-height',
help='Output pdf file height (inches).',
type=arg_formatter.ranged_num(0, None),
default=None,
required=False)
parser_grp.add_argument('-o', '--output',
help="Pdf file name.",
default=None,
nargs=None,
type=arg_formatter.FormattedFile(mode='w', file_ext='pdf'),
required=True)