build_bdr_rapidrun.sh 1.13 KB
Newer Older
peguerin's avatar
peguerin committed
1
2
3
4
5
6
###############################################################################
## RAPIDRUN
source ./config.sh

for marker in `awk -F, '{ print $1}' infos/markers.csv`
do
vmarques's avatar
vmarques committed
7
8
	primer3=`grep $marker infos/markers.csv | cut -d, -f3`
	primer5=`grep $marker infos/markers.csv | cut -d, -f2`
peguerin's avatar
peguerin committed
9
	echo $marker $primer3 $primer5
vmarques's avatar
vmarques committed
10
	MARKER_REF_DB_DIR="../reference_database_"${marker}""
peguerin's avatar
peguerin committed
11
12
13
14
15
16
17
	mkdir -p "${MARKER_REF_DB_DIR}"	
	for DX in `ls "${rd_prefix}"*dx`
	do
		DX_PATH=`readlink -f $DX`
		ln -s $DX_PATH $MARKER_REF_DB_DIR/$DX
	done
	cd "${MARKER_REF_DB_DIR}"
peguerin's avatar
peguerin committed
18
19
20
21
22
	$ecoPCR -d "${rd_prefix}" -e "${ecoPCR_e}" -l "${ecoPCR_l}" -L "${ecoPCR_L}" "${primer5}" "${primer3}" > v_"${rd_prefix}".ecopcr
	$obigrep -d "${rd_prefix}" --require-rank=species --require-rank=genus --require-rank=family v_"${rd_prefix}".ecopcr > v_"${rd_prefix}"_clean.fasta
	$obiuniq -d "${rd_prefix}" v_"${rd_prefix}"_clean.fasta > v_"${rd_prefix}"_clean_uniq.fasta
	$obigrep -d "${rd_prefix}" --require-rank=family v_"${rd_prefix}"_clean_uniq.fasta > v_"${rd_prefix}"_clean_uniq_clean.fasta
	$obiannotate --uniq-id v_"${rd_prefix}"_clean_uniq_clean.fasta > db_"${rd_prefix}".fasta
peguerin's avatar
peguerin committed
23
24
	cd ../reference_database
done