forked from The-Lab-LaBella/RSCU_Calculation_Analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodonTable_script.sh
More file actions
45 lines (29 loc) · 1.07 KB
/
Copy pathcodonTable_script.sh
File metadata and controls
45 lines (29 loc) · 1.07 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#SBATCH --time=72:00:00
#SBATCH --partition=Orion
#this extracts each sequences from the fasta file and then uses the emboss program to create the codon usage table $1 the reference $2 is the fasta to be parsed
#MUST HAVE CAI conda loaded - must have fasta file all on one line
module load emboss
#ls *.gz | xargs -n1 tar -xzf
#gunzip *gz
for file in *cds;
do
grep ">" $file | awk '{print $1}' | sed 's/>//' > $file.seq_name
cat $file.seq_name | while read line
do
grep -A 1 "$line" $file > $line.seq.txt
#do the cusp analysis here
cusp $line.seq.txt $line.codonTable.out
#you can remove the seq file
rm $line.seq.txt
#create one big file for the codon Table data
#we would need to edit the codon table to remove the lines starting with #
sed -i "/^#/d" $line.codonTable.out
#add the sequence name to the first column
sed -i "s/^/$line /g" $line.codonTable.out
#add this to a file of ALL the codon tables
cat $line.codonTable.out >> $file.all_codonTable.out
rm $line.codonTable.out
done
done
cp *all_codonTable.out cds_codonTables