Skip to content

Commit

Permalink
embl & genbank: Standarized their qualifier treatment (removed use of…
Browse files Browse the repository at this point in the history
… $_,

avoid not defined $qualifier warning, and added "\s*" just after
equal sign)
  • Loading branch information
fjossandon committed Dec 13, 2015
1 parent b5e68c7 commit c1312ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions Bio/SeqIO/embl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1356,11 +1356,14 @@ sub _read_FTHelper_EMBL {

# Now parse and add any qualifiers. (@qual is kept
# intact to provide informative error messages.)
QUAL: for (my $i = 0; $i < @qual; $i++) {
$_ = $qual[$i];
my( $qualifier, $value ) = m{^/([^=]+)(?:=\s*(.+))?}
QUAL:
for (my $i = 0; $i < @qual; $i++) {
my $data = $qual[$i];
my ( $qualifier, $value ) = ($data =~ m{^/([^=]+)(?:=\s*(.+))?})
or $self->throw("Can't see new qualifier in: $_\nfrom:\n"
. join('', map "$_\n", @qual));
$qualifier = '' if not defined $qualifier;

if (defined $value) {
# Do we have a quoted value?
if (substr($value, 0, 1) eq '"') {
Expand Down
6 changes: 3 additions & 3 deletions Bio/SeqIO/genbank.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1716,10 +1716,10 @@ sub _read_FTHelper_GenBank {
QUAL:
for (my $i = 0; $i < @qual; $i++) {
my $data = $qual[$i];
my ( $qualifier, $value ) = ($data =~ m{^/([^=]+)(?:=(.+))?})
my ( $qualifier, $value ) = ($data =~ m{^/([^=]+)(?:=\s*(.+))?})
or $self->warn( "cannot see new qualifier in feature $key: "
. $qual[$i]);
$qualifier = '' unless( defined $qualifier );
. $data);
$qualifier = '' if not defined $qualifier;

if (defined $value) {
# Do we have a quoted value?
Expand Down

0 comments on commit c1312ac

Please sign in to comment.