-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathTransrate.sh
executable file
·92 lines (73 loc) · 1.91 KB
/
Transrate.sh
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
#!/bin/bash
# input - diretório contendo os arquivos de entrada no formato .fastq
input=$1
#Diretorio que contem os arquivos processados
reftrinity=$2
# Arquivo da montagem de novo Trinity.fa
refprot=$3
# Diretorio que contem o proteoma de referencia mais proximo para ser utilizado como base
# output - diretório para armazenar o resultado do processo de montagem
output=$4
if [ ! ${input} ]
then
echo "Missing input directory"
exit
else
if [ ! -d ${input} ]
then
echo "Wrong input directory ${input}"
exit
fi
fi
if [ ! ${reftrinity} ]
then
echo "Missing assembled fasta file"
exit
else
if [ ! -e ${reftrinity} ]
then
echo "Wrong assembled fasta file ${reftrinity}"
exit
fi
fi
if [ ! ${refprot} ]
then
echo "Missing proteomic reference fasta file"
exit
else
if [ ! -e ${refprot} ]
then
echo "Wrong proteomic reference fasta file ${refprot}"
exit
fi
fi
if [ ! ${output} ]
then
echo "Missing output directory"
exit
else
if [ ! -d ${output} ]
then
echo "Wrong output directory ${output}"
exit
fi
fi
num_threads=4
mkdir -p ${output}/Transrate_good
basedir_out="${output}/Transrate_good"
leftreads=()
rightreads=()
leftreads=( $( find ${input} -name '*_1.fastq' ) )
for r in ${leftreads[@]}; do
r=`echo ${r} | sed 's/_1\./_2\./'`
rightreads=(${rightreads[@]} ${r})
done
echo -e "Runnig Transrate"
transrate --reference ${refprot} \
--assembly ${reftrinity} \
--left $(IFS=, ; echo "${leftreads[*]}") \
--right $(IFS=, ; echo "${rightreads[*]}") \
--threads ${num_threads} \
--output ${basedir_out} \
> ${output}/Transrate.log.out.txt \
2> ${output}/Transrate.log.err.txt