This file is indexed.

/usr/bin/windowmasker_2.2.22_adapter is in ncbi-blast+ 2.2.28-2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#!/usr/bin/python

#
# Run this script without arguments to obtain usage informatioin.
#

import sys
import os

NAME_STR = 'windowmasker_2.2.22_adapter.py'
DESCR_STR = \
'old style to new style command line options\
 converter for windowmasker'
VERSION_STR = '1.0'

HELP_STR = """
------------------------------------------------------------------------------
WINDOWMASKER COMMAND LINE OPTIONS CONVERTER
------------------------------------------------------------------------------

windowmasker_2.2.22_adapter.py takes old style command line for windowmasker, 
converts it to the new format and runs the resulting command.

USAGE: windowmasker_2.2.22_adapter.py [--print-only] <wm_command> <options>

If '--print-only' flag is given as the first argument, then the resulting
command line is printed out, but windowmasker is not run.

wm_command is the path to windowmasker executable. It will be left unchanged
by the script.
------------------------------------------------------------------------------
"""

WM_NAME = 'windowmasker'

def title():
    global NAME_STR, DESCR_STR, VERSION_STR
    return NAME_STR + ': ' + DESCR_STR + '\nversion ' + VERSION_STR

def process( start_idx ):
    old_wm_opt_info = { 
        '-h'            : True, 
        '-help'         : True,
        '-xmlhelp'      : True,
        '-ustat'        : False,
        '-in'           : False,
        '-out'          : False,
        '-checkdup'     : False,
        '-window'       : False,
        '-t_extend'     : False,
        '-t_thres'      : False,
        '-t_high'       : False,
        '-t_low'        : False,
        '-set_t_high'   : False,
        '-set_t_low'    : False,
        '-infmt'        : False,
        '-parse_seqids' : False,
        '-outfmt'       : False,
        '-sformat'      : False,
        '-mk_counts'    : False,
        '-convert'      : False,
        '-fa_list'      : False,
        '-mem'          : False,
        '-smem'         : False,
        '-unit'         : False,
        '-genome_size'  : False,
        '-dust'         : False,
        '-dust_level'   : False,
        '-exclude_ids'  : False,
        '-ids'          : False,
        '-text_match'   : False,
        '-use_ba'       : False,
        '-version'      : True,
        '-version-full' : True
    }
    tmpres = []
    arg_pos = start_idx + 1
    wm_mode = 'mask'
    while True:
        if arg_pos >= len( sys.argv ): break
        arg = sys.argv[arg_pos]
        if arg not in old_wm_opt_info.keys(): tmpres.append( arg )
        else:
            if arg == '-convert':
                arg_pos += 1
                if arg_pos < len( sys.argv ):
                    if sys.argv[arg_pos] in ['true', 'T', '1']:
                        tmpres.append( arg )
                        wm_mode = 'convert'
            elif arg == '-mk_counts':
                arg_pos += 1
                if arg_pos < len( sys.argv ):
                    if sys.argv[arg_pos] in ['true', 'T', '1'] \
                            and wm_mode == 'mask':
                        tmpres.append( arg )
                        wm_mode = 'mk_counts'
            elif old_wm_opt_info[arg]: tmpres.append( arg )
            else:
                tmpres.append( arg )
                arg_pos += 1
                if arg_pos < len( sys.argv ): 
                    tmpres.append( sys.argv[arg_pos] )
        arg_pos += 1
#print tmpres, wm_mode
    excludes = {
        'mk_counts' : [
                '-outfmt',
                '-ustat',
                '-window',
                '-t_thres',
                '-t_extend',
                '-set_t_low',
                '-set_t_high',
                '-dust',
                '-dust_level',
                '-convert'
            ],
        'convert' : [
                '-mk_counts',
                '-ustat',
                '-checkdup',
                '-window',
                '-t_extend',
                '-t_thres',
                '-t_high',
                '-t_low',
                '-set_t_high',
                '-set_t_low',
                '-infmt',
                '-outfmt',
                '-parse_seqids',
                '-fa_list',
                '-mem',
                '-unit',
                '-genome_size',
                '-dust',
                '-dust_level',
                '-exclude_ids',
                '-ids',
                '-text_match',
                '-use_ba'
            ],
        'mask' : [
                '-convert',
                '-mk_counts',
                '-checkdup',
                '-fa_list',
                '-mem',
                '-unit',
                '-genome_list',
                '-sformat',
                '-smem',
            ]
    }
    result = []
    state = 'check'
    for arg in tmpres:
        if state == 'skip': state = 'check'
        elif state == 'copy': 
            result.append( arg )
            state = 'check'
        elif arg in old_wm_opt_info.keys():
            if arg in excludes[wm_mode]:
                if not old_wm_opt_info[arg]: state = 'skip'
            else:
                result.append( arg )
                if not old_wm_opt_info[arg]: state = 'copy'
        else: result.append( arg )
    return result

def main():
    global HELP_STR
    mode = 'exec'
    if len( sys.argv ) <= 1: 
        print HELP_STR
        return
    else:
         if sys.argv[1] == '--print-only': 
            mode = 'print'
            if len( sys.argv ) <= 2: 
                print HELP_STR
                return
            else: 
                  wm_name = sys.argv[2]
                  start_idx = 2
         else: 
            wm_name = sys.argv[1]
            start_idx = 1
    new_args = process( start_idx )
    result_str = wm_name + ' ' + ' '.join( new_args )
    if mode == 'print': print result_str
    else:
        print 'running "' + result_str + '"'
        os.system( result_str )

if __name__ == '__main__':
    main()