forked from NYU-BFX/lncRNA-screen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_cuffdiff
More file actions
executable file
·42 lines (31 loc) · 1.51 KB
/
run_cuffdiff
File metadata and controls
executable file
·42 lines (31 loc) · 1.51 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
#!/bin/bash
if [ "$#" -lt 2 ]; then
printf "\n\n###### Usage\n\n"
printf "$0 <PATH to params.txt file> <PATH to cuffquant DIR(s)> <Comparison Group(s)>\n\n"
exit
fi
if [ ! -d cuffdiff ]
then
mkdir cuffdiff
fi
params=`cat $1 | grep '^cuffdiff' | cut -f2`
shift
cuffquant=$1
shift
COMPARISON_LIST=($@)
for comparison in ${COMPARISON_LIST[@]}
do
base_name=`basename $comparison`
mkdir cuffdiff/$base_name
treatment=`echo $base_name | cut -d'.' -f1`
control=`echo $base_name | cut -d'.' -f3`
echo "#!/bin/bash" > cuffdiff/${treatment}".vs."${control}/run.bash
echo "prog_dir=\`dirname \$0\`" >> cuffdiff/${treatment}".vs."${control}/run.bash
echo "cd \$prog_dir" >> cuffdiff/${treatment}".vs."${control}/run.bash
echo "cd ../" >> cuffdiff/${treatment}".vs."${control}/run.bash
printf "~/utilities/cufflinks/cuffdiff $params -o ${treatment}.vs.${control} -L ${treatment},${control} " >> cuffdiff/${treatment}".vs."${control}/run.bash
cat $comparison/1_group_info.tsv | awk '$2~/^'${treatment}'$/{printf "../'${cuffquant}'/"$1"/abundances.cxb,"}' | sed '1,$s/,$/ /g' >> cuffdiff/${treatment}".vs."${control}/run.bash
cat $comparison/1_group_info.tsv | awk '$2~/^'${control}'$/{printf "../'${cuffquant}'/"$1"/abundances.cxb,"}' | sed '1,$s/,$/ /g' >> cuffdiff/${treatment}".vs."${control}/run.bash
echo "cd "${treatment}.vs.${control} >> cuffdiff/${treatment}".vs."${control}/run.bash
echo "~/utilities/yixiao_scripts/rnaseq_cuffdiff_post gene_exp.diff " >> cuffdiff/${treatment}".vs."${control}/run.bash
done