| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package FASTAParse; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# | PACKAGE | FASTAParse |
|
4
|
|
|
|
|
|
|
# | AUTHOR | Todd Wylie |
|
5
|
|
|
|
|
|
|
# | EMAIL | perldev@monkeybytes.org |
|
6
|
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
31154
|
use version; $VERSION = qv('0.0.3'); |
|
|
2
|
|
|
|
|
4882
|
|
|
|
2
|
|
|
|
|
20
|
|
|
8
|
2
|
|
|
2
|
|
165
|
use warnings; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
67
|
|
|
9
|
2
|
|
|
2
|
|
11
|
use strict; |
|
|
2
|
|
|
|
|
9
|
|
|
|
2
|
|
|
|
|
55
|
|
|
10
|
2
|
|
|
2
|
|
13
|
use Carp; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
185
|
|
|
11
|
2
|
|
|
2
|
|
1117
|
use IO::File; |
|
|
2
|
|
|
|
|
12614
|
|
|
|
2
|
|
|
|
|
4453
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
14
|
|
|
|
|
|
|
# N E W (class CONSTRUCTOR) |
|
15
|
|
|
|
|
|
|
# ========================================================================== |
|
16
|
|
|
|
|
|
|
# USAGE : FASTAParse->new(); |
|
17
|
|
|
|
|
|
|
# PURPOSE : constructor for class |
|
18
|
|
|
|
|
|
|
# RETURNS : object handle |
|
19
|
|
|
|
|
|
|
# PARAMETERS : none |
|
20
|
|
|
|
|
|
|
# COMMENTS : FASTA object. |
|
21
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
22
|
|
|
|
|
|
|
sub new { |
|
23
|
2
|
|
|
2
|
1
|
997
|
my $class = shift; |
|
24
|
|
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
23
|
my $self = { |
|
26
|
|
|
|
|
|
|
_id => '', |
|
27
|
|
|
|
|
|
|
_descriptors => [], |
|
28
|
|
|
|
|
|
|
_comments => [], |
|
29
|
|
|
|
|
|
|
_sequence => [], |
|
30
|
|
|
|
|
|
|
}; |
|
31
|
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
5
|
bless($self, $class); |
|
33
|
2
|
|
|
|
|
8
|
return($self); |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
38
|
|
|
|
|
|
|
# L O A D F A S T A (method) |
|
39
|
|
|
|
|
|
|
# ========================================================================== |
|
40
|
|
|
|
|
|
|
# USAGE : FASTAParse->load_FASTA(); |
|
41
|
|
|
|
|
|
|
# PURPOSE : loads a chunk of FASTA into the class |
|
42
|
|
|
|
|
|
|
# RETURNS : none |
|
43
|
|
|
|
|
|
|
# PARAMETERS : fasta => '' |
|
44
|
|
|
|
|
|
|
# THROWS : croaks if no FASTA attribute or bad FASTA header |
|
45
|
|
|
|
|
|
|
# COMMENTS : The user sould be passing a chunk of text (scalar) to |
|
46
|
|
|
|
|
|
|
# : this method which represents 1 FASTA entry... from the |
|
47
|
|
|
|
|
|
|
# : > symbol to the end of the sequence; includes line |
|
48
|
|
|
|
|
|
|
# : returns. |
|
49
|
|
|
|
|
|
|
# EXAMPLE : Example format: |
|
50
|
|
|
|
|
|
|
# : >gi|55416189|gb|AAV50056.1| NADH dehydrogenase subunit 1 [Dasyurus hallucatus] |
|
51
|
|
|
|
|
|
|
# : ;Taken from nr GenBank |
|
52
|
|
|
|
|
|
|
# : MFTINLLIYIIPILLAVAFLTLIERKMLGYMQFRKGPNIVGPYGLLQPFADAVKLFTKEPLRPLTSSISIFIIAPILALT |
|
53
|
|
|
|
|
|
|
# : IALTIWTPLPMPNTLLDLNLGLIFILSLSGLSVYSILWSGWASNSKYALIGALRAVAQTISYEVSLAIILLSIMLINGSF |
|
54
|
|
|
|
|
|
|
# : TLKTLSITQENLWLIITTWPLAMMWYISTLAETNRAPFDLTEGESELVSGFNVEYAAGPFAMFFLAEYANIIAMNAITTI |
|
55
|
|
|
|
|
|
|
# : LFLGPSLTPNLSHLNTLSFMLKTLLLTMVFLWVRASYPRFRYDQLMHLLWKNFLPMTLAM |
|
56
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
57
|
|
|
|
|
|
|
sub load_FASTA { |
|
58
|
1
|
|
|
1
|
1
|
6
|
my ($class, %arg) = @_; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# Check incoming FASTA format: |
|
61
|
1
|
50
|
|
|
|
4
|
if (!$arg{fasta}) { croak "load_FASTA needs FASTA attribute" } |
|
|
0
|
|
|
|
|
0
|
|
|
62
|
1
|
50
|
|
|
|
8
|
if ($arg{fasta} !~ />/) { croak "no FASTA header found for input" } |
|
|
0
|
|
|
|
|
0
|
|
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Parse sequence and load the FASTA object: |
|
65
|
1
|
|
|
|
|
9
|
my @lines = split( /\n/, $arg{fasta} ); |
|
66
|
1
|
|
|
|
|
3
|
foreach my $line (@lines) { |
|
67
|
4
|
100
|
|
|
|
16
|
if ($line =~ /^>\S+/) { |
|
|
|
100
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# Header line: |
|
69
|
1
|
|
|
|
|
8
|
my ($id, $descriptions) = $line =~ /^>(\S+)\s*(.*)/; |
|
70
|
1
|
|
|
|
|
4
|
$class->{_id} = $id; |
|
71
|
1
|
50
|
|
|
|
4
|
if (defined$descriptions) { |
|
72
|
1
|
|
|
|
|
10
|
@{$class->{_descriptors}} = split( /\cA/, $descriptions ); |
|
|
1
|
|
|
|
|
7
|
|
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
elsif ($line =~ /^;\s*(.+)/) { |
|
76
|
|
|
|
|
|
|
# Comment lines: |
|
77
|
1
|
|
|
|
|
2
|
push( @{$class->{_comments}}, $1 ); |
|
|
1
|
|
|
|
|
5
|
|
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
else { |
|
80
|
|
|
|
|
|
|
# Sequence lines: |
|
81
|
2
|
|
|
|
|
4
|
$line =~ s/\s+//g; |
|
82
|
2
|
50
|
|
|
|
5
|
unless( $line eq "" ) { push( @{$class->{_sequence}}, $line ) } |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
7
|
|
|
83
|
|
|
|
|
|
|
} |
|
84
|
|
|
|
|
|
|
} |
|
85
|
1
|
|
|
|
|
5
|
return($class); |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
90
|
|
|
|
|
|
|
# F O R M A T F A S T A (method) |
|
91
|
|
|
|
|
|
|
# ========================================================================== |
|
92
|
|
|
|
|
|
|
# USAGE : $fasta->format_FASTA(); |
|
93
|
|
|
|
|
|
|
# PURPOSE : Manually populate the FASTA class. |
|
94
|
|
|
|
|
|
|
# RETURNS : none |
|
95
|
|
|
|
|
|
|
# PARAMETERS : id => '' # REQUIRED |
|
96
|
|
|
|
|
|
|
# : sequnce => '' # REQUIRED |
|
97
|
|
|
|
|
|
|
# : comments => [] |
|
98
|
|
|
|
|
|
|
# : descriptors => [] |
|
99
|
|
|
|
|
|
|
# : cols => '' |
|
100
|
|
|
|
|
|
|
# COMMENTS : A user may manually load a FASTA object. Only ID and SEQUENCE |
|
101
|
|
|
|
|
|
|
# : are required, all others are optional. The SEQUENCE attribute |
|
102
|
|
|
|
|
|
|
# : should be a flat, single line scalar value (i.e., a single |
|
103
|
|
|
|
|
|
|
# : string of sequence). |
|
104
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
105
|
|
|
|
|
|
|
sub format_FASTA { |
|
106
|
1
|
|
|
1
|
1
|
12
|
my ($class, %arg) = @_; |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
# Format the incoming sequence. Sequence must be single line, |
|
109
|
|
|
|
|
|
|
# flatten sequence string. Check incoming FASTA format first: |
|
110
|
1
|
50
|
|
|
|
12
|
if (!$arg{sequence}) { croak "format_FASTA needs SEQUENCE attribute" } |
|
|
0
|
|
|
|
|
0
|
|
|
111
|
1
|
50
|
|
|
|
3
|
if (!$arg{id} ) { croak "format_FASTA needs ID attribute" } |
|
|
0
|
|
|
|
|
0
|
|
|
112
|
1
|
50
|
|
|
|
6
|
my $columns = defined $arg{cols} ? $arg{cols} : 60; # Default is 60 cols. |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# If incoming sequence is multi-part, join them before breaking |
|
115
|
|
|
|
|
|
|
# into FASTA lines: |
|
116
|
1
|
|
|
|
|
4
|
delete( $class->{_sequence} ); |
|
117
|
1
|
|
|
|
|
3
|
my $fasta = join( "", $arg{sequence} ); |
|
118
|
1
|
|
|
|
|
2
|
my $length = length( $fasta ); |
|
119
|
1
|
|
|
|
|
1
|
my $pos = 0; |
|
120
|
1
|
|
|
|
|
5
|
my $lines = int( $length / $columns) + 1; |
|
121
|
1
|
|
|
|
|
5
|
for (my $i = 1; $i <= $lines; $i++) { |
|
122
|
2
|
|
|
|
|
4
|
my $line = substr( $fasta, $pos, $columns ); |
|
123
|
2
|
|
|
|
|
3
|
push( @{$class->{_sequence}}, $line ); |
|
|
2
|
|
|
|
|
5
|
|
|
124
|
2
|
|
|
|
|
6
|
$pos = $pos + $columns; |
|
125
|
|
|
|
|
|
|
} |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
# Descriptions, comments, etc. |
|
128
|
1
|
|
|
|
|
8
|
$class->{_id} = $arg{id}; |
|
129
|
1
|
50
|
|
|
|
2
|
if (defined @{$arg{comments}}) { |
|
|
1
|
|
|
|
|
11
|
|
|
130
|
1
|
|
|
|
|
2
|
@{$class->{_comments}} = @{$arg{comments}}; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
2
|
|
|
131
|
|
|
|
|
|
|
} |
|
132
|
1
|
50
|
|
|
|
2
|
if (defined @{$arg{descriptors}}) { |
|
|
1
|
|
|
|
|
7
|
|
|
133
|
1
|
|
|
|
|
1
|
@{$class->{_descriptors}} = @{$arg{descriptors}}; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
3
|
|
|
134
|
|
|
|
|
|
|
} |
|
135
|
|
|
|
|
|
|
|
|
136
|
1
|
|
|
|
|
5
|
return( $class ); |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
141
|
|
|
|
|
|
|
# D U M P F A S T A (method) |
|
142
|
|
|
|
|
|
|
# ========================================================================== |
|
143
|
|
|
|
|
|
|
# USAGE : $fasta->dump_FASTA(); |
|
144
|
|
|
|
|
|
|
# PURPOSE : Accessor to dump the FASTA class into text. |
|
145
|
|
|
|
|
|
|
# RETURNS : scalar (chunk of FASTA text) |
|
146
|
|
|
|
|
|
|
# PARAMETERS : none |
|
147
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
148
|
|
|
|
|
|
|
sub dump_FASTA { |
|
149
|
1
|
|
|
1
|
1
|
1237
|
my $class = shift; |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
# Dump the class in scalar context: |
|
152
|
1
|
|
|
|
|
2
|
my $returnable; |
|
153
|
1
|
50
|
|
|
|
4
|
if (defined $class->{_id}) { |
|
154
|
1
|
|
|
|
|
2
|
my $descriptors = join( "\cA", @{$class->{_descriptors}} ); # ^A delimiter |
|
|
1
|
|
|
|
|
14
|
|
|
155
|
1
|
|
|
|
|
6
|
$returnable = ">$class->{_id} $descriptors\n"; |
|
156
|
1
|
|
|
|
|
2
|
foreach my $comment ( @{$class->{_comments}} ) { |
|
|
1
|
|
|
|
|
2
|
|
|
157
|
1
|
|
|
|
|
10
|
$returnable .= ";$comment\n"; |
|
158
|
|
|
|
|
|
|
} |
|
159
|
1
|
|
|
|
|
2
|
foreach my $sequence ( @{$class->{_sequence}} ) { |
|
|
1
|
|
|
|
|
2
|
|
|
160
|
2
|
|
|
|
|
5
|
$returnable .= "$sequence\n"; |
|
161
|
|
|
|
|
|
|
} |
|
162
|
|
|
|
|
|
|
} |
|
163
|
|
|
|
|
|
|
else { |
|
164
|
0
|
|
|
|
|
0
|
croak "ID is missing from the object"; |
|
165
|
|
|
|
|
|
|
} |
|
166
|
|
|
|
|
|
|
|
|
167
|
1
|
|
|
|
|
5
|
return( $returnable ); |
|
168
|
|
|
|
|
|
|
} |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
172
|
|
|
|
|
|
|
# S A V E F A S T A (method) |
|
173
|
|
|
|
|
|
|
# ========================================================================== |
|
174
|
|
|
|
|
|
|
# USAGE : $fasta->save_FASTA( save => '' ); |
|
175
|
|
|
|
|
|
|
# PURPOSE : Accessor to save the FASTA entry to a file. |
|
176
|
|
|
|
|
|
|
# RETURNS : none |
|
177
|
|
|
|
|
|
|
# PARAMETERS : save => '' |
|
178
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
179
|
|
|
|
|
|
|
sub save_FASTA { |
|
180
|
1
|
|
|
1
|
1
|
3065
|
my ($class, %arg) = @_; |
|
181
|
|
|
|
|
|
|
|
|
182
|
1
|
50
|
|
|
|
5
|
if (!$arg{save}) { croak "save_FASTA needs SAVE attribute" } |
|
|
0
|
|
|
|
|
0
|
|
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
# Save the class information to a file: |
|
185
|
1
|
50
|
|
|
|
10
|
my $save = new IO::File ">>$arg{save}" or croak "could not save to file $arg{save}"; |
|
186
|
1
|
|
|
|
|
114
|
my $returnable; |
|
187
|
1
|
50
|
|
|
|
4
|
if (defined $class->{_id}) { |
|
188
|
1
|
|
|
|
|
2
|
my $descriptors = join( "\cA", @{$class->{_descriptors}} ); # ^A delimiter |
|
|
1
|
|
|
|
|
3
|
|
|
189
|
1
|
|
|
|
|
5
|
$returnable = ">$class->{_id} $descriptors\n"; |
|
190
|
1
|
|
|
|
|
2
|
foreach my $comment ( @{$class->{_comments}} ) { |
|
|
1
|
|
|
|
|
3
|
|
|
191
|
1
|
|
|
|
|
4
|
$returnable .= ";$comment\n"; |
|
192
|
|
|
|
|
|
|
} |
|
193
|
1
|
|
|
|
|
2
|
foreach my $sequence ( @{$class->{_sequence}} ) { |
|
|
1
|
|
|
|
|
3
|
|
|
194
|
2
|
|
|
|
|
5
|
$returnable .= "$sequence\n"; |
|
195
|
|
|
|
|
|
|
} |
|
196
|
|
|
|
|
|
|
} |
|
197
|
|
|
|
|
|
|
else { |
|
198
|
0
|
|
|
|
|
0
|
croak "ID is missing from the object"; |
|
199
|
|
|
|
|
|
|
} |
|
200
|
1
|
|
|
|
|
16
|
print $save "$returnable"; |
|
201
|
|
|
|
|
|
|
|
|
202
|
1
|
|
|
|
|
59
|
return($class); |
|
203
|
|
|
|
|
|
|
} |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
207
|
|
|
|
|
|
|
# P R I N T (method) |
|
208
|
|
|
|
|
|
|
# ========================================================================== |
|
209
|
|
|
|
|
|
|
# USAGE : $fasta->print(); |
|
210
|
|
|
|
|
|
|
# PURPOSE : Accessor to print the FASTA class to STDOUT. |
|
211
|
|
|
|
|
|
|
# RETURNS : none |
|
212
|
|
|
|
|
|
|
# PARAMETERS : none |
|
213
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
214
|
|
|
|
|
|
|
sub print { |
|
215
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
# Print the class to STDOUT: |
|
218
|
1
|
|
|
|
|
2
|
my $printable; |
|
219
|
1
|
50
|
|
|
|
4
|
if (defined $class->{_id}) { |
|
220
|
1
|
|
|
|
|
1
|
my $descriptors = join( "\cA", @{$class->{_descriptors}} ); # ^A delimiter |
|
|
1
|
|
|
|
|
13
|
|
|
221
|
1
|
|
|
|
|
6
|
$printable = ">$class->{_id} $descriptors\n"; |
|
222
|
1
|
|
|
|
|
1
|
foreach my $comment ( @{$class->{_comments}} ) { |
|
|
1
|
|
|
|
|
3
|
|
|
223
|
1
|
|
|
|
|
8
|
$printable .= ";$comment\n"; |
|
224
|
|
|
|
|
|
|
} |
|
225
|
1
|
|
|
|
|
2
|
foreach my $sequence ( @{$class->{_sequence}} ) { |
|
|
1
|
|
|
|
|
3
|
|
|
226
|
2
|
|
|
|
|
4
|
$printable .= "$sequence\n"; |
|
227
|
|
|
|
|
|
|
} |
|
228
|
1
|
|
|
|
|
500
|
print $printable; |
|
229
|
|
|
|
|
|
|
} |
|
230
|
|
|
|
|
|
|
else { |
|
231
|
0
|
|
|
|
|
0
|
croak "ID is missing from the object"; |
|
232
|
|
|
|
|
|
|
} |
|
233
|
|
|
|
|
|
|
|
|
234
|
1
|
|
|
|
|
5
|
return( $class ); |
|
235
|
|
|
|
|
|
|
} |
|
236
|
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
239
|
|
|
|
|
|
|
# I D (method) |
|
240
|
|
|
|
|
|
|
# ========================================================================== |
|
241
|
|
|
|
|
|
|
# USAGE : $fasta->id(); |
|
242
|
|
|
|
|
|
|
# PURPOSE : Accessor to retrieve the FASTA ID. |
|
243
|
|
|
|
|
|
|
# RETURNS : scalar |
|
244
|
|
|
|
|
|
|
# PARAMETERS : none |
|
245
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
246
|
|
|
|
|
|
|
sub id { |
|
247
|
2
|
|
|
2
|
1
|
4
|
my $class = shift; |
|
248
|
2
|
50
|
|
|
|
7
|
if (defined $class->{_id}) { |
|
249
|
2
|
|
|
|
|
8
|
return( $class->{_id} ); |
|
250
|
|
|
|
|
|
|
} |
|
251
|
|
|
|
|
|
|
else { |
|
252
|
0
|
|
|
|
|
0
|
croak "ID does not exist in object"; |
|
253
|
|
|
|
|
|
|
} |
|
254
|
|
|
|
|
|
|
} |
|
255
|
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
258
|
|
|
|
|
|
|
# S E Q U E N C E (method) |
|
259
|
|
|
|
|
|
|
# ========================================================================== |
|
260
|
|
|
|
|
|
|
# USAGE : $fasta->sequence(); |
|
261
|
|
|
|
|
|
|
# PURPOSE : Accessor to retrieve the FASTA sequence. |
|
262
|
|
|
|
|
|
|
# RETURNS : scalar |
|
263
|
|
|
|
|
|
|
# PARAMETERS : none |
|
264
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
265
|
|
|
|
|
|
|
sub sequence { |
|
266
|
2
|
|
|
2
|
1
|
4
|
my $class = shift; |
|
267
|
2
|
50
|
|
|
|
7
|
if (defined $class->{_sequence} ) { |
|
268
|
2
|
|
|
|
|
3
|
my $sequence = join( "", @{$class->{_sequence}} ); |
|
|
2
|
|
|
|
|
6
|
|
|
269
|
2
|
|
|
|
|
8
|
return( $sequence ); |
|
270
|
|
|
|
|
|
|
} |
|
271
|
|
|
|
|
|
|
else { |
|
272
|
0
|
|
|
|
|
0
|
croak "SEQUENCE does not exist in object"; |
|
273
|
|
|
|
|
|
|
} |
|
274
|
|
|
|
|
|
|
} |
|
275
|
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
278
|
|
|
|
|
|
|
# D E S C R I P T O R S (method) |
|
279
|
|
|
|
|
|
|
# ========================================================================== |
|
280
|
|
|
|
|
|
|
# USAGE : $fasta->descriptors(); |
|
281
|
|
|
|
|
|
|
# PURPOSE : Accessor to retrieve the FASTA descriptors. |
|
282
|
|
|
|
|
|
|
# RETURNS : array reference |
|
283
|
|
|
|
|
|
|
# PARAMETERS : none |
|
284
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
285
|
|
|
|
|
|
|
sub descriptors { |
|
286
|
2
|
|
|
2
|
1
|
6
|
my $class = shift; |
|
287
|
2
|
|
|
|
|
3
|
return( \@{$class->{_descriptors}} ); |
|
|
2
|
|
|
|
|
13
|
|
|
288
|
|
|
|
|
|
|
} |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
292
|
|
|
|
|
|
|
# C O M M E N T S (method) |
|
293
|
|
|
|
|
|
|
# ========================================================================== |
|
294
|
|
|
|
|
|
|
# USAGE : $fasta->comments(); |
|
295
|
|
|
|
|
|
|
# PURPOSE : Accessor to retrieve the FASTA comments. |
|
296
|
|
|
|
|
|
|
# RETURNS : array reference |
|
297
|
|
|
|
|
|
|
# PARAMETERS : none |
|
298
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
299
|
|
|
|
|
|
|
sub comments { |
|
300
|
2
|
|
|
2
|
1
|
6
|
my $class = shift; |
|
301
|
2
|
|
|
|
|
2
|
return( \@{$class->{_comments}} ); |
|
|
2
|
|
|
|
|
12
|
|
|
302
|
|
|
|
|
|
|
} |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
1; # End of module. |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
__END__ |