Skip to content

Commit

Permalink
another try at geneontology/pipeline#360
Browse files Browse the repository at this point in the history
  • Loading branch information
kltm committed Feb 3, 2024
1 parent 07ee29f commit 816a0f2
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions scripts/collate-gpads.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,30 @@
# maps group names to filehandles;
# e.g. zfin => wrte filehandle for zfin.gpad
my %fhmap = ();
while (glob($full_glob)) {
next if (m@^\!@);
chomp;
my @vals = split(/\t/, $_);

## MGI annotations to PR go to MGI.
my $index_override = '';
if ( $vals[0] eq 'PR' && $vals[9] eq 'MGI' ) {
$index_override = 'MGI';
} elsif ( $vals[0] eq 'RefSeq' && $vals[9] eq 'MGI' ) {
$index_override = 'MGI';
}
while (my $curr_model = glob($full_glob)) {

open( my $input_fh, "<", $curr_model ) || die "Can't open $curr_model: $!";
while (<$input_fh>){

next if (m@^\!@);
chomp;
my @vals = split(/\t/, $_);

write_line_to_file($vals[0], $index_override, $_);
## MGI annotations to PR go to MGI.
my $index_override = '';
if ( $vals[0] eq 'PR' && $vals[9] eq 'MGI' ) {
$index_override = 'MGI';
} elsif ( $vals[0] eq 'RefSeq' && $vals[9] eq 'MGI' ) {
$index_override = 'MGI';
}

print $vals[0] . "...\n";
print $index_override . "...\n";
print $_ . "...\n";

write_line_to_file($vals[0], $index_override, $_);
}
close($input_fh);
}
foreach my $fh (values %fhmap) {
$fh->close();
Expand Down

0 comments on commit 816a0f2

Please sign in to comment.