
#!/bin/tcsh

##############
# script.csh #
##############

echo "FORMATTING WHOLE GENOME SEQUENCE ..."
./formater yeast_genome.fasta
echo "DONE !"

#######################################
#######################################

echo "EXTRACTING SUBSEQUENCES FROM WHOLE GENOME..."

#######################################
#######################################
echo "FORWARD ANALYSIS OF YEAST GENOME"

echo "get all forward subsequences of length 14 from the yeast genome"
./subseq_fr yeast_genome.fasta.formated 14 -f > yeast_genome.subseq-fwd

echo "select all forward subsequences of length 14 from the yeast genome that start with CATG"
./pattern yeast_genome.subseq-fwd CATG > yeast_genome.subseq-fwd.tag

echo "remove original file containing all forward subsequences (it uses too much disk space)"
rm yeast_genome.subseq-fwd
echo "DONE !"

#######################################
#######################################

echo "REVERSE ANALYSIS OF YEAST GENOME"

echo "get all reverse subsequences of length 14 from the yeast genome"
./subseq_fr yeast_genome.fasta.formated 14 -r > yeast_genome.subseq-rev

echo "select all reverse subsequences of length 14 from the yeast genome that start with CATG"
./pattern yeast_genome.subseq-rev CATG > yeast_genome.subseq-rev.tag

echo "remove original file containing all reverse subsequences (it uses too much disk space)"
rm yeast_genome.subseq-rev
echo "DONE !"

#######################################
#######################################

echo "CONCATENATE FORWARD AND REVERSE SUBSEQUENCES"

echo "concatenate all forward and reverse subsequences of length 14 from the yeast genome that start with CATG"
cat yeast_genome.subseq-fwd.tag yeast_genome.subseq-rev.tag > yeast_genome.subseq-all.tag
echo "DONE !"

