#!/bin/sh
# 
# shell script to run the MutationFinder Tagger_Framework PR in GATE
#

# set the correct location of your MutationFinder installation dir here
MF_DIR=/usr/local/durmtools/MutationFinder

# prepare MF input file: (fake) document ID, all content on one line
sed -e "s/[[:space:]]/ /g" $1 > $1.out
# change the location of the text file containing a dummy id below
cat ${HOME}/MutationFinder/id.txt $1.out > $1.out2
sed '{:q;N;s/\n/ /g;t q}' $1.out2 > $1.out3

# run MutationFinder
${MF_DIR}/mutation_finder.py -o /tmp -s $1.out3

# provide output for GATE
cut -b 6- $1.out3.mf | sed -e "s/[[:space:]]/ /g" > $1.result
echo -n "mutationfinder	" | cat - $1.result 

