annotate TEdenovo.sh @ 0:baea09e6722b draft default tip

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