Skip to content

Commit

Permalink
Force ID field for all gb files converted to gff3
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Liles committed Jul 30, 2010
1 parent b0b52cc commit c1abbd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Bio/Tools/GFF.pm
Expand Up @@ -1033,6 +1033,13 @@ sub _gff3_string {
unshift @all_tags, $t if $feat->has_tag($t);
}

#force a Name tag for anything that has an ID
my %all_tags;
map $all_tags{$_} = 1, @all_tags;
if ($all_tags{'ID'} && ! $all_tags{'Name'}) {
push @groups, "Name=".join(",",$feat->each_tag_value('ID'));
}

for my $tag ( @all_tags ) {
next if exists $SKIPPED_TAGS{$tag};
# next if $tag eq 'Target';
Expand Down
1 change: 1 addition & 0 deletions Build.PL
Expand Up @@ -64,6 +64,7 @@ my $build = Bio::Root::Build->new(
'perl' => '5.6.1',
'IO::String' => 0,
'DB_File' => 0,
'YAML' => 0,
'Data::Stag' => 0.11, # Bio::SeqIO::swiss, we can change to 'recommend' if needed
'Scalar::Util' => 0, # not in Perl 5.6.1, arrived in core in 5.7.3
'ExtUtils::Manifest' => '1.52', # allows spaces in file names
Expand Down

3 comments on commit c1abbd1

@rbuels
Copy link
Member

@rbuels rbuels commented on c1abbd1 Aug 2, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nathan, I see that you subsequently reverted this, which is good. This probably would have been reverted by somebody else otherwise, because not all users of Bio::Tools::GFF are going to WANT a Name attribute. You should have done this in a branch, and consulted with somebody else before committing this to master.

@nml5566
Copy link
Member

@nml5566 nml5566 commented on c1abbd1 Aug 2, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit the patch wasn't in an ideal location to begin with. Plus, the functionality was already there and I just didn't notice. It was a hatchet job. My bad.

@cjfields
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh, it happens. No worries.

Please sign in to comment.