Dear Christiane,
I am using an old script to update the most recent version of GO terms:
#parsing GO to create a table with information on obsolete and replaced goterms as well as alternative ids and other goterms to consider
#only execute once (takes about 15min!)
#reuse fullGO.NA
#repeat when newer GO version available
#download at ftp://ftp.geneontology.org/pub/go/ontology/gene_ontology_edit.obo
mv gene_ontology_edit.obo fullGO.obo
grep -A3 '^\[Term\]$' fullGO.obo > fullGO.terms
grep '^id:' fullGO.terms | cut -d' ' -f2 > fullGO.id
grep '^name:' fullGO.terms | sed 's/ /\t/' | cut -d$'\t' -f2 > fullGO.name
grep '^namespace:' fullGO.terms | cut -d' ' -f2 > fullGO.namespace
mkdir Obsolete; cd Obsolete
asplit '^\[Term\]$' 1 < ../fullGO.obo
rm out.0
rm ../fullGO.obsolete
for i in $(ls -1v out.*)
do
echo ${i}
grep '^id:' ${i} | cut -d' ' -f2 > id.tmp
grep '^is_obsolete:' ${i} | cut -d' ' -f2 > obsolete.tmp
grep '^alt_id:' ${i} | cut -d' ' -f2 | tr '\n' ';' > alt_id.tmp
grep '^consider:' ${i} | cut -d' ' -f2 | tr '\n' ';' > consider.tmp
grep '^replaced_by:' ${i} | cut -d' ' -f2 | tr '\n' ';' > replaced.tmp
paste id.tmp obsolete.tmp consider.tmp replaced.tmp alt_id.tmp >> ../fullGO.obsolete
rm id.tmp
rm obsolete.tmp
rm alt_id.tmp
rm consider.tmp
rm replaced.tmp
done
cd ..
tail fullGO.obsolete #last file also contained edge ID --> remove
grep '^GO' fullGO.obsolete > fullGO_good.obsolete
cut -f1 fullGO_good.obsolete | diff - fullGO.id #no differences
paste fullGO_good.obsolete fullGO.name fullGO.namespace > fullGO.NA
However I got an error at line 7: asplit '^\[Term\]$' 1 < ../fullGO.obo (which I changed to spit
mcardozo@ollie0:~/ownSoft/Uproc/Obsolete$ split '^[Term]$' 1 < ../fullGO.obo
split: cannot open ‘^\[Term\]$’ for reading: No such file or directory
Is it possible that a line is missing? because in neither attempt the code did not produced the fullGO.obsolete
Any ideas?
Cheers,
Magda
Dear Christiane,
I am using an old script to update the most recent version of GO terms:
However I got an error at line 7:
asplit '^\[Term\]$' 1 < ../fullGO.obo(which I changed tospitmcardozo@ollie0:~/ownSoft/Uproc/Obsolete$ split '^[Term]$' 1 < ../fullGO.obo
split: cannot open ‘^\[Term\]$’ for reading: No such file or directory
Is it possible that a line is missing? because in neither attempt the code did not produced the fullGO.obsolete
Any ideas?
Cheers,
Magda