Created
August 4, 2016 08:33
-
-
Save 0ncorhynchus/cee8a9859d885cbebfc26b61dd15235f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFS=$'\t' | |
awk -F '\t' '{print $1 "\t" $4}' | while read -r line; do | |
set -- $line | |
id=$1 | |
json=$2 | |
metanetx=$(echo $json | jq -rM --unbuffered 'try (."MetaNetX (MNX) Equation" | .[] | .id) catch ""') | |
kegg=$(echo $json | jq -rM --unbuffered 'try (."KEGG Reaction" | .[] | .id) catch ""') | |
ec=$(echo $json | jq -rM --unbuffered 'try (."EC Number" | .[] | .id) catch ""') | |
echo "$id,$metanetx,$kegg,$ec" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment