Skip to content

Commit

Permalink
Create species-specific files with only headers if no data for specie…
Browse files Browse the repository at this point in the history
…s, instead of not creating files
  • Loading branch information
markquintontulloch committed Feb 12, 2021
1 parent 0ab700c commit de7f0ca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/ONTOLOGY/GAF.pm
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,10 @@ sub make_species_files {


for my $wb(values %accessors) {
next unless exists $species_lines{$wb->ncbi_tax_id};
my $species_file = $file . '.' . $wb->full_name('-g_species' => 1);
open (SPECIES, '>', $species_file) or die "Could not open $species_file for writing\n";
print SPECIES join("\n", @headers) . "\n";
print SPECIES join("\n", @{$species_lines{$wb->ncbi_tax_id}}) . "\n";
print SPECIES join("\n", @{$species_lines{$wb->ncbi_tax_id}}) . "\n" if exists $species_lines{$wb->ncbi_tax_id};;
close (SPECIES);
}

Expand Down

0 comments on commit de7f0ca

Please sign in to comment.