<commit_before>import argparse

shared_options = {
    'fn': {'driverattr': 'fn', 'type': 'file', 'clarg': '-i',
           'help': 'Input file of {} format'},
    'outfile': {'driverattr': 'outfile', 'type': str,
                'clarg': '-o', 'help': 'Output file', 'required': False},
    'outdir': {'driverattr': 'outdir', 'clarg': '-d',
               'help': 'Directory to output in', 'type': 'file',
               'required': False},
    'multifiles': {'driverattr': 'fn', 'clarg': '-i',
                   'help': 'Multiple input files of {} format',
                   'type': 'file', 'nargs': '+'},
    'lookupfn': {'driverattr': 'lookupfn', 'clarg': '--dbfile',
                 'type': 'file', 'help': 'Database lookup file'},
    'setnames': {'driverattr': 'setnames',
                 'type': str, 'nargs': '+', 'clarg': '--setnames',
                 'help': 'Names of biological sets. Can be '
                 'specified with quotation marks if spaces are '
                 'used'},
    'spectracol': {'driverattr': 'spectracol',
                   'type': int, 'clarg': '--spectracol', 'help':
                   'Column number in which spectra file names are, '
                   'in case some framework has changed the file '
                   'names. First column number is 1.', 'required': False,
                   'default': 1},
    'proline': {'driverattr': 'proline', 'required': False,
                'clarg': '--cutproline', 'action': 'store_const',
                'const': True, 'default': False, 'help': 'Flag to make '
                'trypsin before a proline residue. Then filtering will be '
                'done against both cut and non-cut peptides.',
                },
    'fasta': {'driverattr': 'fasta',
              'type': 'file', 'help': 'FASTA sequence database',
              'required': False, 'default': False, 'clarg': '--fasta'},
    'unroll': {'driverattr': 'unroll', 'clarg': '--unroll', 'const': True,
               'action': 'store_const', 'default': False, 'help': 'PSM table '
               'from Mzid2TSV contains either one PSM per line with all '
               'the proteins of that shared peptide on the same line (not'
               ' unrolled, default), or one PSM/protein match per line '
               'where each protein from that shared peptide gets its own '
               'line (unrolled).', 'required': False},
    'isobaric': {'driverattr': 'isobaric', 'clarg': '--isobaric',
                 'action': 'store_const', 'const': True, 'default': False,
                 'help': 'Specifies to add isobaric quant data from lookup DB '
                 'to output table', 'required': False,
                 },
    'precursor': {'driverattr': 'precursor', 'clarg': '--ms1quant',
                  'action': 'store_const', 'const': True, 'default': False,
                  'help': 'Specifies to add precursor quant data from lookup '
                  'DB to output table', 'required': False,
                  },
    'quantcolpattern': {'driverattr': 'quantcolpattern',
                        'clarg': '--isobquantcolpattern', 'type': str,
                        'default': False, 'required': False,
                        'help': 'Unique text pattern to identify '
                        'isobaric quant columns in input table.'},
    'precursorquantcolpattern': {'driverattr': 'precursorquantcolpattern',
                                 'type': str, 'required': False,
                                 'clarg': '--ms1quantcolpattern',
                                 'default': None,
                                 'help': 'Unique text pattern to identify '
                                 'precursor quant column in input table.'},
    'quantacccolpattern': {'driverattr': 'quantacccolpattern',
                           'clarg': '--qaccpattern', 'type': str,
                           'help': 'Unique text pattern to identify '
                           'accession column in table containing quant info.'},
    'featcol': {'driverattr': 'featcol', 'clarg': '--featcol',
                   'type': int, 'required': False, 'help': 'Column number in '
                   'table in which desired accessions are. '
                   'stored. First column number is 1. Use in case of not '
                   'using default column {}'},
    'featcolpattern': {'driverattr': 'featcolpattern', 'clarg': '--featcolpattern',
                    'type': str, 'required': False, 'help': 'Text pattern to '
                    'identify column in table in which protein or gene '
                    'accessions are. Use in case of not using standard '
                    '{} column', 'default': False},
    'fdrcolpattern': {'driverattr': 'fdrcolpattern',
                      'clarg': '--fdrcolpattern', 'type': str,
                      'default': None, 'help': 'Unique text pattern to identify '
                      'FDR column in input table.'},
    'fastadelim': {'driverattr': 'fastadelim', 'clarg': '--fastadelim',
                   'required': False, 'type': str,
                   'choices': ['tab', 'pipe', 'semicolon'],
                   'help': 'Delimiter in FASTA header, used to parse gene '
                   'names in case of non-ENSEMBL/Uniprot'},
    'genefield': {'driverattr': 'genefield', 'clarg': '--genefield',
                  'required': False, 'type': int,
                  'help': 'Field nr (first=1) in FASTA that contains gene '
                  'name when using --fastadelim to parse the gene names'},
    'minlength': {'driverattr': 'minlength', 'default': 0,
                  'help': 'Minimum length of peptide to be included',
                  'type': int, 'clarg': '--minlen', 'required': False},
    'addbioset': {'driverattr': 'addbioset',
            'clarg': '--addbioset', 'required': False, 'action': 'store_const',
            'default': False, 'const': True,
            'help': 'Add biological setname from DB lookup to PSM table',
               },
    'addmiscleav': {'driverattr': 'addmiscleav',
            'clarg': '--addmiscleav', 'required': False, 'action': 'store_const',
            'default': False, 'const': True, 'help': 'Add missed cleavages to PSM table',
               },
    'fullprotein': {'driverattr': 'fullprotein', 'clarg': '--fullprotein',
        'default': False, 'action': 'store_const', 'const': True, 'help':
        'Store full protein sequences (at a minimum-match length) in the '
        'SQLite file rather than tryptic sequences', 'required': False},
    'minint': {'driverattr': 'minint', 'clarg': '--minint', 'type': float,
               'help': 'Intensity threshold of PSMs when calculating '
               'isobaric ratios. Values below threshold will be set to NA. '
               'Defaults to no threshold.',
               'required': False, 'default': -1,
               },
    'denompatterns': {'driverattr': 'denompatterns', 'required': False,
                      'clarg': '--denompatterns', 'type': str, 'nargs': '+',
                      'help': 'Regex patterns to detect denominator channels '
                      'in a PSM table, when creating a table with summarized '<commit_msg>Min isobaric intensity of PSM is 0, otherwise log will complain. This also removes PSMs with 0 intensity in default settings, by turning them into NA<commit_after>import argparse

shared_options = {
    'fn': {'driverattr': 'fn', 'type': 'file', 'clarg': '-i',
           'help': 'Input file of {} format'},
    'outfile': {'driverattr': 'outfile', 'type': str,
                'clarg': '-o', 'help': 'Output file', 'required': False},
    'outdir': {'driverattr': 'outdir', 'clarg': '-d',
               'help': 'Directory to output in', 'type': 'file',
               'required': False},
    'multifiles': {'driverattr': 'fn', 'clarg': '-i',
                   'help': 'Multiple input files of {} format',
                   'type': 'file', 'nargs': '+'},
    'lookupfn': {'driverattr': 'lookupfn', 'clarg': '--dbfile',
                 'type': 'file', 'help': 'Database lookup file'},
    'setnames': {'driverattr': 'setnames',
                 'type': str, 'nargs': '+', 'clarg': '--setnames',
                 'help': 'Names of biological sets. Can be '
                 'specified with quotation marks if spaces are '
                 'used'},
    'spectracol': {'driverattr': 'spectracol',
                   'type': int, 'clarg': '--spectracol', 'help':
                   'Column number in which spectra file names are, '
                   'in case some framework has changed the file '
                   'names. First column number is 1.', 'required': False,
                   'default': 1},
    'proline': {'driverattr': 'proline', 'required': False,
                'clarg': '--cutproline', 'action': 'store_const',
                'const': True, 'default': False, 'help': 'Flag to make '
                'trypsin before a proline residue. Then filtering will be '
                'done against both cut and non-cut peptides.',
                },
    'fasta': {'driverattr': 'fasta',
              'type': 'file', 'help': 'FASTA sequence database',
              'required': False, 'default': False, 'clarg': '--fasta'},
    'unroll': {'driverattr': 'unroll', 'clarg': '--unroll', 'const': True,
               'action': 'store_const', 'default': False, 'help': 'PSM table '
               'from Mzid2TSV contains either one PSM per line with all '
               'the proteins of that shared peptide on the same line (not'
               ' unrolled, default), or one PSM/protein match per line '
               'where each protein from that shared peptide gets its own '
               'line (unrolled).', 'required': False},
    'isobaric': {'driverattr': 'isobaric', 'clarg': '--isobaric',
                 'action': 'store_const', 'const': True, 'default': False,
                 'help': 'Specifies to add isobaric quant data from lookup DB '
                 'to output table', 'required': False,
                 },
    'precursor': {'driverattr': 'precursor', 'clarg': '--ms1quant',
                  'action': 'store_const', 'const': True, 'default': False,
                  'help': 'Specifies to add precursor quant data from lookup '
                  'DB to output table', 'required': False,
                  },
    'quantcolpattern': {'driverattr': 'quantcolpattern',
                        'clarg': '--isobquantcolpattern', 'type': str,
                        'default': False, 'required': False,
                        'help': 'Unique text pattern to identify '
                        'isobaric quant columns in input table.'},
    'precursorquantcolpattern': {'driverattr': 'precursorquantcolpattern',
                                 'type': str, 'required': False,
                                 'clarg': '--ms1quantcolpattern',
                                 'default': None,
                                 'help': 'Unique text pattern to identify '
                                 'precursor quant column in input table.'},
    'quantacccolpattern': {'driverattr': 'quantacccolpattern',
                           'clarg': '--qaccpattern', 'type': str,
                           'help': 'Unique text pattern to identify '
                           'accession column in table containing quant info.'},
    'featcol': {'driverattr': 'featcol', 'clarg': '--featcol',
                   'type': int, 'required': False, 'help': 'Column number in '
                   'table in which desired accessions are. '
                   'stored. First column number is 1. Use in case of not '
                   'using default column {}'},
    'featcolpattern': {'driverattr': 'featcolpattern', 'clarg': '--featcolpattern',
                    'type': str, 'required': False, 'help': 'Text pattern to '
                    'identify column in table in which protein or gene '
                    'accessions are. Use in case of not using standard '
                    '{} column', 'default': False},
    'fdrcolpattern': {'driverattr': 'fdrcolpattern',
                      'clarg': '--fdrcolpattern', 'type': str,
                      'default': None, 'help': 'Unique text pattern to identify '
                      'FDR column in input table.'},
    'fastadelim': {'driverattr': 'fastadelim', 'clarg': '--fastadelim',
                   'required': False, 'type': str,
                   'choices': ['tab', 'pipe', 'semicolon'],
                   'help': 'Delimiter in FASTA header, used to parse gene '
                   'names in case of non-ENSEMBL/Uniprot'},
    'genefield': {'driverattr': 'genefield', 'clarg': '--genefield',
                  'required': False, 'type': int,
                  'help': 'Field nr (first=1) in FASTA that contains gene '
                  'name when using --fastadelim to parse the gene names'},
    'minlength': {'driverattr': 'minlength', 'default': 0,
                  'help': 'Minimum length of peptide to be included',
                  'type': int, 'clarg': '--minlen', 'required': False},
    'addbioset': {'driverattr': 'addbioset',
            'clarg': '--addbioset', 'required': False, 'action': 'store_const',
            'default': False, 'const': True,
            'help': 'Add biological setname from DB lookup to PSM table',
               },
    'addmiscleav': {'driverattr': 'addmiscleav',
            'clarg': '--addmiscleav', 'required': False, 'action': 'store_const',
            'default': False, 'const': True, 'help': 'Add missed cleavages to PSM table',
               },
    'fullprotein': {'driverattr': 'fullprotein', 'clarg': '--fullprotein',
        'default': False, 'action': 'store_const', 'const': True, 'help':
        'Store full protein sequences (at a minimum-match length) in the '
        'SQLite file rather than tryptic sequences', 'required': False},
    'minint': {'driverattr': 'minint', 'clarg': '--minint', 'type': float,
               'help': 'Intensity threshold of PSMs when calculating '
               'isobaric ratios. Values below threshold will be set to NA. '
               'Defaults to no threshold.', 'required': False, 'default': 0,
               },
    'denompatterns': {'driverattr': 'denompatterns', 'required': False,
                      'clarg': '--denompatterns', 'type': str, 'nargs': '+',
                      'help': 'Regex patterns to detect denominator channels '
                      'in a PSM table, when creating a table with summarized '
{'fraction_non_alphanumeric': 0.15082872928176796, 'fraction_numerical': 0.0013812154696132596, 'mean_word_length': 1.9391110209052163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5971910', 'n_tokens_mistral': 3953, 'n_tokens_neox': 3787, 'n_words': 1301}