File: full_run.sh

package info (click to toggle)
spades 3.13.1+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 22,172 kB
  • sloc: cpp: 136,213; ansic: 48,218; python: 16,809; perl: 4,252; sh: 2,115; java: 890; makefile: 507; pascal: 348; xml: 303
file content (98 lines) | stat: -rwxr-xr-x 2,885 bytes parent folder | download | duplicates (2)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash

############################################################################
# Copyright (c) 2015 Saint Petersburg State University
# Copyright (c) 2011-2014 Saint Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
############################################################################

set -e
pushd ../../../
project_name=$2
creature_name=$1
project_dir="spades_output/"$creature_name$project_name
output_pref="/scratchfast/spb_teamcity/"
options_dir=$output_pref"input/"$creature_name$project_name
rm -rf $project_dir
mkdir $project_dir -p
read line < $options_dir"spades.options"
echo $line
./cpcfg
python3 ./spades.py $line -o $project_dir --disable-gzip-output --mismatch-correction

read line < $options_dir"quast.options"
echo $line

dir=$output_pref"contigs/teamcity/"$creature_name$project_name #$(date +%Y%m%d_%H%M%S)"/"
echo $dir
mkdir $dir -p
if  [ -f $project_dir"/corrected_contigs.fasta" ]; then 
 echo "corrected contigs found, working with them"
 work_contigs=$project_dir"corrected_contigs.fasta"
else 
 echo "no corrected contigs, working with original"
 work_contigs=$project_dir"contigs.fasta"
fi
cp $work_contigs $dir$(date +%Y%m%d_%H%M%S)".fasta"
cp $project_dir"/scaffolds.fasta" $dir$(date +%Y%m%d_%H%M%S)_scaf".fasta"


python3 ~/quast-1.3/quast.py $work_contigs $line -o $project_dir"/quality_results/"
rm $dir"/quast_all" -rf
#echo $dir"*.fasta" $line -o $dir"/quast_all"
dirtmp=$dir"tmp/"
rm $dirtmp -rf
mkdir $dirtmp

for i in $dir*.fasta ; do 
#find DIR -type f | while read FILENAME; do
  flag="False"
  for j in $dirtmp*.fasta ; do
#    echo $i
#    echo $j
    if [ -f $j ] ;
    then
      compare_res=$(python3 ~/algorithmic-biology/assembler/src/tools/contig_analysis/compare_fasta.py $i $j)
#      echo $compare_res
      if [ $compare_res = "True" ]; 
      then
        flag="True"
        break     
      fi	 
    fi
  done  
  if [ $flag = "False" ] ;
  then
    cp $i $dirtmp
  fi
done

quast_line="$output_pref/quast-1.3/quast.py -M 500 $dirtmp* $line -o $dir/quast_all"
quast1_2_line="$output_pref/quast-1.2/quast.py -M 500 $dirtmp* $line -o $dir/quast1_2_all/"

echo "$quast_line"
python3 $quast_line >null
python3 $quast1_2_line >null

ssh -n antipov@194.85.238.21 mkdir -p "/var/www/teamcity_runs/$1$2" &

scp "$dir/quast_all/report.txt" "antipov@194.85.238.21:/var/www/teamcity_runs/$1$2/report.txt"
scp "$dir/quast1_2_all/report.txt" "antipov@194.85.238.21:/var/www/teamcity_runs/$1$2/report1_2.txt"

#espected results
read line < $options_dir"results.options"
echo $line
opts=( $line )
splitted_opts=''
tLen=${#opts[@]}
for (( i=0; i<${tLen} / 2; i++ ));
do
  splitted_opts=$splitted_opts" "${opts[$i *  2 + 1]}
done
echo $splitted_opts
python3 src/test/teamcity/assess.py $project_dir"quality_results/transposed_report.tsv" $splitted_opts
rm $project_dir"/corrected/" -rf


popd