Skip to content

Commit

Permalink
Bio::Tools::GFF->gff_string: handle sequences named "0" (#383)
Browse files Browse the repository at this point in the history
When the sequence name is missing, we use the string "SEQ".  We were
evaluating the truthiness of the string value which evaluates as false
when the string is "0".

This commit replace the check with the string length.
  • Loading branch information
Juke34 authored and carandraug committed Jul 12, 2023
1 parent d622ca4 commit febf38e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/Bio/Tools/GFF.pm
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,8 @@ sub _gff1_string{

if( $feat->can('seqname') ) {
$name = $feat->seq_id();
$name ||= 'SEQ';
} else {
$name = 'SEQ';
}
$name = 'SEQ' if ! length($name);

$str = join("\t",
$name,
Expand Down Expand Up @@ -807,7 +805,7 @@ sub _gff2_string{
if( $feat->can('seqname') ) {
$name = $feat->seq_id();
}
$name ||= 'SEQ';
$name = 'SEQ' if ! length($name);

$str1 = join("\t",
$name,
Expand Down Expand Up @@ -908,10 +906,9 @@ sub _gff25_string {

if( $feat->can('seqname') ) {
$name = $feat->seq_id();
$name ||= 'SEQ';
} else {
$name = 'SEQ';
}
$name = 'SEQ' if ! length($name);

$str1 = join("\t",
$name,
$feat->source_tag(),
Expand Down Expand Up @@ -1013,10 +1010,8 @@ sub _gff3_string {

if( $feat->can('seqname') ) {
$name = $feat->seq_id();
$name ||= 'SEQ';
} else {
$name = 'SEQ';
}
$name = 'SEQ' if ! length($name);

my @groups;

Expand Down

0 comments on commit febf38e

Please sign in to comment.