#!/bin/tcsh -f
#(ie run the tshell on this but don't read the .cshrc or .tcshrc)

echo version = 1.02 of mkfur 2006 Oct 26
# 2006 Oct 26, 1.02: fix mkpetals
# 2006 Oct 25, 1.01: multi-fur 
# 2006 Oct 25, 1.00: origin 

if ($#argv == 0) then
   set name = furoligos
else
   set name = exboligos
endif
#   fasta2book furoligos
fasta2book $name

echo -n "" > features

palinf
cat palinfeatures >> features

search < searchp
cat searchfeatures >> features
# search features for consensus stuff:
cat searchfeatures.fig >> features

search < consensus.searchp
cat searchfeatures >> features

mv book all.book

foreach book (all.book exbD.book)
   cp $book book

   if ($book == all.book) then
      set minRi = 0
   else
      set minRi = -5
   endif

   # run one time to set up:
   # lksite fur-m9-24
   #
   # foreach subdir (fur-11M9 fur-24M9)
   set furlist = "fur-11M9 fur-24M9"
   foreach subdir ($furlist)
     if !(-d $subdir) then
        mkdir $subdir
        cd $subdir
          lksite $subdir
          lk book ../book
          mv scanp scanp.original
        cd ..
     endif
     cd $subdir
        cat scanp.original |\
#       sed "s/3       information content/0       information content/" |\
        sed "s/3       information content/$minRi  information content/" |\
        cat > scanp
        scan
     cd ..
     cat $subdir/scanfeatures >> features
   end

   # By doing mkpetals here, it will make the petals for the FIRST
   # scan.  In the second scan it will fail because there are already
   # petals, so it won't make four colors, but only two.
   mkpetals

end

mv all.book book
cat boundaries >> features


lister


mv map $name.ps
ps2pdf $name.ps

if ($LOGINFROM == TERMINAL) then
   goat $name.pdf
else
   gv $name.ps
endif

# chmod a+rx .
chmod a+rX . * */*

mkopen

exit
********************************************************************************

cat furoligos |\
sed "s/ybdA/entS/" |\
sed "s/yhhX-yhhY/ryhB/" |\
sed "s/neg-contro/ygaC/" |\
cat > furoligos-renamed
