Skip to content

Commit

Permalink
Update KEGG.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
spficklin authored Jun 21, 2019
1 parent 4fc0908 commit 2a4e29a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions terms/KEGG.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lynx "http://www.genome.jp/kegg-bin/download_htext?htext=ko00001.keg&format=htext&filedir="
wget "http://www.genome.jp/kegg-bin/download_htext?htext=ko00001.keg&format=htext&filedir=" -O ko00001.keg

# first get the list of pathways
grep -P "^C" ko00001.keg > pathways.txt
perl -pi -e 's/^C\s+(\d+)\s(.*?)\s*\[.*/KEGG\tko\1\t\2/' pathways.txt
grep -P "^C" ko00001.keg | grep "\[PATH:" | \
perl -p -e 's/^C\s+(\d+)\s(.*?)\s*\[PATH:(.*)\].*/KEGG\t\3\t\2/' > pathways.txt

# second get the list of othologs
egrep "K0|K1" ko00001.keg > orthologs.txt
perl -pi -e 's/^D\s+(K\d+)\s+.*?;\s+(.*?)/KEGG\t\1\t\2/' orthologs.txt
grep -P "^D" ko00001.keg | \
perl -p -e 's/^D\s+(K\d+)\s+.*?;\s+(.*?)/KEGG\t\1\t\2/' > orthologs.txt

cat pathways.txt orthologs.txt > KEGG.terms.txt

0 comments on commit 2a4e29a

Please sign in to comment.