| 1 | =head1 LICENSE | ||
| 2 | |||
| 3 | See the NOTICE file distributed with this work for additional information | ||
| 4 | regarding copyright ownership. | ||
| 5 | |||
| 6 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | you may not use this file except in compliance with the License. | ||
| 8 | You may obtain a copy of the License at | ||
| 9 | |||
| 10 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | |||
| 12 | Unless required by applicable law or agreed to in writing, software | ||
| 13 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | See the License for the specific language governing permissions and | ||
| 16 | limitations under the License. | ||
| 17 | |||
| 18 | =cut | ||
| 19 | |||
| 20 | |||
| 21 | =head1 CONTACT | ||
| 22 | |||
| 23 | Please email comments or questions to the public Ensembl | ||
| 24 | developers list at <http://lists.ensembl.org/mailman/listinfo/dev>. | ||
| 25 | |||
| 26 | Questions may also be sent to the Ensembl help desk at | ||
| 27 | <http://www.ensembl.org/Help/Contact>. | ||
| 28 | |||
| 29 | =head1 AUTHOR | ||
| 30 | |||
| 31 | Juguang Xiao <juguang@fugu-sg.org> | ||
| 32 | |||
| 33 | =cut | ||
| 34 | |||
| 35 | =head1 NAME | ||
| 36 | |||
| 37 | Bio::EnsEMBL::Utils::Converter::bio_ens_analysis, a converter instance | ||
| 38 | specific for Analysis. | ||
| 39 | |||
| 40 | =head1 SYNOPISIS | ||
| 41 | |||
| 42 | my $converter = Bio::EnsEMBL::Utils::Converter( | ||
| 43 | -in => 'Bio::Pipeline::Analysis', | ||
| 44 | -out => 'Bio::EnsEMBL::Analysis' | ||
| 45 | ); | ||
| 46 | my $biopipe_analysis; | ||
| 47 | my ($ens_analysis) = @{ $converter->convert( [$biopipe_analysis] ) }; | ||
| 48 | |||
| 49 | =head1 DESCRIPTION | ||
| 50 | |||
| 51 | =head1 METHODS | ||
| 52 | |||
| 53 | =cut | ||
| 54 | |||
| 55 | |||
| 56 | package Bio::EnsEMBL::Utils::Converter::bio_ens_analysis; | ||
| 57 | $Bio::EnsEMBL::Utils::Converter::bio_ens_analysis::VERSION = '114.0.0'; | ||
| 58 | use strict; | ||
| 59 | use vars qw(@ISA); | ||
| 60 | use Bio::EnsEMBL::Utils::Converter::bio_ens; | ||
| 61 | use Bio::EnsEMBL::Analysis; | ||
| 62 | |||
| 63 | @ISA = qw(Bio::EnsEMBL::Utils::Converter::bio_ens); | ||
| 64 | |||
| 65 | sub _convert_single { | ||
| 66 | my ($self, $input) = @_; | ||
| 67 | |||
| 68 | $self->throw("a Bio::Pipeline::Analysis object needed") | ||
| 69 | unless(ref($input) && $input->isa('Bio::Pipeline::Analysis')); | ||
| 70 | |||
| 71 | my $ens_analysis = Bio::EnsEMBL::Analysis->new( | ||
| 72 | -logic_name => $input->logic_name, | ||
| 73 | -db => $input->db, | ||
| 74 | -db_version => $input->db_version, | ||
| 75 | -db_file => $input->db_file, | ||
| 76 | -program => $input->program, | ||
| 77 | -program_version => $input->program_version, | ||
| 78 | -program_file => $input->program_file, | ||
| 79 | -parameters => $input->analysis_parameters, | ||
| 80 | -module => $input->runnable, | ||
| 81 | -gff_source => $input->gff_source, | ||
| 82 | -gff_feature => $input->gff_feature, | ||
| 83 | -id =>$input->dbID | ||
| 84 | ); | ||
| 85 | |||
| 86 | return $ens_analysis; | ||
| 87 | } | ||
| 88 | ; |