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 = parser.add_argument_group('Arguments')
# required but not required...
parser_grp.add_argument(
'bed_list',
help='A list of bed files for H3K4me3.',
type=bedFileWithUnambiguousNames(),
nargs='+')
parser_grp.add_argument('-i', '--inputfile',
help="The input GTF file.",
default=sys.stdin,
metavar="GTF",
required=False,
type=FileWithExtension('r',
valid_extensions='\.[Gg][Tt][Ff](\.[Gg][Zz])?$'))
parser_grp.add_argument('-o', '--outputfile',
help="Output file.",
default=sys.stdout,
metavar="TXT",
type=FileWithExtension('w',
valid_extensions=('\.[Tt][Xx][Tt]',
'\.[Cc][Ss][Vv]',
'\.[Tt][Aa][Bb]',
'\.[Tt][Ss][Vv]',
'\.[Cc][Oo][Vv]')))
parser_grp.add_argument('-l', '--labels',
help='Bed labels.',
default=None,
parser_grp.add_argument('-i', '--inputfile',
help="The input GTF/BED file. Only GTF file if is used.",
default=sys.stdin,
metavar="GTF/BED",
required=False,
type=FileWithExtension('r',
valid_extensions=('\.[Gg][Tt][Ff](\.[Gg][Zz])?$',
'\.[Bb][Ee][Dd]$',
'\.[Bb][Ee][Dd]3$',
'\.[Bb][Ee][Dd]6$')))
parser_grp.add_argument('-o', '--outputfile',
help="Output file.",
default=sys.stdout,
metavar="TXT",
type=FileWithExtension('w',
valid_extensions=('\.[Tt][Xx][Tt]$',
'\.[Cc][Ss][Vv]$',
'\.[Tt][Aa][Bb]$',
'\.[Tt][Ss][Vv]$',
'\.[Cc][Oo][Vv]$',
'\.[Bb][Ee][Dd]$')))
parser_grp.add_argument(
'-c', '--chrom-info',
help="Tabulated two-columns file. Chromosomes"
" as column 1 and sizes as"
" column 2 ",
default=None,
metavar="CHROMINFO",
action=checkChromFile,
required=True)
parser_grp = parser.add_argument_group('Arguments')
# required but not required...
parser_grp.add_argument(
'bw_list',
help='A list of Bigwig files (last argument).',
type=argparse.FileType('r'),
nargs='+')
parser_grp.add_argument('-i', '--inputfile',
help="The input GTF/BED file. Only GTF file if is used.",
default=sys.stdin,
metavar="GTF/BED",
required=False,
type=FileWithExtension('r',
valid_extensions=('\.[Gg][Tt][Ff](\.[Gg][Zz])?$',
'\.[Bb][Ee][Dd]$',
'\.[Bb][Ee][Dd]3$',
'\.[Bb][Ee][Dd]6$')))
parser_grp.add_argument('-o', '--outputfile',
help="Output file.",
default=sys.stdout,
metavar="TXT",
type=FileWithExtension('w',
valid_extensions=('\.[Tt][Xx][Tt]$',
'\.[Cc][Ss][Vv]$',
'\.[Tt][Aa][Bb]$',
'\.[Tt][Ss][Vv]$',
'\.[Cc][Oo][Vv]$',
'\.[Bb][Ee][Dd]$')))
def make_parser():
"""The main parser."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser_grp.add_argument('-i', '--inputfile',
help='A zip file containing a matrix as produced by mk_matrix.',
default=None,
metavar='MATRIX',
type=FileWithExtension('r', '\.[Zz][Ii][Pp]'),
required=True)
parser_grp.add_argument('-o', '--out-dir',
help='Output directory name.',
default="draw_profile",
metavar="DIR",
type=str)
parser_grp.add_argument('-t', '--transcript-file',
help="A two columns file with the transcripts"
" of interest and their classes.",
default=None,
type=argparse.FileType("r"),
required=False)
parser_grp.add_argument('-s', '--stat',
# required but not required...
parser_grp.add_argument('-i', '--inputfile',
help="The input GTF file.",
default=sys.stdin,
metavar="GTF",
required=False,
type=FileWithExtension('r',
valid_extensions='\.[Gg][Tt][Ff](\.[Gg][Zz])?$'))
parser_grp.add_argument('-o', '--outputfile',
help="Output file.",
default=sys.stdout,
metavar="TXT",
type=FileWithExtension('w',
valid_extensions=('\.[Tt][Xx][Tt]',
'\.[Cc][Ss][Vv]',
'\.[Tt][Aa][Bb]',
'\.[Tt][Ss][Vv]',
'\.[Cc][Oo][Vv]')))
parser_grp.add_argument('-b', '--bed-list',
help='A list of bed files for H3K4me3 epigenetic mark.',
type=bedFileWithUnambiguousNames(),
nargs='+',
required=True)
parser_grp.add_argument('-w', '--bigwig_list',
help='A list of bigwigs files for H3K4me3 epigenetic mark.',
type=argparse.FileType('r'),
nargs='+')
def make_parser():
"""The main parser."""
parser = argparse.ArgumentParser(add_help=True)
parser_grp = parser.add_argument_group('Arguments')
parser_grp.add_argument('-i', '--inputfile',
help='A zipped of matrix file as produced by mk_matrix.',
default=None,
metavar='MATRIX',
type=FileWithExtension('r', '\.[Zz][Ii][Pp]'),
required=True)
parser_grp.add_argument('-o', '--out-dir',
help='Output directory name.',
default="heatmap_gtftk",
type=str)
parser_grp.add_argument('-t', '--transcript-file',
help="A two columns file with the transcripts"
" of interest and their classes.",
default=None,
type=argparse.FileType("r"),
required=False)
parser_grp.add_argument('-s', '--order-fun',
help="The statistics used for row ordering.",
type=bedFileWithUnambiguousNames(),
nargs='+')
parser_grp.add_argument('-i', '--inputfile',
help="The input GTF file.",
default=sys.stdin,
metavar="GTF",
required=False,
type=FileWithExtension('r',
valid_extensions='\.[Gg][Tt][Ff](\.[Gg][Zz])?$'))
parser_grp.add_argument('-o', '--outputfile',
help="Output file.",
default=sys.stdout,
metavar="TXT",
type=FileWithExtension('w',
valid_extensions=('\.[Tt][Xx][Tt]',
'\.[Cc][Ss][Vv]',
'\.[Tt][Aa][Bb]',
'\.[Tt][Ss][Vv]',
'\.[Cc][Oo][Vv]')))
parser_grp.add_argument('-l', '--labels',
help='Bed labels.',
default=None,
type=str,
required=False)
parser_grp.add_argument('-m', '--dist-min',
help='Minimum distance between two TSSs for them to be tested.',
default=0,
type=int,