# Download matrix
wget http://jaspar.genereg.net/download/CORE/JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt

cat JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt \
| awk '$1=="MOTIF" { print $1, $3"_"$2; next; } {print;}' \
|  sed 's/::/+/g' | sed 's/(var\.[0-9])//g' \
> JASPAR2018_CORE_vertebrates_non-redundant_pfms.meme

cat JASPAR2018_CORE_vertebrates_non-redundant_pfms.meme | grep "MOTIF" | cut -d" " -f2 | awk -v OFS="\t" -v FS="_" 'BEGIN { print "motif", "tf", "dbd_family"} { print $0, $1, "NAN"; }'  > annotation.txt
