-
Notifications
You must be signed in to change notification settings - Fork 4
/
AlignmentXref_conf.pm
835 lines (738 loc) · 32.4 KB
/
AlignmentXref_conf.pm
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
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
=head1 LICENSE
See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
=pod
=head1 NAME
Bio::EnsEMBL::EGPipeline::PipeConfig::AlignmentXref_conf
=head1 DESCRIPTION
Align sequence data in order to generate cross-references (aka identity xrefs).
=head1 Author
James Allen
=cut
package Bio::EnsEMBL::EGPipeline::PipeConfig::AlignmentXref_conf;
use strict;
use warnings;
use base ('Bio::EnsEMBL::EGPipeline::PipeConfig::EGGeneric_conf');
use Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf;
use Bio::EnsEMBL::Hive::Version 2.4;
use File::Spec::Functions qw(catdir);
sub default_options {
my ($self) = @_;
return {
%{$self->SUPER::default_options},
pipeline_name => 'alignment_xref_'.$self->o('ensembl_release'),
species => [],
antispecies => [],
division => [],
run_all => 0,
meta_filters => {},
# Parameters for dumping and splitting Fasta query files.
max_seq_length => 10000000,
max_seq_length_per_file => $self->o('max_seq_length'),
max_seqs_per_file => 500,
max_files_per_directory => 100,
max_dirs_per_directory => $self->o('max_files_per_directory'),
max_hive_capacity => 50,
# By default, create xrefs from both reviewed and unreviewed UniProt sets.
uniprot_reviewed => 1,
uniprot_unreviewed => 1,
# Can also create xrefs from RefSeq peptides and DNA.
refseq_peptide => 0,
refseq_dna => 0,
# RefSeq DNA can be aligned against just the coding sequence.
# This might be useful for worms, where the RefSeq transcripts don't have UTRs.
remove_utrs => 0,
# If there are existing xrefs based on checksums, don't introduce
# duplicate xrefs/object_xrefs, by default.
preferred_analysis => ['xrefuniparc', 'xrefuniprot'],
# Default logic_names for the analyses.
uniprot_reviewed_logic_name => 'xref_sprot_blastp',
uniprot_unreviewed_logic_name => 'xref_trembl_blastp',
refseq_peptide_logic_name => 'xref_refseq_blastp',
refseq_dna_logic_name => 'xref_refseq_blastn',
# External DB parameters are effectively constant and should not be altered.
uniprot_reviewed_external_db => 'Uniprot/SWISSPROT',
uniprot_unreviewed_external_db => 'Uniprot/SPTREMBL',
refseq_peptide_external_db => 'RefSeq_peptide',
refseq_dna_external_db => 'RefSeq_dna',
# Some sources have descriptions which are either uninformative or
# potentially misleading. The array elements are matched in their entirety.
description_blacklist => ['Uncharacterized protein', 'AGAP\d.*', 'AAEL\d.*'],
# Align a particular species, rather than one matching the core db species.
source_species => undef,
# Parameters for fetching and saving UniProt data.
uniprot_ebi_path => $self->private_conf('ENSEMBL_UNIPROT_EBI_PATH'),
uniprot_ftp_uri => 'ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase',
uniprot_dir => catdir($self->o('pipeline_dir'), 'uniprot'),
# Parameters for fetching and saving RefSeq data.
refseq_ebi_path => $self->private_conf('ENSEMBL_REFSEQ_EBI_PATH'),
refseq_ftp_uri => 'ftp://ftp.ncbi.nlm.nih.gov/refseq/release',
refseq_dir => catdir($self->o('pipeline_dir'), 'refseq'),
refseq_tax_level => undef,
# Blast parameters
makeblastdb_exe => 'makeblastdb',
blastn_exe => 'blastn',
blastp_exe => 'blastp',
blast_threads => 3,
blastn_parameters => '-word_size 11 -num_alignments 100000 -num_descriptions 100000 -lcase_masking -num_threads '.$self->o('blast_threads'),
blastp_parameters => '-word_size 3 -num_alignments 100000 -num_descriptions 100000 -lcase_masking -seg yes -num_threads '.$self->o('blast_threads'),
# For parsing the output.
output_regex => '^\s*(\S+)',
pvalue_threshold => 0.01,
filter_prune => 1,
filter_min_score => 200,
# Specify blast_db if you don't want it in the directory alongside db_file.
blast_db => undef,
# Analyses to associate with the object_xref.
analyses =>
[
{
'logic_name' => $self->o('uniprot_reviewed_logic_name'),
'display_label' => 'UniProt reviewed proteins',
'description' => 'Cross references to UniProt Swiss-Prot (reviewed) proteins, determined by alignment against the proteome with <em>blastp</em>.',
'displayable' => 0,
'db' => 'sprot',
'program' => 'blastp',
'program_file' => $self->o('blastp_exe'),
'parameters' => $self->o('blastp_parameters'),
'module' => 'Bio::EnsEMBL::Analysis::Runnable::BlastEG',
'db_type' => 'core',
},
{
'logic_name' => $self->o('uniprot_unreviewed_logic_name'),
'display_label' => 'UniProt unreviewed proteins',
'description' => 'Cross references to UniProt TrEMBL (unreviewed) proteins, determined by alignment against the proteome with <em>blastp</em>.',
'displayable' => 0,
'db' => 'trembl',
'program' => 'blastp',
'program_file' => $self->o('blastp_exe'),
'parameters' => $self->o('blastp_parameters'),
'module' => 'Bio::EnsEMBL::Analysis::Runnable::BlastEG',
'db_type' => 'core',
},
{
'logic_name' => $self->o('refseq_peptide_logic_name'),
'display_label' => 'RefSeq peptides',
'description' => 'Cross references to RefSeq peptide sequences, determined by alignment against the proteome with <em>blastp</em>.',
'displayable' => 0,
'db' => 'refseq_peptide',
'program' => 'blastp',
'program_file' => $self->o('blastp_exe'),
'parameters' => $self->o('blastp_parameters'),
'module' => 'Bio::EnsEMBL::Analysis::Runnable::BlastEG',
'db_type' => 'core',
},
{
'logic_name' => $self->o('refseq_dna_logic_name'),
'display_label' => 'RefSeq transcripts',
'description' => 'Cross references to RefSeq nucleotide sequences, determined by alignment against the transcriptome with <em>blastx</em>.',
'displayable' => 0,
'db' => 'refseq_dna',
'program' => 'blastn',
'program_file' => $self->o('blastn_exe'),
'parameters' => $self->o('blastn_parameters'),
'module' => 'Bio::EnsEMBL::Analysis::Runnable::BlastEG',
'db_type' => 'core',
},
],
# Retrieve analysis descriptions from the production database;
# the supplied registry file will need the relevant server details.
production_lookup => 1,
# Entries in the xref table that are not linked to other tables
# via a foreign key relationship are deleted by default.
delete_unattached_xref => 1,
# By default, an email is sent for each species when the pipeline
# is complete, showing the breakdown of xrefs assigned.
email_xref_report => 1,
}
}
sub beekeeper_extra_cmdline_options {
my ($self) = @_;
my $options = join(' ',
$self->SUPER::beekeeper_extra_cmdline_options,
"-reg_conf ".$self->o('registry')
);
return $options;
}
sub hive_meta_table {
my ($self) = @_;
return {
%{$self->SUPER::hive_meta_table},
'hive_use_param_stack' => 1,
};
}
sub pipeline_create_commands {
my ($self) = @_;
return [
@{$self->SUPER::pipeline_create_commands},
'mkdir -p '.$self->o('pipeline_dir'),
$self->db_cmd("CREATE TABLE split_proteome (species varchar(100) NOT NULL, split_file varchar(255) NOT NULL)"),
$self->db_cmd("CREATE TABLE split_transcriptome (species varchar(100) NOT NULL, split_file varchar(255) NOT NULL)"),
];
}
sub pipeline_wide_parameters {
my ($self) = @_;
return {
%{$self->SUPER::pipeline_wide_parameters},
'uniprot_reviewed' => $self->o('uniprot_reviewed'),
'uniprot_unreviewed' => $self->o('uniprot_unreviewed'),
'refseq_peptide' => $self->o('refseq_peptide'),
'refseq_dna' => $self->o('refseq_dna'),
'delete_unattached_xref' => $self->o('delete_unattached_xref'),
'email_xref_report' => $self->o('email_xref_report'),
};
}
sub pipeline_analyses {
my ($self) = @_;
return [
{
-logic_name => 'InitialiseAlignmentXref',
-module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy',
-max_retry_count => 0,
-input_ids => [{}],
-flow_into => {
'1->A' => ['SpeciesFactoryForDumping'],
'A->1' => ['RunAlignment'],
},
-meadow_type => 'LOCAL',
},
{
-logic_name => 'SpeciesFactoryForDumping',
-module => 'Bio::EnsEMBL::EGPipeline::Common::RunnableDB::EGSpeciesFactory',
-max_retry_count => 1,
-parameters => {
species => $self->o('species'),
antispecies => $self->o('antispecies'),
division => $self->o('division'),
run_all => $self->o('run_all'),
meta_filters => $self->o('meta_filters'),
chromosome_flow => 0,
regulation_flow => 0,
variation_flow => 0,
},
-rc_name => 'normal',
-flow_into => {
'2->A' => ['BackupCoreDatabase'],
'A->2' => ['DumpSequence'],
},
-meadow_type => 'LOCAL',
},
{
-logic_name => 'BackupCoreDatabase',
-module => 'Bio::EnsEMBL::EGPipeline::Common::RunnableDB::DatabaseDumper',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 1,
-parameters => {
output_file => catdir($self->o('pipeline_dir'), '#species#', 'core_bkp.sql.gz'),
table_list => ['analysis', 'analysis_description', 'identity_xref', 'object_xref', 'xref'],
},
-rc_name => 'normal',
},
{
-logic_name => 'DumpSequence',
-module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 0,
-flow_into => [
WHEN('#uniprot_reviewed# || '.
'#uniprot_unreviewed# || '.
'#refseq_peptide#' =>
['DumpProteome']
),
WHEN('#refseq_dna#' =>
['DumpTranscriptome']
),
],
-meadow_type => 'LOCAL',
},
{
-logic_name => 'DumpProteome',
-module => 'Bio::EnsEMBL::EGPipeline::Common::RunnableDB::DumpProteome',
-analysis_capacity => 5,
-max_retry_count => 1,
-parameters => {
proteome_dir => catdir($self->o('pipeline_dir'), '#species#', 'proteome'),
use_dbID => 1,
},
-rc_name => 'normal',
-flow_into => ['SplitProteome'],
},
{
-logic_name => 'SplitProteome',
-module => 'Bio::EnsEMBL::EGPipeline::Common::RunnableDB::FastaSplit',
-analysis_capacity => 5,
-max_retry_count => 0,
-parameters => {
fasta_file => '#proteome_file#',
max_seq_length_per_file => $self->o('max_seq_length_per_file'),
max_seqs_per_file => $self->o('max_seqs_per_file'),
max_files_per_directory => $self->o('max_files_per_directory'),
max_dirs_per_directory => $self->o('max_dirs_per_directory'),
},
-rc_name => 'normal',
-flow_into => {
'2' => [ '?table_name=split_proteome' ],
}
},
{
-logic_name => 'DumpTranscriptome',
-module => 'Bio::EnsEMBL::EGPipeline::Common::RunnableDB::DumpTranscriptome',
-analysis_capacity => 5,
-max_retry_count => 1,
-parameters => {
transcriptome_dir => catdir($self->o('pipeline_dir'), '#species#', 'transcriptome'),
use_dbID => 1,
remove_utrs => $self->o('remove_utrs'),
},
-rc_name => 'normal',
-flow_into => ['SplitTranscriptome'],
},
{
-logic_name => 'SplitTranscriptome',
-module => 'Bio::EnsEMBL::EGPipeline::Common::RunnableDB::FastaSplit',
-analysis_capacity => 5,
-max_retry_count => 0,
-parameters => {
fasta_file => '#transcriptome_file#',
max_seq_length_per_file => $self->o('max_seq_length_per_file'),
max_seqs_per_file => $self->o('max_seqs_per_file'),
max_files_per_directory => $self->o('max_files_per_directory'),
max_dirs_per_directory => $self->o('max_dirs_per_directory'),
},
-rc_name => 'normal',
-flow_into => {
'2' => [ '?table_name=split_transcriptome' ],
}
},
{
-logic_name => 'RunAlignment',
-module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy',
-max_retry_count => 0,
-flow_into => [
WHEN('#uniprot_reviewed#' => ['ConfigureUniprotReviewed']),
WHEN('#uniprot_unreviewed#' => ['ConfigureUniprotUnreviewed']),
WHEN('#refseq_peptide#' => ['ConfigureRefSeqPeptide']),
WHEN('#refseq_dna#' => ['ConfigureRefSeqNucleotide']),
],
-meadow_type => 'LOCAL',
},
{
-logic_name => 'ConfigureUniprotReviewed',
-module => 'Bio::EnsEMBL::EGPipeline::Xref::ConfigureSource',
-max_retry_count => 1,
-parameters => {
logic_name => $self->o('uniprot_reviewed_logic_name'),
external_db => $self->o('uniprot_reviewed_external_db'),
},
-flow_into => ['FetchUniprotReviewed'],
-meadow_type => 'LOCAL',
},
{
-logic_name => 'FetchUniprotReviewed',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::FetchUniprot',
-max_retry_count => 2,
-parameters => {
ebi_path => $self->o('uniprot_ebi_path'),
ftp_uri => $self->o('uniprot_ftp_uri'),
uniprot_db => 'sprot',
data_type => '#database_type#',
out_dir => $self->o('uniprot_dir'),
file_varname => 'fasta_file',
},
-rc_name => 'datamove',
-flow_into => ['SpeciesFactoryForLoading'],
},
{
-logic_name => 'ConfigureUniprotUnreviewed',
-module => 'Bio::EnsEMBL::EGPipeline::Xref::ConfigureSource',
-max_retry_count => 1,
-parameters => {
logic_name => $self->o('uniprot_unreviewed_logic_name'),
external_db => $self->o('uniprot_unreviewed_external_db'),
},
-rc_name => 'normal',
-flow_into => ['FetchUniprotUnreviewed'],
},
{
-logic_name => 'FetchUniprotUnreviewed',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::FetchUniprot',
-max_retry_count => 2,
-parameters => {
ebi_path => $self->o('uniprot_ebi_path'),
ftp_uri => $self->o('uniprot_ftp_uri'),
uniprot_db => 'trembl',
data_type => '#database_type#',
out_dir => $self->o('uniprot_dir'),
file_varname => 'fasta_file',
},
-rc_name => 'datamove_32Gb_mem',
-flow_into => ['SpeciesFactoryForLoading'],
},
{
-logic_name => 'ConfigureRefSeqPeptide',
-module => 'Bio::EnsEMBL::EGPipeline::Xref::ConfigureSource',
-max_retry_count => 1,
-parameters => {
logic_name => $self->o('refseq_peptide_logic_name'),
external_db => $self->o('refseq_peptide_external_db'),
},
-rc_name => 'normal',
-flow_into => ['FetchRefSeq'],
},
{
-logic_name => 'ConfigureRefSeqNucleotide',
-module => 'Bio::EnsEMBL::EGPipeline::Xref::ConfigureSource',
-max_retry_count => 1,
-parameters => {
logic_name => $self->o('refseq_dna_logic_name'),
external_db => $self->o('refseq_dna_external_db'),
},
-rc_name => 'normal',
-flow_into => ['FetchRefSeq'],
},
{
-logic_name => 'FetchRefSeq',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::FetchRefSeq',
-max_retry_count => 2,
-parameters => {
ebi_path => $self->o('refseq_ebi_path'),
ftp_uri => $self->o('refseq_ftp_uri'),
taxonomic_level => $self->o('refseq_tax_level'),
data_type => '#database_type#',
out_dir => $self->o('refseq_dir'),
file_varname => 'fasta_file',
},
-rc_name => '32Gb_mem_4Gb_tmp',
-flow_into => ['SpeciesFactoryForLoading'],
},
{
-logic_name => 'SpeciesFactoryForLoading',
-module => 'Bio::EnsEMBL::EGPipeline::Common::RunnableDB::EGSpeciesFactory',
-max_retry_count => 1,
-parameters => {
species => $self->o('species'),
antispecies => $self->o('antispecies'),
division => $self->o('division'),
run_all => $self->o('run_all'),
meta_filters => $self->o('meta_filters'),
chromosome_flow => 0,
regulation_flow => 0,
variation_flow => 0,
},
-flow_into => {
'2->A' => ['AnalysisSetupFactory'],
'A->2' => ['ExtractSpecies'],
},
-meadow_type => 'LOCAL',
},
{
-logic_name => 'AnalysisSetupFactory',
-module => 'Bio::EnsEMBL::EGPipeline::Xref::AnalysisSetupFactory',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 1,
-parameters => {
analyses => $self->o('analyses'),
},
-meadow_type => 'LOCAL',
-flow_into => {
'2' => ['AnalysisSetup'],
},
},
{
-logic_name => 'AnalysisSetup',
-module => 'Bio::EnsEMBL::EGPipeline::Common::RunnableDB::AnalysisSetup',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 0,
-parameters => {
db_backup_required => 1,
db_backup_file => catdir($self->o('pipeline_dir'), '#species#', 'core_bkp.sql.gz'),
delete_existing => 1,
production_lookup => $self->o('production_lookup'),
production_db => $self->o('production_db'),
},
-meadow_type => 'LOCAL',
-flow_into => ['DeleteIdentityXrefs'],
},
{
-logic_name => 'DeleteIdentityXrefs',
-module => 'Bio::EnsEMBL::EGPipeline::Common::RunnableDB::SqlCmd',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 0,
-parameters => {
sql => [
'DELETE ox.*, ix.* FROM '.
'object_xref ox INNER JOIN '.
'identity_xref ix USING (object_xref_id) INNER JOIN '.
'xref x USING (xref_id) INNER JOIN '.
'external_db edb USING (external_db_id) '.
'WHERE edb.db_name = "#external_db#"',]
},
-rc_name => 'normal',
-flow_into => WHEN('#delete_unattached_xref#' => ['DeleteUnattachedXref']),
},
{
-logic_name => 'DeleteUnattachedXref',
-module => 'Bio::EnsEMBL::EGPipeline::Xref::DeleteUnattachedXref',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 0,
-parameters => {},
-rc_name => 'normal',
},
{
-logic_name => 'ExtractSpecies',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::ExtractSpecies',
-hive_capacity => $self->o('max_hive_capacity'),
-max_retry_count => 1,
-parameters => {
source_species => $self->o('source_species'),
file_varname => 'db_fasta_file',
data_type => '#database_type#',
},
-rc_name => 'normal',
-flow_into => ['CreateBlastDB'],
},
{
-logic_name => 'CreateBlastDB',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::CreateBlastDB',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 2,
-parameters => {
makeblastdb_exe => $self->o('makeblastdb_exe'),
blast_db => $self->o('blast_db'),
proteome_source => 'various',
logic_name_prefix => 'various',
},
-rc_name => 'normal',
-flow_into => [
WHEN('#query_type# eq "pep"' =>
['FetchProteomeFiles'],
ELSE
['FetchTranscriptomeFiles']
),
],
},
{
-logic_name => 'FetchProteomeFiles',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::FetchSplitFiles',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 1,
-parameters => {
seq_type => 'proteome',
},
-rc_name => 'normal',
-flow_into => {
'2->A' => ['BlastP'],
'A->1' => ['FilterBlastHits'],
},
},
{
-logic_name => 'BlastP',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::Blast',
-hive_capacity => $self->o('max_hive_capacity'),
-max_retry_count => 1,
-parameters => {
db_type => 'core',
queryfile => '#split_file#',
output_regex => $self->o('output_regex'),
pvalue_threshold => $self->o('pvalue_threshold'),
filter_prune => $self->o('filter_prune'),
filter_min_score => $self->o('filter_min_score'),
escape_branch => -1,
},
-rc_name => '8GB_threads',
-flow_into => {
'-1' => ['BlastP_HighMem'],
},
},
{
-logic_name => 'BlastP_HighMem',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::Blast',
-hive_capacity => $self->o('max_hive_capacity'),
-max_retry_count => 1,
-parameters => {
db_type => 'core',
queryfile => '#split_file#',
output_regex => $self->o('output_regex'),
pvalue_threshold => $self->o('pvalue_threshold'),
filter_prune => $self->o('filter_prune'),
filter_min_score => $self->o('filter_min_score'),
escape_branch => -1,
},
-rc_name => '16GB_threads',
-flow_into => {
'-1' => ['BlastP_HigherMem'],
},
},
{
-logic_name => 'BlastP_HigherMem',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::Blast',
-hive_capacity => $self->o('max_hive_capacity'),
-max_retry_count => 1,
-parameters => {
db_type => 'core',
queryfile => '#split_file#',
output_regex => $self->o('output_regex'),
pvalue_threshold => $self->o('pvalue_threshold'),
filter_prune => $self->o('filter_prune'),
filter_min_score => $self->o('filter_min_score'),
},
-rc_name => '32GB_threads',
},
{
-logic_name => 'FetchTranscriptomeFiles',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::FetchSplitFiles',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 1,
-parameters => {
seq_type => 'transcriptome',
},
-rc_name => 'normal',
-flow_into => {
'2->A' => ['BlastN'],
'A->1' => ['FilterBlastHits'],
},
},
{
-logic_name => 'BlastN',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::Blast',
-hive_capacity => $self->o('max_hive_capacity'),
-max_retry_count => 1,
-parameters => {
db_type => 'core',
queryfile => '#split_file#',
output_regex => $self->o('output_regex'),
pvalue_threshold => $self->o('pvalue_threshold'),
filter_prune => $self->o('filter_prune'),
filter_min_score => $self->o('filter_min_score'),
escape_branch => -1,
},
-rc_name => '8GB_threads',
-flow_into => {
'-1' => ['BlastN_HighMem'],
},
},
{
-logic_name => 'BlastN_HighMem',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::Blast',
-hive_capacity => $self->o('max_hive_capacity'),
-max_retry_count => 1,
-parameters => {
db_type => 'core',
queryfile => '#split_file#',
output_regex => $self->o('output_regex'),
pvalue_threshold => $self->o('pvalue_threshold'),
filter_prune => $self->o('filter_prune'),
filter_min_score => $self->o('filter_min_score'),
escape_branch => -1,
},
-rc_name => '16GB_threads',
-flow_into => {
'-1' => ['BlastN_HigherMem'],
},
},
{
-logic_name => 'BlastN_HigherMem',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::Blast',
-hive_capacity => $self->o('max_hive_capacity'),
-max_retry_count => 1,
-parameters => {
db_type => 'core',
queryfile => '#split_file#',
output_regex => $self->o('output_regex'),
pvalue_threshold => $self->o('pvalue_threshold'),
filter_prune => $self->o('filter_prune'),
filter_min_score => $self->o('filter_min_score'),
},
-rc_name => '32GB_threads',
},
{
-logic_name => 'FilterBlastHits',
-module => 'Bio::EnsEMBL::EGPipeline::BlastAlignment::FilterHits',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 1,
-parameters => {
db_type => 'core',
filter_top_x => 1,
},
-rc_name => 'normal',
-flow_into => ['LoadAlignmentXref'],
},
{
-logic_name => 'LoadAlignmentXref',
-module => 'Bio::EnsEMBL::EGPipeline::Xref::LoadAlignmentXref',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 1,
-parameters => {
db_fasta_file => '#db_fasta_file#',
preferred_analysis => $self->o('preferred_analysis'),
description_blacklist => $self->o('description_blacklist'),
},
-rc_name => 'normal',
-flow_into => ['MetaCoords'],
},
{
-logic_name => 'MetaCoords',
-module => 'Bio::EnsEMBL::EGPipeline::CoreStatistics::MetaCoords',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 1,
-parameters => {},
-rc_name => 'normal',
-flow_into => WHEN('#email_xref_report#' => ['EmailAlignmentXrefReport']),
},
{
-logic_name => 'EmailAlignmentXrefReport',
-module => 'Bio::EnsEMBL::EGPipeline::Xref::EmailAlignmentXrefReport',
-analysis_capacity => 10,
-batch_size => 10,
-max_retry_count => 1,
-parameters => {
email => $self->o('email'),
subject => 'Alignment Xref pipeline report for #species# with #external_db#',
},
-rc_name => 'normal',
},
];
}
sub resource_classes {
my ($self) = @_;
my $blast_threads = $self->o('blast_threads');
my $queue = $self->o('queue_name');
my @mems = (8, 16, 32);
my $cpu = $blast_threads + 1;
my $time = "24:00:00";
my %resources = %{$self->SUPER::resource_classes};
for my $mem (@mems) {
my $name = "${mem}GB_threads";
$resources{$name} = $self->make_resource({
queue => $queue,
"memory" => $mem * 1000,
"temp_memory" => $mem * 1000,
"cpus" => $cpu,
"time" => $time
});
}
return \%resources;
}
1;