-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgressiveClustering5.csh~
executable file
·44 lines (27 loc) · 1.39 KB
/
ProgressiveClustering5.csh~
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
#! /bin/sh
#$ -S /bin/bash
# -cwd
. $1
echo "${QIIMEFILE}\n";
#reduce sequences by only using
perl ${BIN}/fasta2unique_table4.pl ${QIIMEFILE} ${UNIQUE}
#make a first pass OTU table (100% identity OTUs) with filter
perl ${BIN}/OTU2lib_count_trans1.pl ${UNIQUE}.trans ${FNUMBER} > ${UNIQUE}.f${FNUMBER}.mat
#prepare the file for uclust
perl ${BIN}/fasta2uchime_2.pl ${UNIQUE}.f${FNUMBER}.mat ${UNIQUE}.fa > ${UNIQUE}.ab.fa
#progressively cluster the first value
uclust --input ${UNIQUE}.ab.fa --id 0.${UPPER} --uc ${UNIQUE}.${UPPER}.uc --maxrejects 500 --maxaccepts 20
uclust --input ${UNIQUE}.ab.fa --uc2fasta ${UNIQUE}.${UPPER}.uc --output ${UNIQUE}.${UPPER}.fa --types S
perl ${BIN}/fasta_remove_seed.pl ${UNIQUE}.${UPPER}.fa > ${UNIQUE}.${UPPER}.fa2
perl ${BIN}/UC2list2.pl ${UNIQUE}.${UPPER}.uc > ${UNIQUE}.${UPPER}.uc.list
#repeat for the rest of the range
UPPERM1=`expr ${UPPER} - 1`
for ((i=${UPPERM1}; i >= ${LOWER} ; i--))
do
before=`expr $i + 1`
uclust --input ${UNIQUE}.${before}.fa2 --id 0.${i} --uc ${UNIQUE}.${i}.uc --maxrejects 500 --maxaccepts 20
uclust --input ${UNIQUE}.${before}.fa2 --uc2fasta ${UNIQUE}.${i}.uc --output ${UNIQUE}.${i}.fa --types S
perl ${BIN}/fasta_remove_seed.pl ${UNIQUE}.${i}.fa > ${UNIQUE}.${i}.fa2
perl ${BIN}/UC2list2.pl ${UNIQUE}.${i}.uc > ${UNIQUE}.${i}.uc.list
done
perl ${BIN}/merge_progressive_clustering.pl ${UNIQUE}*.uc.list > ${UNIQUE}.PC.final.list