-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRunQiime_rawdata.csh
executable file
·49 lines (36 loc) · 1.5 KB
/
RunQiime_rawdata.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
43
44
45
46
47
48
#! /bin/sh
#$ -S /bin/bash
# -cwd
#you should include the variables file after the RunQiime_rawdata.csh command, which is included here
. ./$1
if [[ -s ${SOLFILEF} ]] ; then
NULLVAR=0
else
echo "PipeStop error:${SOLFILEF} doesn't exist. Please include a real fastq file" ;
exit;
fi ;
#Split your fastq file with qiime
split_libraries_fastq.py -i ${SOLFILEF} -b ${BARFILE} -o ${UNIQUE}_output -m ${MAPFILE} --barcode_type ${BARLEN} --min_per_read_length ${MINLEN} --last_bad_quality_char ${QUAL} --max_barcode_errors 0 --max_bad_run_length ${BADRUN} ${SLV}
if [[ -s ${UNIQUE}_output/seqs.fna ]] ; then
NULLVAR=0
else
echo "PipeStop error:${UNIQUE}_output/seqs.fna is empty; stopped program after split_libraries_fastq.py" ;
exit;
fi ;
#Trim the sequences with mothur
mothur "#trim.seqs(fasta=${UNIQUE}_output/seqs.fna, oligos=${OLIGO})"
if [[ -s ${UNIQUE}_output/seqs.trim.fasta ]] ; then
NULLVAR=0
else
echo "PipeStop error:${UNIQUE}_output/seqs.trim.fasta is empty; stopped program after trim.seqs" ;
exit;
fi ;
#revert the names from mothur to qiime names
perl ${BIN}/revert_names_mothur3.pl ${UNIQUE}_output/seqs.fna ${UNIQUE}_output/seqs.trim.fasta > ${UNIQUE}_output/seqs.trim.names.fasta
if [[ -s ${UNIQUE}_output/seqs.trim.names.fasta ]] ; then
NULLVAR=0
else
echo "PipeStop error:${UNIQUE}_output/seqs.trim.names.fasta is empty; stopped program after ${BIN}/revert_names_mothur3.pl" ;
exit;
fi ;
perl ${BIN}/truncate_fasta2.pl ${UNIQUE}_output/seqs.trim.names.fasta ${TRIM} ${UNIQUE}_output/seqs.trim.names.${TRIM}