Browse Source

added merging, deduplication

nicolas-zimmermann 5 years ago
parent
commit
a84bce7c31
1 changed files with 22 additions and 11 deletions
  1. 22 11
      16S_workflow.sh

+ 22 - 11
16S_workflow.sh View File

2
 raw_reads_dir=$1
2
 raw_reads_dir=$1
3
 output_dir=$2
3
 output_dir=$2
4
 
4
 
5
-#mkdir $output_dir
6
-#mkdir trimmed_reads
5
+mkdir $output_dir
6
+mkdir trimmed_reads
7
 #TRIM READS WITH ALIENTRIMMER
7
 #TRIM READS WITH ALIENTRIMMER
8
-#for R1 in $(ls $raw_reads_dir/*R1.fastq);
9
-#    do
10
-#        R2=`echo $R1 | sed 's/R1/R2/g'`
11
-#        oR1=`echo $R1 | sed 's/\.fastq/\.at\.fq/g'`
12
-#        oR1=`echo $oR1 | sed 's/fastq\///g'`
13
-#        oR2=`echo $R2 | sed 's/\.fastq/\.at\.fq/g'`
14
-#        oR2=`echo $oR2 | sed 's/fastq\///g'`
15
-#        java -jar soft/AlienTrimmer.jar -if $R1 -ir $R2 -q 20 -c databases/contaminants.fasta -of trimmed_reads/$oR1 -or trimmed_reads/$oR2
16
-#    done
8
+for R1 in $(ls $raw_reads_dir/*R1.fastq);
9
+    do
10
+        R2=`echo $R1 | sed 's/R1/R2/g'`
11
+        oR1=`echo $R1 | sed 's/\.fastq/\.at\.fq/g'`
12
+        oR1=`echo $oR1 | sed 's/fastq\///g'`
13
+        oR2=`echo $R2 | sed 's/\.fastq/\.at\.fq/g'`
14
+        oR2=`echo $oR2 | sed 's/fastq\///g'`
15
+        java -jar soft/AlienTrimmer.jar -if $R1 -ir $R2 -q 20 -c databases/contaminants.fasta -of trimmed_reads/$oR1 -or trimmed_reads/$oR2
16
+    done
17
 
17
 
18
 
18
 
19
 # MERGE READS AND OUTPUT FASTA
19
 # MERGE READS AND OUTPUT FASTA
31
 # MERGE ALL FASTAS TO 'amplicon.fasta'
31
 # MERGE ALL FASTAS TO 'amplicon.fasta'
32
 cat fasta/*.fasta > fasta/amplicon.fasta
32
 cat fasta/*.fasta > fasta/amplicon.fasta
33
 
33
 
34
+# REMOVE ' ' FROM EACH READ NAME
35
+sed -i 's/ //g' fasta/amplicon.fasta
36
+
37
+# CREATE OTU
38
+# DEDUPLICATION
39
+mkdir otu
40
+soft/vsearch --derep_fulllength fasta/amplicon.fasta --output otu/fulllength_otu
41
+soft/vsearch --derep_prefix fasta/amplicon.fasta --output otu/prefix_otu
34
 
42
 
43
+# REMOVING SINGLETON
44
+soft/vsearch --derep_fulllength fasta/amplicon.fasta --output otu/fulllength_min10_otu --minuniquesize 10
45
+soft/vsearch --derep_prefix fasta/amplicon.fasta --output otu/prefix_min10_otu --minuniquesize 10