-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPipeline_RiboTaxa_SE.sh
executable file
·72 lines (51 loc) · 2.29 KB
/
Pipeline_RiboTaxa_SE.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
#!/bin/sh
# Program configuration
__author__='Oshma Chakoory'
__email__='[email protected]'
__credits__=["Oshma"]
__status__='Development'
__version__='1.5'
# Handling errors
#set -x # debug mode on
set -o errexit # ensure script will stop in case of ignored error
set -e
CONFIG_PATH=$1
CONFIG="${CONFIG_PATH[@]}"
#Jobname=$(awk '/^JOB_NAME/{print $3}' "${CONFIG}")
DATA_DIR=$(awk '/^DATA_DIR/{print $3}' "${CONFIG}")
#echo "Data path = $DATA_DIR" | tee /dev/fd/3
OUTPUT=$(awk '/^OUTPUT/{print $3}' "${CONFIG}")
RiboTaxa_DIR=$(awk '/^RiboTaxa_DIR/{print $3}' "${CONFIG}")
FORMAT=$(awk '/^FORMAT/{print $3}' "${CONFIG}")
#echo $FORMAT
for NAME in `ls "$DATA_DIR"/*."$FORMAT"`
do
SHORTNAME=$(basename ""${NAME[@]}"" | sed 's/.'$FORMAT'//')
#SHORTNAME=$(basename ""${NAME[@]}"")
#echo $SHORTNAME
RESULTS="$OUTPUT/$SHORTNAME"
mkdir -p $RESULTS
exec 3>&1 1>"$RESULTS"/RiboTaxa_"$SHORTNAME".log 2>&3 2>"$RESULTS"/RiboTaxa_"$SHORTNAME".stderr
echo " "
echo "RiboTaxa -- A complete pipeline from raw metagenomics to species-level identification" | tee /dev/fd/3
echo "By Oshma Chakoory, Sophie Marre & Pierre Peyret" | tee /dev/fd/3
echo "University Clermont Auvergne, France " | tee /dev/fd/3
echo "Version: 1.5" | tee /dev/fd/3
echo "This program is distributed under the AGPL-3.0 License. See LICENSE for more information." | tee /dev/fd/3
echo "" | tee /dev/fd/3
echo "***********************************************************************************************" | tee /dev/fd/3
echo ">Running RiboTaxa on $NAME" | tee /dev/fd/3
echo "***********************************************************************************************" | tee /dev/fd/3
echo "" | tee /dev/fd/3
#run RiboTaxa.sh script to perform
### Perform a quality control on the (meta)genomics data using BBTOOLS
### Filter 16S/18S reads using SORTMERNA
### Reconstruct full length 16S/18S rRNA sequences using EMIRGE
source "$RiboTaxa_DIR"/scripts/RiboTaxa_SE.sh $CONFIG_PATH $SHORTNAME
#run sklearn_classfier.sh script to perform
### Taxonomic classification of full length reconstrcuted sequences using sklearn classifier of Qiime2
source "$RiboTaxa_DIR"/scripts/sklearn_classifier.sh $CONFIG_PATH $SHORTNAME
done
#mv RiboTaxa_"$Jobname".log "$RESULTS"
#mv RiboTaxa_"$Jobname".stderr "$RESULTS"
#mv "$RESULTS"/output_MetaRib "$RESULTS"/SSU_sequences