This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
/
denoiser_worker.py
executable file
·87 lines (65 loc) · 2.87 KB
/
denoiser_worker.py
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
#!/usr/bin/env python
""" A simple client waiting for data to clean up 454 sequencing data"""
__author__ = "Jens Reeder"
__copyright__ = "Copyright 2011, The QIIME Project"
# remember to add yourself if you make changes
__credits__ = ["Jens Reeder", "Rob Knight"]
__license__ = "GPL"
__version__ = "1.9.1"
__maintainer__ = "Jens Reeder"
__email__ = "jens.reeder@gmail.com"
from qiime.util import parse_command_line_parameters, get_options_lookup,\
make_option
from qiime.denoiser.utils import get_denoiser_data_dir
from qiime.denoiser.denoise_worker import setup_worker
options_lookup = get_options_lookup()
# denoiser_worker.py
script_info = {}
script_info['brief_description'] = "Start a denoiser worker process"
script_info['script_description'] = """The workers are automatically started by the denoiser.py script.
You usually never need to use this script yourself.
A worker waits for data and does flowgram alignments once it gets it."""
script_info['script_usage'] = [
("",
"Start worker and connect to server listening on port 12345 on the same machine (localhost)",
"%prog -f seqs.fna -f denoiser_out/worker99 -p 12345 -s localhost")
]
script_info[
'output_description'] = "Denoise worker writes a log file if verbose flag is set."
script_info['required_options'] = [
make_option('-f', '--file_path', action='store',
type='string', dest='file_path',
help='path used as prefix for worker data files' +
'[REQUIRED]'),
make_option('-p', '--port', action='store',
type='int', dest='port', help='Server port ' +
'[REQUIRED]'),
make_option('-s', '--server_address', action='store',
type='string', dest='server', help='Server address' +
'[REQUIRED]')
]
script_info['optional_options'] = [
make_option('-e', '--error_profile', action='store',
type='string', dest='error_profile',
help='Path to error profile' +
' [DEFAULT: %default]',
default=get_denoiser_data_dir() +
'FLX_error_profile.dat'),
make_option('-c', '--counter', action='store',
type='int', dest='counter',
help='Round counter to start this worker with ' +
' [default: %default]', default=0)
]
script_info['version'] = __version__
def main(commandline_args=None):
parser, opts, args = parse_command_line_parameters(**script_info)
if not opts.file_path:
parser.error("Required option --file_path not specified.")
if not opts.port:
parser.error("Required option --port not specified.")
if not opts.server:
parser.error("Required options --server_address not specified.")
setup_worker(opts.file_path, opts.server, opts.port,
opts.counter, opts.verbose, opts.error_profile)
if __name__ == "__main__":
main()