forked from combogenomics/regtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doMast
executable file
·26 lines (22 loc) · 1.15 KB
/
doMast
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Given a motif file (meme.txt) and a directory full of genomes in fasta format
# launches mast on each genome
if [ "$#" -lt 6 ]; then
echo 'doMast MOTIF_FILE FASTA_DIR BFILE_DIR GENBANK_DIR RESULTS_DIR REGULATOR_NAME'
exit 65
fi
MOTIF_FILE=$1
FASTA_DIR=$2
BFILE_DIR=$3
GENBANK_DIR=$4
RESULTS_DIR=$5
REGULATOR_NAME=$6
for i in $(ls $FASTA_DIR)
do
org=$(echo $i | awk 'BEGIN { FS = "." } ; {print $1}')
mast $MOTIF_FILE $FASTA_DIR/$i -oc $RESULTS_DIR/$org'_'$REGULATOR_NAME -bfile $BFILE_DIR/$org.ntfreq -ev 100
mast $MOTIF_FILE $FASTA_DIR/$i -oc $RESULTS_DIR/$org'_'$REGULATOR_NAME -hit_list -bfile $BFILE_DIR/$org.ntfreq -ev 100 > $RESULTS_DIR/$org'_'$REGULATOR_NAME'/rawhits.txt'
./getMastEvalue $RESULTS_DIR/$org'_'$REGULATOR_NAME'/rawhits.txt' $FASTA_DIR/$i > $RESULTS_DIR/$org'_'$REGULATOR_NAME'/hits.txt'
./parseMast -l -t 1e-4 -o $RESULTS_DIR/$org'_'$REGULATOR_NAME/hits.txt $GENBANK_DIR/$org.gbk $REGULATOR_NAME > $RESULTS_DIR/$org'_'$REGULATOR_NAME'_orientation.tab'
./parseMast -l -t 1e-4 $RESULTS_DIR/$org'_'$REGULATOR_NAME/hits.txt $GENBANK_DIR/$org.gbk $REGULATOR_NAME > $RESULTS_DIR/$org'_'$REGULATOR_NAME'_noorientation.tab'
done