-
Notifications
You must be signed in to change notification settings - Fork 3
/
snoRNAHybridSearch.py
560 lines (471 loc) · 31.4 KB
/
snoRNAHybridSearch.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
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
import os
import random
import sys
import shutil
import traceback
from errno import EEXIST
from configobj import ConfigObj
from jinja2 import Template
from argparse import ArgumentParser, RawTextHelpFormatter
parser = ArgumentParser(description=__doc__, formatter_class=RawTextHelpFormatter)
subparsers = parser.add_subparsers(help="Commands", dest='command')
run_parser = subparsers.add_parser("run", help="Run a pipeline")
run_parser.add_argument("-v",
"--verbose",
dest="verbose",
action="store_true",
default=False,
help="Be loud!")
run_parser.add_argument("--config",
dest="config",
required=True,
help="Config file")
run_parser.add_argument("--name-suffix",
dest="name_suffix",
default="test_run",
help="Suffix to add to pipeline name in order to easily differentiate between different run, defaults to test_run")
run_parser.add_argument("--filter-multimappers",
dest="filter_multimappers",
action="store_true",
default=False,
help="Filter reads that map to multiple genomic locus with exception of reads that map also to canonical targets")
run_parser.add_argument("--modules",
dest="modules",
nargs="*",
help="A list of modules to load (if HPC or environment requires)")
clean_parser = subparsers.add_parser("clean", help="Clean after previous run")
clean_parser.add_argument("-v",
"--verbose",
dest="verbose",
action="store_true",
default=False,
help="Be loud!")
clean_parser.add_argument("-y",
"--yes",
dest="yes",
action="store_true",
default=False,
help="Force deletion of files.")
clean_parser.add_argument("--make-backup",
dest="make_backup",
action="store_true",
default=False,
help="Instead of deleting file with results make its backup")
# redefine a functions for writing to stdout and stderr to save some writting
syserr = sys.stderr.write
sysout = sys.stdout.write
def main(options):
# Define directories
working_directory = os.getcwd()
pipeline_directory = os.path.dirname(os.path.abspath(__file__))
output_directory = os.path.join(working_directory, "output")
for_features_directory = os.path.join(working_directory, "output/ForFeatures")
index_directory = os.path.join(working_directory, "index")
plots_directory = os.path.join(working_directory, "Plots")
structures_directory = os.path.join(working_directory, "Plots/Structures")
plexy_directory = os.path.join(working_directory, "Input")
if options.command == 'clean':
try:
if options.yes:
is_sure = "yes"
else:
is_sure = raw_input("Do you really want to delete previous run (yes/no)?: ")
if is_sure.upper().startswith("Y"):
dirs_to_delete = [plots_directory,
index_directory,
plexy_directory,
output_directory]
for directory in dirs_to_delete:
try:
if options.verbose:
syserr("Deleting %s\n" % directory)
shutil.rmtree(directory)
except OSError:
if options.verbose:
syserr(" -> no such a directory: %s\n" % directory)
files_to_backup = ["results_with_probability_annotated.tab"]
files_to_delete = ["search_anchors.stats",
"accessibility.tab",
"snoRNAs.rpkm",
"flanks.tab",
"snoRNAs.bed",
"results_with_probability.bed",
"results_with_score_and_rpkm_aggregated.tab",
"results_with_probability.tab",
"snoRNAs.fa",
"raw_reads_results.tab",
"search_anchors_for_statistics",
"results_with_score.tab",
"results_with_score_and_rpkm.tab",
"anchors.tab",
"for_index.clustered",
"for_index.fasta",
"results_with_RNAduplex_score.tab",
"results_with_RNAduplex_score_clustered.tab",
"results_with_RNAduplex_score_annotated.tab",
"mapped_reads_annotated_with_snornas.tab"]
if options.make_backup:
for f in files_to_backup:
if options.verbose:
syserr("Backing up %s\n" % os.path.join(working_directory, f))
try:
os.rename(os.path.join(working_directory, f), os.path.join(working_directory, f + ".bak"))
except OSError, e:
if options.verbose:
syserr(" -> no such a file: %s\n" % os.path.join(working_directory, f))
else:
files_to_delete.extend(files_to_backup)
for f in files_to_delete:
if options.verbose:
syserr("Removing %s\n" % os.path.join(working_directory, f))
try:
os.remove(os.path.join(working_directory, f))
except OSError, e:
if options.verbose:
syserr(" -> no such file: %s\n" % os.path.join(working_directory, f))
if options.verbose:
syserr("All output files and directories were cleaned\n")
except Exception as e:
syserr(traceback.format_exc())
finally:
sys.exit()
def mkdir_p(path_to_dir):
try:
os.makedirs(path_to_dir)
except OSError as e: # Python >2.5
if e.errno == EEXIST and os.path.isdir(path_to_dir):
sys.stderr.write("Directory %s already exists. Skipping.\n" % path_to_dir)
else:
raise e
settings = ConfigObj(options.config).dict()
mkdir_p(output_directory)
mkdir_p(index_directory)
mkdir_p(plots_directory)
mkdir_p(plexy_directory)
mkdir_p(for_features_directory)
mkdir_p(structures_directory)
from Jobber import JobClient
jobber = JobClient.Jobber()
#Create a group for whole pipeline. The module "Python" will be inherited by all jobs that are in this group,
# so we don't need to define it for each job that calls a python script
pipeline_id = jobber.startGroup({'name': "snoRNAHybridSearch-%s" % options.name_suffix,
'options': [['module', module] for module in options.modules],
'executer': settings['general'].get('executer', 'drmaa')})
#First step is to split the file
split_command = "python %s --input %s --output-dir %s --batch-size %s -v" % (os.path.join(pipeline_directory, "scripts/rg_split_fasta.py"),
settings['general']['unmapped_reads'],
output_directory,
settings['general']['reads_per_file'],
)
split_files_id = jobber.job(split_command, {'name': "SplitInput"})
#
# And the second is to generate the anchors - for that we need perform other tasks
#
# Generate file with snoRNAs
#
generate_fasta_command = "python %s --input %s --output %s --type %s -v --switch-box" % (
os.path.join(pipeline_directory, "scripts/rg_generate_fasta.py"),
settings['general']['snoRNAs'],
os.path.join(working_directory, "snoRNAs.fa"),
settings['general']['type'])
generate_fasta_id = jobber.job(generate_fasta_command, {'name': "GenerateFasta"})
#
# Generate plexy input files
generate_plexy_command = "python %s --input %s --dir %s --type %s -v --switch-box" % (
os.path.join(pipeline_directory, "scripts/rg_generate_input_for_plexy_or_rnasnoop.py"),
settings['general']['snoRNAs'],
plexy_directory,
settings['general']['type'])
generate_plexy_id = jobber.job(generate_plexy_command, {'name': "GenerateInput"})
#
# Generate snoRNA bed
generate_snoRNA_bed_command = "python %s --input %s --output %s --type %s -v --switch-box" % (
os.path.join(pipeline_directory, "scripts/rg_generate_snoRNA_bed.py"),
settings['general']['snoRNAs'],
os.path.join(working_directory, "snoRNAs.bed"),
settings['general']['type'])
generate_snoRNA_bed_id = jobber.job(generate_snoRNA_bed_command, {'name': "GenerateSnoRNABed"})
#
# Annotate reads with snoRNAs
annotate_reads_with_snornas_tuple = (os.path.join(pipeline_directory, 'scripts/rg_annotate_bed.py'),
settings['general']['bed_for_index'],
os.path.join(working_directory, "mapped_reads_annotated_with_snornas.tab"),
os.path.join(working_directory, "snoRNAs.bed"))
annotate_reads_with_snornas_command = "python %s --input %s --output %s --annotations %s --placeholder NaN --filter-by snoRNA" % annotate_reads_with_snornas_tuple
annotate_reads_with_snornas_id = jobber.job(annotate_reads_with_snornas_command, {'name': "AnnotateWithSnoRNAs",
'options': [('l', "membycore=4G")],
'dependencies': [generate_snoRNA_bed_id]})
#
# Calculate snoRNA expressions
calculate_snorna_expression_tuple = (os.path.join(pipeline_directory, 'scripts/rg_calculate_snoRNA_RPKM.py'),
os.path.join(working_directory, "mapped_reads_annotated_with_snornas.tab"),
os.path.join(working_directory, "snoRNAs.rpkm"),
settings['general']['bed_for_index'],
os.path.join(working_directory, "snoRNAs.bed"),
settings['general']['type'])
calculate_snorna_expression_command = "python %s --input %s --output %s --library %s --snoRNAs %s --quantile 0.0 --type %s" % calculate_snorna_expression_tuple
calculate_snorna_expression_id = jobber.job(calculate_snorna_expression_command, {'name': "CalculateSnoRNAsExpression",
'dependencies': [annotate_reads_with_snornas_id, generate_fasta_id]})
# Generate anchors
#
anchor_command = "python %s --fasta-to-anchor %s --anchor-length %s --output %s --expressed-snoRNAs %s -v" % (os.path.join(pipeline_directory, "scripts/rg_prepare_anchors.py"),
os.path.join(working_directory, "snoRNAs.fa"),
settings['general']['anchor_length'],
os.path.join(working_directory, "anchors.tab"),
os.path.join(working_directory, "snoRNAs.rpkm"),
)
anchor_id = jobber.job(anchor_command, {'name': "PrepareAnchors",
'dependencies': [generate_fasta_id, calculate_snorna_expression_id]})
#
# Build Bowtie index Group
#
build_index_id = jobber.startGroup({'name': "BuildIndex"})
#
# Cluster reads
#
cluster_reads_command = """python {script} \\
--input {input} \\
--output {output} \\
--overlap {overlap} \\
--expand-cluster {expand_cluster} \\
--expand-read {expand_read} \\
--cluster-size {cluster_size} \\
--bed \\
--rRNAs {rRNAs} \\
--tRNAs {tRNAs} \\
--snRNAs {snRNAs} \\
--filter-except snRNA,tRNA,rRNA,none,repeat
""".format(**{'script': os.path.join(pipeline_directory, 'scripts/rg_cluster_reads.py'),
'input': settings['general']['bed_for_index'],
'output': os.path.join(working_directory, "for_index.clustered"),
'overlap': settings['tasks']['ClusterReads'].get('overlap', '1'),
'expand_cluster': settings['tasks']['ClusterReads'].get('expand_cluster', '2'),
'expand_read': settings['tasks']['ClusterReads'].get('expand_read', '15'),
'cluster_size': settings['tasks']['ClusterReads'].get('cluster_size', '5'),
'rRNAs': settings['general']['rRNAs'],
'tRNAs': settings['general']['tRNAs'],
'snRNAs': settings['general']['snRNAs'],
})
cluster_reads_id = jobber.job(cluster_reads_command, {'name': "ClusterReads",
'options': [('q', settings['tasks']['ClusterReads'].get('queue', 'short.q')),
('l', "membycore=%s" % settings['tasks']['ClusterReads'].get('mem_req', '2G'))]
})
#
# Make fasta from clusters
#
make_fasta_tuple = (os.path.join(pipeline_directory, 'scripts/rg_extract_sequences.py'),
settings['general']['genome'],
os.path.join(working_directory, "for_index.clustered"),
os.path.join(working_directory, "for_index.fasta"))
make_fasta_command = "python %s --genome-dir %s --input %s --output %s --format fasta -v" % make_fasta_tuple
make_fasta_id = jobber.job(make_fasta_command, {'name': "MakeFasta",
'dependencies': [cluster_reads_id],
'options': [('q', settings['tasks']['MakeFastaFromClusters'].get('queue', 'short.q')),
('l', "membycore=%s" % settings['tasks']['MakeFastaFromClusters'].get('mem_req', '2G'))]
})
#
# Make Bowtie2 index
#
make_index_command = "bowtie2-build %s %s/%s 2> /dev/null" % (os.path.join(working_directory, "for_index.fasta"),
index_directory,
"bowtie_index")
make_bowtie_index_id = jobber.job(make_index_command, {'name': "BuildBowtieIndex",
'dependencies': [make_fasta_id],
'options': [('q', settings['tasks']['BuildBowtieIndex'].get('queue', 'short.q')),
('l', "membycore=%s" % settings['tasks']['BuildBowtieIndex'].get('mem_req', '2G'))]
})
jobber.endGroup()
#######################################################################################
# We create a group where the jobs to analyse the splitted files will be put into
analyse_files_id = jobber.startGroup({'name': "Analysis",
'dependencies': [split_files_id, anchor_id, build_index_id]})
#We call the script that will generate the jobs that will analyse the split files. We pass the id of the group
#and the folder where the script will find the splitted files.
analysis_tuple = (os.path.join(pipeline_directory, "run_analysis.py"),
output_directory,
analyse_files_id,
os.path.abspath(options.config),
working_directory)
if options.filter_multimappers:
analysis_command = "python %s --input-dir %s --group-id %s --config %s --working-dir %s --filter-multimappers -v" % analysis_tuple
else:
analysis_command = "python %s --input-dir %s --group-id %s --config %s --working-dir %s -v" % analysis_tuple
jobber.job(analysis_command, {'name': "CreateAnalysisJobs"})
jobber.endGroup()
# We merge the files from RNAduplex into our result file after analysis finishes
merge_duplexresults_command = "cat {output_dir}/*.duplexbed > {cwd}/results_with_RNAduplex_score.tab".format(output_dir=output_directory,
cwd=working_directory)
merge_duplexresults_id = jobber.job(merge_duplexresults_command, {'name': "MergeDuplexResults",
'dependencies': [analyse_files_id]})
# cluster duplex results
cluster_duplex_results_command = "python %s --input %s --output %s" % (os.path.join(pipeline_directory, 'scripts/rg_cluster_results.py'),
os.path.join(working_directory, "results_with_RNAduplex_score.tab"),
os.path.join(working_directory, "results_with_RNAduplex_score_clustered.tab"))
cluster_duplex_results_id = jobber.job(cluster_duplex_results_command, {'name': "ClusterDuplexResults",
'options': [('q', 'short.q'),
('l', "membycore=%s" % ('2G',))],
'dependencies': [merge_duplexresults_id]})
# annotate duplex results
annotate_duplex_results_tuple = (os.path.join(pipeline_directory, 'scripts/rg_annotate_positions.py'),
os.path.join(working_directory, "results_with_RNAduplex_score_clustered.tab"),
os.path.join(working_directory, "results_with_RNAduplex_score_annotated.tab"),
settings['general']['annotations_genes'],
settings['general']['annotations_regions'],
settings['general']['annotations_repeats'],
)
annotate_duplex_results_command = "python %s --input %s --output %s --genes %s --regions %s --repeats %s" % annotate_duplex_results_tuple
annotate_duplex_results_id = jobber.job(annotate_duplex_results_command, {'name': "AnnotateDuplexResults",
'options': [('q', 'short.q'),
('l', "membycore=%s" % ('6G',))],
'dependencies': [cluster_duplex_results_id]})
makestats_duplex_results_command = "python %s --input %s --snoRNAs %s --type %s --dir %s -v" % (os.path.join(pipeline_directory, 'scripts/rg_make_plots_for_rnaduplex.py'),
os.path.join(working_directory, "results_with_RNAduplex_score_annotated.tab"),
settings['general']['snoRNAs'],
settings['general']['type'],
os.path.join(working_directory, "Plots"))
makestats_duplex_results_id = jobber.job(makestats_duplex_results_command, {'name': "StatsDuplexResults",
'options': [('q', 'short.q'),
('l', "membycore=%s" % ('4G',))],
'dependencies': [annotate_duplex_results_id]})
# We merge the files into our result file after analysis finishes
merge_results_command = "cat {output_dir}/*.scorebed > {cwd}/results_with_score.tab".format(output_dir=output_directory,
cwd=working_directory)
merge_results_id = jobber.job(merge_results_command, {'name': "MergeResults",
'dependencies': [analyse_files_id]})
# And we merge the raw read files into
merge_raw_results_command = "cat {output_dir}/*.truechrombed > {cwd}/raw_reads_results.tab".format(output_dir=output_directory,
cwd=working_directory)
merge_raw_results_id = jobber.job(merge_raw_results_command, {'name': "MergeRawResults",
'dependencies': [analyse_files_id]})
# # Cluster results
# #
# generate_fasta_command = "python %s --input %s --output %s" % (
# os.path.join(pipeline_directory, "scripts/rg_generate_fasta.py"),
# os.path.join(working_directory, "results_with_score.tab"),
# os.path.join(working_directory, "results_with_score_clustered.tab")
# )
# generate_fasta_id = jobber.job(generate_fasta_command, {'name': "GenerateFasta"})
# Add RPKM to results
#
add_rpkm_command = "python %s --input %s --output %s --rpkm %s --annotated-reads %s --type %s -v" % (
os.path.join(pipeline_directory, "scripts/rg_add_rpkm_to_score.py"),
os.path.join(working_directory, "results_with_score.tab"),
os.path.join(working_directory, "results_with_score_and_rpkm.tab"),
os.path.join(working_directory, "snoRNAs.rpkm"),
os.path.join(working_directory, "mapped_reads_annotated_with_snornas.tab"),
settings['general']['type']
)
add_rpkm_id = jobber.job(add_rpkm_command, {'name': "AddRPKM",
'options': [('q', 'short.q'),
('l', "membycore=%s" % ('4G',))],
'dependencies': [merge_results_id]})
# Cluster results
#
aggregate_by_site_command = "python %s --input %s --output %s --type %s" % (
os.path.join(pipeline_directory, "scripts/rg_aggregate_scored_results.py"),
os.path.join(working_directory, "results_with_score_and_rpkm.tab"),
os.path.join(working_directory, "results_with_score_and_rpkm_aggregated.tab"),
settings['general']['type']
)
aggregate_by_site_id = jobber.job(aggregate_by_site_command, {'name': "AggregateBySite",
'dependencies': [add_rpkm_id]})
#
# Features for model
#
#First step is to split the file with results
split_res_tuple = (os.path.join(pipeline_directory, "scripts/rg_split_file_into_chunks.py"),
os.path.join(working_directory, "results_with_score_and_rpkm_aggregated.tab"),
for_features_directory,
5000,
"part_",
".result"
)
split_res_command = "python %s --input %s --dir %s --lines %s --prefix %s --suffix %s -v" % split_res_tuple
split_res_files_id = jobber.job(split_res_command, {'name': "SplitResult",
'dependencies': [aggregate_by_site_id]})
calculate_features_group_id = jobber.startGroup({'name': "FeaturesGroup",
'dependencies': [split_res_files_id]})
#We call the script that will generate the jobs that will analyse the split files. We pass the id of the group
#and the folder where the script will find the splitted files.
feat_tuple = (os.path.join(pipeline_directory, "run_features.py"),
for_features_directory,
calculate_features_group_id,
os.path.abspath(options.config),
working_directory)
feat_command = "python %s --input-dir %s --group-id %s --config %s --working-dir %s -v" % feat_tuple
jobber.job(feat_command, {'name': "CreateFeaturesJobs"})
jobber.endGroup()
# Calculate Probability
calculate_probability_settings = settings['tasks']['CalculateProbability']
calculate_probability_command = "python %s --input %s --output %s --accessibility %s --flanks %s --model %s" % (
os.path.join(pipeline_directory, "scripts/rg_calculate_probability.py"),
os.path.join(working_directory, 'results_with_score_and_rpkm_aggregated.tab'),
os.path.join(working_directory, 'results_with_probability.tab'),
os.path.join(working_directory, "accessibility.tab"),
os.path.join(working_directory, "flanks.tab"),
settings['general']['model'])
calculate_probability_id = jobber.job(calculate_probability_command, {'name': "CalculateProbability",
'options': [('q', calculate_probability_settings.get('queue', 'short.q')),
('l', "membycore=%s" % calculate_probability_settings.get('mem_req', '4G'))],
'dependencies': [calculate_features_group_id,
aggregate_by_site_id]})
#
# Make statistics and plots for results
make_plots_command = """
python {script} \\
--results-probability-complex {complex_res} \\
--results-raw {raw_results} \\
--snoRNAs {snornas} \\
--type {type} \\
--genome-dir {genome_dir} \\
--dir {dir} \\
-v
""".format(**{'script': os.path.join(pipeline_directory, 'scripts/rg_make_stats_for_results.py'),
'complex_res': os.path.join(working_directory, 'results_with_probability.tab'),
'raw_results': os.path.join(working_directory, 'raw_reads_results.tab'),
'snornas': settings['general']['snoRNAs'],
'type': settings['general']['type'],
'genome_dir': settings['general']['genome'],
'dir': os.path.join(working_directory, "Plots")
})
make_plots_id = jobber.job(make_plots_command, {'name': "MakePlots",
'options': [('l', "membycore=4G")],
'dependencies': [merge_raw_results_id,
calculate_probability_id]})
#
# Convert results to BED
convert_to_bed_tuple = (os.path.join(pipeline_directory, 'scripts/rg_convert_to_bed.py'),
os.path.join(working_directory, "results_with_probability.tab"),
os.path.join(working_directory, "results_with_probability.bed"))
convert_to_bed_command = "python %s --input %s --output %s" % convert_to_bed_tuple
convert_to_bed_id = jobber.job(convert_to_bed_command, {'name': "ConvertToBed",
'dependencies': [calculate_probability_id]})
#
# Annotate results
annotate_results_settings = settings['tasks']['AnnotateResults']
annotate_results_tuple = (os.path.join(pipeline_directory, 'scripts/rg_annotate_positions.py'),
os.path.join(working_directory, "results_with_probability.bed"),
os.path.join(working_directory, "results_with_probability_annotated.tab"),
settings['general']['annotations_genes'],
settings['general']['annotations_regions'],
settings['general']['annotations_repeats'],
)
annotate_results_command = "python %s --input %s --output %s --genes %s --regions %s --repeats %s" % annotate_results_tuple
annotate_results_id = jobber.job(annotate_results_command, {'name': "AnnotateResults",
'options': [('q', annotate_results_settings.get('queue', 'short.q')),
('l', "membycore=%s" % annotate_results_settings.get('mem_req', '2G'))],
'dependencies': [convert_to_bed_id]})
############################### END PIPELINE GROUP ###################################
jobber.endGroup()
# Before launching we print the command to stop the pipeline
print "In order to stop the pipeline run a command:"
print "jobber_server -command delete -jobId %i, or use web interface" % (pipeline_id)
#You need to always launch, otherwise jobs wont get executed.
jobber.launch(pipeline_id)
if __name__ == '__main__':
try:
options = parser.parse_args()
except Exception, e:
parser.print_help()
sys.exit()
main(options)