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