| 1 | # | ||
| 2 | # BioPerl module for Bio::Factory::SequenceFactoryI | ||
| 3 | # | ||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||
| 5 | # | ||
| 6 | # Cared for by Jason Stajich <jason@bioperl.org> | ||
| 7 | # | ||
| 8 | # Copyright Jason Stajich | ||
| 9 | # | ||
| 10 | # You may distribute this module under the same terms as perl itself | ||
| 11 | |||
| 12 | # POD documentation - main docs before the code | ||
| 13 | |||
| 14 | =head1 NAME | ||
| 15 | |||
| 16 | Bio::Factory::SequenceFactoryI - This interface allows for generic building of sequences in factories which create sequences (like SeqIO) | ||
| 17 | |||
| 18 | =head1 SYNOPSIS | ||
| 19 | |||
| 20 | # do not use this object directly it is an interface | ||
| 21 | # get a Bio::Factory::SequenceFactoryI object like | ||
| 22 | |||
| 23 | use Bio::Seq::SeqFactory; | ||
| 24 | my $seqbuilder = Bio::Seq::SeqFactory->new('-type' => 'Bio::PrimarySeq'); | ||
| 25 | |||
| 26 | my $seq = $seqbuilder->create(-seq => 'ACTGAT', | ||
| 27 | -display_id => 'exampleseq'); | ||
| 28 | |||
| 29 | print "seq is a ", ref($seq), "\n"; | ||
| 30 | |||
| 31 | =head1 DESCRIPTION | ||
| 32 | |||
| 33 | A generic way to build Sequence objects via a pluggable factory. This | ||
| 34 | reduces the amount of code that looks like | ||
| 35 | |||
| 36 | if( $type eq 'Bio::PrimarySeq' ) { ... } | ||
| 37 | elsif( $type eq 'Bio::Seq::RichSeq' ) { ... } | ||
| 38 | |||
| 39 | =head1 FEEDBACK | ||
| 40 | |||
| 41 | =head2 Mailing Lists | ||
| 42 | |||
| 43 | User feedback is an integral part of the evolution of this and other | ||
| 44 | Bioperl modules. Send your comments and suggestions preferably to | ||
| 45 | the Bioperl mailing list. Your participation is much appreciated. | ||
| 46 | |||
| 47 | bioperl-l@bioperl.org - General discussion | ||
| 48 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||
| 49 | |||
| 50 | =head2 Support | ||
| 51 | |||
| 52 | Please direct usage questions or support issues to the mailing list: | ||
| 53 | |||
| 54 | I<bioperl-l@bioperl.org> | ||
| 55 | |||
| 56 | rather than to the module maintainer directly. Many experienced and | ||
| 57 | reponsive experts will be able look at the problem and quickly | ||
| 58 | address it. Please include a thorough description of the problem | ||
| 59 | with code and data examples if at all possible. | ||
| 60 | |||
| 61 | =head2 Reporting Bugs | ||
| 62 | |||
| 63 | Report bugs to the Bioperl bug tracking system to help us keep track | ||
| 64 | of the bugs and their resolution. Bug reports can be submitted via the | ||
| 65 | web: | ||
| 66 | |||
| 67 | https://github.com/bioperl/bioperl-live/issues | ||
| 68 | |||
| 69 | =head1 AUTHOR - Jason Stajich | ||
| 70 | |||
| 71 | Email jason-at-bioperl.org | ||
| 72 | |||
| 73 | =head1 APPENDIX | ||
| 74 | |||
| 75 | The rest of the documentation details each of the object methods. | ||
| 76 | Internal methods are usually preceded with a _ | ||
| 77 | |||
| 78 | =cut | ||
| 79 | |||
| 80 | |||
| 81 | # Let the code begin... | ||
| 82 | |||
| 83 | |||
| 84 | package Bio::Factory::SequenceFactoryI; | ||
| 85 | 279 | $Bio::Factory::SequenceFactoryI::VERSION = '1.7.8'; | |
| 86 | 279 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 87 | |||
| 88 | 279 | ▶ | use base qw(Bio::Factory::ObjectFactoryI); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 89 | |||
| 90 | =head2 create | ||
| 91 | |||
| 92 | Title : create | ||
| 93 | Usage : my $seq = $seqbuilder->create(-seq => 'CAGT', | ||
| 94 | -id => 'name'); | ||
| 95 | Function: Instantiates new Bio::PrimarySeqI (or one of its child classes) | ||
| 96 | This object allows us to genericize the instantiation of sequence | ||
| 97 | objects. | ||
| 98 | Returns : Bio::PrimarySeqI | ||
| 99 | Args : initialization parameters specific to the type of sequence | ||
| 100 | object we want. Typically | ||
| 101 | -seq => $str, | ||
| 102 | -display_id => $name | ||
| 103 | |||
| 104 | =cut | ||
| 105 | |||
| 106 | 279 | 1; | |