Bring base classes from BioPerl-run back to BioPerl.
[bioperl-live.git] / Bio / Factory / SequenceFactoryI.pm
blobad0e33e622a0e57bb04ab67d15c31ae63b34087a
2 # BioPerl module for Bio::Factory::SequenceFactoryI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Jason Stajich <jason@bioperl.org>
8 # Copyright Jason Stajich
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
14 =head1 NAME
16 Bio::Factory::SequenceFactoryI - This interface allows for generic building of sequences in factories which create sequences (like SeqIO)
18 =head1 SYNOPSIS
20 # do not use this object directly it is an interface
21 # get a Bio::Factory::SequenceFactoryI object like
23 use Bio::Seq::SeqFactory;
24 my $seqbuilder = Bio::Seq::SeqFactory->new('-type' => 'Bio::PrimarySeq');
26 my $seq = $seqbuilder->create(-seq => 'ACTGAT',
27 -display_id => 'exampleseq');
29 print "seq is a ", ref($seq), "\n";
31 =head1 DESCRIPTION
33 A generic way to build Sequence objects via a pluggable factory. This
34 reduces the amount of code that looks like
36 if( $type eq 'Bio::PrimarySeq' ) { ... }
37 elsif( $type eq 'Bio::Seq::RichSeq' ) { ... }
39 =head1 FEEDBACK
41 =head2 Mailing Lists
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.
47 bioperl-l@bioperl.org - General discussion
48 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
50 =head2 Support
52 Please direct usage questions or support issues to the mailing list:
54 I<bioperl-l@bioperl.org>
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.
61 =head2 Reporting Bugs
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:
67 https://github.com/bioperl/bioperl-live/issues
69 =head1 AUTHOR - Jason Stajich
71 Email jason-at-bioperl.org
73 =head1 APPENDIX
75 The rest of the documentation details each of the object methods.
76 Internal methods are usually preceded with a _
78 =cut
81 # Let the code begin...
84 package Bio::Factory::SequenceFactoryI;
86 use strict;
88 use base qw(Bio::Factory::ObjectFactoryI);
90 =head2 create
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
104 =cut