annotate TEannot.sh @ 0:b126ea31824f draft default tip

1st Uploaded
author vmarcon
date Mon, 06 Feb 2017 13:37:49 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
1 #!/bin/bash
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
2 set -e
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
3
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
4 fasta=$1
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
5 library=$2
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
6 outputfile=$3
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
7 outputmaskedfile=$4
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
8 outputlog=$5
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
9 outputconfig=$6
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
10 outputStats=$7
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
11 classif=$8
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
12 outputmasked_SSRmaskfile=$9
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
13
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
14 projectname=$(date "+%Y%m%d")
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
15
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
16 add=''
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
17
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
18 if [ -f $classif ]
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
19 then
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
20 add='-c '$classif
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
21 fi
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
22
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
23 if [ -f $outputStats ]
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
24 then
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
25 add=$add' -s'
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
26 fi
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
27
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
28 `dirname $0`'/'TEannot_lite.py -i $fasta -l $library -o $outputfile $add > $outputlog
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
29 projectname_complete=$(ls $(pwd)|grep $projectname)
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
30 working_dir=$(pwd)/$projectname_complete
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
31 sed -i 's@'"$working_dir"'@'$projectname'@g' $outputlog
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
32 mv $outputfile-$projectname.gff3 $outputfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
33 mv $outputfile-$projectname.mask $outputmaskedfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
34 mv $outputfile-$projectname.mask_SSRmask.fa $outputmasked_SSRmaskfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
35 if [ -f $outputStats ]
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
36 then
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
37 mv $outputfile-$projectname-TEstats.txt $outputStats
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
38 fi
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
39
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
40 workingconfigfile=$working_dir/TEannot_Galaxy_config_$projectname_complete
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
41 sed -i 's|repet_host:.*|repet_host:|g' $workingconfigfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
42 sed -i 's|repet_user:.*|repet_user:|g' $workingconfigfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
43 sed -i 's|repet_pw:.*|repet_pw:|g' $workingconfigfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
44 sed -i 's|repet_db:.*|repet_db:|g' $workingconfigfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
45 sed -i 's|repet_port:.*|repet_port:|g' $workingconfigfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
46 sed -i 's|repet_job_manager:.*|repet_job_manager:|g' $workingconfigfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
47 sed -i 's|project_name:.*|project_name: '$projectname'|g' $workingconfigfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
48 sed -i 's|project_dir:.*|project_dir:|g' $workingconfigfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
49 sed -i 's|tmpDir:.*|tmpDir:|g' $workingconfigfile
b126ea31824f 1st Uploaded
vmarcon
parents:
diff changeset
50 mv $workingconfigfile $outputconfig