#!/usr/bin/perl -w
#
# This perl script takes the live GO file and makes a tab-delimited file that has the GOid in the first column
# and the definition of the term in the second column. 
#
# By Jennifer Deegan, November 2008.

use strict;
my $line;

open (GOfile, "<gene_ontology_write.obo") || die "Can't open GO file.\n";  
open (OUT, ">strippedGOfile.obo") or die "can't open strippedGOfile \n"; # file with term names instead of IDs


while(<GOfile>){	
    chomp;
    $line = $_;
    if ($line=~m/^id:\s(.*)/) {
    print OUT $1;
    print OUT "\t"
    }
    
    if ($line=~m/^def:.*/) {
    print OUT $line;
    print OUT "\n"
    }
    
    
}	

close GOfile;	
close OUT;

