Filename | /Users/ap13/perl5/lib/perl5/Bio/Factory/SequenceFactoryI.pm |
Statements | Executed 5 statements in 60µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 15µs | 28µs | BEGIN@86 | Bio::Factory::SequenceFactoryI::
1 | 1 | 1 | 9µs | 424µs | BEGIN@88 | Bio::Factory::SequenceFactoryI::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
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 | |||||
86 | 2 | 31µs | 2 | 42µs | # spent 28µs (15+13) within Bio::Factory::SequenceFactoryI::BEGIN@86 which was called:
# once (15µs+13µs) by base::import at line 86 # spent 28µs making 1 call to Bio::Factory::SequenceFactoryI::BEGIN@86
# spent 13µs making 1 call to strict::import |
87 | |||||
88 | 2 | 27µs | 2 | 424µs | # spent 424µs (9+415) within Bio::Factory::SequenceFactoryI::BEGIN@88 which was called:
# once (9µs+415µs) by base::import at line 88 # spent 424µs making 1 call to Bio::Factory::SequenceFactoryI::BEGIN@88
# spent 415µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 415µs |
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 | 1 | 2µs | 1; |