Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""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.",
required=False)
return parser
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 (BED).",
default=sys.stdout,
metavar="BED",
type=arg_formatter.FormattedFile(mode='w', file_ext='bed'))
parser_grp.add_argument('-b', '--by-transcript',
help="The intronic regions are returned for each"
" transcript.",
action="store_true")
parser_grp.add_argument('-n', '--names',
help="The key(s) that should be used as name (if -b is used).",
default="gene_id,transcript_id",
metavar="NAME",
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",
required=False,
type=arg_formatter.FormattedFile(mode='r', file_ext=('gtf', 'gtf.gz')))
parser_grp.add_argument('-o', '--outputfile',
help="Output file.",
default=sys.stdout,
metavar="TXT",
type=arg_formatter.FormattedFile(mode='w', file_ext='txt'))
parser_grp.add_argument('-d', '--header',
help="A comma-separated list of string to use as header.",
default=None,
type=str,
required=False)
parser_grp.add_argument('-t', '--additional-text',
help="A facultative text to be printed in the third "
"column (e.g species name).",
default=None,
metavar="TEXT",
type=str,
required=False)
return parser
"""parse"""
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=('bed')))
parser_grp.add_argument('-g', '--go-id',
help='The GO ID (e.g GO:0003700). Default is to return all genes.',
default=None,
type=str,
required=False)
parser_grp.add_argument('-s', '--species',
help='The dataset/species. Use select_by_go to get the list of species',
default="hsapiens",
type=str,
required=False)
parser_grp.add_argument('-u', '--upstream',
help="Extend the TSS in 5' by a given value.",
default=5000,
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 FASTA file.",
default=sys.stdout,
metavar="FASTA",
type=arg_formatter.FormattedFile(mode='w', file_ext='fasta'))
parser_grp.add_argument('-g', '--genome',
help="The genome in fasta format. Accept path with wildcards (e.g. *.fa).",
default=None,
metavar="FASTA",
action=globbedFileList,
required=True)
parser_grp.add_argument('-w', '--with-introns',
help="Set to true to include intronic regions.",
def make_parser():
"""The 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="TXT",
type=arg_formatter.FormattedFile(mode='w', file_ext='txt'))
parser_grp.add_argument('-s', '--separator',
help="The separator to be used for separating key names.",
default="\n",
metavar="SEP",
type=str)
return parser
def make_parser():
"""The program parser."""
parser = argparse.ArgumentParser(add_help=True)
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",
type=arg_formatter.FormattedFile(mode='w', file_ext=('gtf')))
return parser
def make_parser():
"""The program parser."""
parser = argparse.ArgumentParser(add_help=True)
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",
type=arg_formatter.FormattedFile(mode='w', file_ext=('gtf')))
parser.add_argument('-k', '--key',
help='The key name',
default="chrom",
metavar="KEY",
type=str)
parser.add_argument('-r', '--regexp',
help='The regular expression.',
default="^chr[0-9XY]+$",
type=str)
parser.add_argument('-n', '--invert-match',
help='Not/invert match. Selected lines whose requested key '
'do not match the regexp.',
action="store_true")
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="TXT/GTF",
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_exons",
help="The name of the key.",
def make_parser():
"""The 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",
required=False,
type=arg_formatter.FormattedFile(mode='r', file_ext=('gtf', 'gtf.gz')))
parser_grp.add_argument('-o', '--outputfile',
help="Output file.",
default=sys.stdout,
metavar="TXT",
type=arg_formatter.FormattedFile(mode='w', file_ext='txt'))
parser_grp.add_argument('-k', '--keys',
default="*",
help="The set of keys of interest.",
type=str,
required=False)
parser_grp.add_argument('-t', '--additional-text',
help="A facultative text to be printed in the third "
"column (e.g species name).",