Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def make_parser():
"""The main argument parser."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
# --------------------- Main arguments ----------------------------------- #
parser_grp.add_argument('-i', '--inputfile',
help="Path to the GTF file. Defaults to STDIN",
default=sys.stdin,
metavar="GTF",
type=arg_formatter.FormattedFile(mode='r', file_ext=('gtf', 'gtf.gz')),
required=False)
parser_grp.add_argument('-c', '--chrom-info',
help="Tabulated two-columns file. "
"Chromosomes as column 1, sizes as column 2",
default=None,
metavar="TXT",
action=arg_formatter.CheckChromFile,
required=False)
parser_grp.add_argument('-p', '--peak-file',
help='The file containing the peaks/regions to be annotated.'
' (bed format).',
default=None,
metavar="BED",
type=arg_formatter.FormattedFile(mode='r', file_ext='bed'),
"""The program parser."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser_grp.add_argument('-s', '--species-name',
help="The species name.",
type=str,
metavar="SPECIES",
default="homo_sapiens",
required=False)
parser_grp.add_argument('-o', '--outputfile',
help="Output file (gtf.gz).",
metavar="GTF.GZ",
type=arg_formatter.FormattedFile(mode='w', file_ext='gtf.gz'))
parser_grp.add_argument('-e', '--ensembl-collection',
help="Which ensembl collection to interrogate"
"('vertebrate', 'protists', 'fungi', 'plants', 'metazoa').",
default="vertebrate",
choices=[
'vertebrate',
'protists',
'fungi',
'plants',
'metazoa'],
type=str)
parser_grp.add_argument('-r', '--release',
help="Release number. By default, the latest.",
default=None,
def make_parser():
""" Parser """
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Argument')
parser_grp.add_argument('-i', '--inputfile',
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')))
return parser
"""The program parser."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser_grp.add_argument('-i', '--inputfile',
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('-k', '--key-to-join',
help='The name of the key used to join (e.g transcript_id).',
default=None,
metavar="KEY",
type=str,
required=True)
parser_grp.add_argument('-t', '--target-feature',
help='The name(s) of the target feature(s). Comma-separated.',
default=None,
type=str,
required=False)
parser_grp.add_argument('-m', '--matrix-files',
help="A set of matrix files with row names as "
def make_parser():
"""The program parser."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser_grp.add_argument('-i', '--inputfile',
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/TXT",
type=arg_formatter.FormattedFile(mode='w', file_ext=('gtf', 'txt')))
parser_grp.add_argument('-f', '--text-format',
help="Return a text format.",
action="store_true")
parser_grp.add_argument('-a',
'--key-name',
type=str,
default="nb_tx",
help="If gtf format is requested, the name of the key.",
"""The program CLI."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser_grp.add_argument('-i', '--inputfile',
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('-s', '--shift-value',
help="Shift coordinate by s nucleotides.",
default=0,
type=int,
required=True)
parser_grp.add_argument('-d', '--stranded',
help="By default shift not .",
action="store_true")
parser_grp.add_argument('-a', '--allow-outside',
help="Accept the partial or total disappearance of a feature upon shifting.",
action="store_true")
parser_grp.add_argument('-c', '--chrom-info',
def make_parser():
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser_grp.add_argument('-i', '--inputfile',
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('-k', '--key',
help='Comma separated list of attribute names or a '
'regular expression (see -r).',
default=None,
metavar="KEY",
type=str,
required=True)
parser_grp.add_argument('-r', '--reg-exp',
def make_parser():
"""The parser."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser.add_argument('-i', '--inputfile',
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.add_argument('-o', '--outputfile',
help="Output file.",
default=sys.stdout,
metavar="GTF/TXT",
type=arg_formatter.FormattedFile(mode='w', file_ext=('gtf', 'txt')))
parser_grp.add_argument('-r', '--from-region-type',
help="What is region to consider for each gene.",
choices=['tss', 'tts', 'gene'],
default="tss",
type=str,
required=False)
parser_grp.add_argument('-nb', '--nb-neighbors',
help="The size of the neighborhood.",
def make_parser():
"""The program parser."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser_grp.add_argument('-i', '--inputfile',
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('-k', '--key',
help="The name of the attribute for which a "
"prefix/suffix is to be added to the corresponding"
" values (e.g, gene_id, transcript_id...).",
default="chrom",
metavar="KEY",
type=str)
parser_grp.add_argument('-t', '--text',
description=__doc__)
parser_grp = parser.add_argument_group('Arguments')
# --------------------- Main arguments ----------------------------------- #
parser_grp.add_argument('-i', '--inputfile',
help="Path to the bigwig file",
default=None,
type=arg_formatter.FormattedFile(mode='r', file_ext=('bigwig')),
required=False)
parser_grp.add_argument('-o', '--outputfile',
help='The output BED file.',
default=sys.stdout,
type=arg_formatter.FormattedFile(mode='r', file_ext='bed'),
required=False)
parser_grp.add_argument('-c', '--chrom-list',
help='The list of chromosomes of interest.',
default=None,
type=str,
nargs='*',
required=False)
parser_grp.add_argument('-e', '--expression',
help='A boolean expression where s is the signal (e.g; s > 0 and s < 0.5).',
default=None,
type=str,
required=True)
return parser