Vseach pipline for 16s amplicon sequences

Import manifest file
manifest <- readr::read_table(
  "/media/hutianlong/b8986a7a-0c13-db4b-81c7-7b26cebbb183/16s_deblur_type6/16s-manifest.tsv",
  col_names = TRUE)
manifest
Merge paired ends and relabel them
setwd("/media/hutianlong/b8986a7a-0c13-db4b-81c7-7b26cebbb183/16s_deblur_type6")
for (i in 1:nrow(manifest)){
  comstr1 <- paste("vsearch --fastq_mergepairs ",
        manifest[i,2],
        " --reverse ",
        manifest[i,3],
        " --fastqout ",
        manifest[i,1],
        ".fq ",
        " --relabel ",
        manifest[i,1],
        ".",
        sep="")
  #comstr2 <- paste("gzip ",manifest[i,1],".fq",sep="")
  print(comstr1)
  system(comstr1)
  #print(comstr2)
  #system(comstr2)
}
Pool all merged sequences
mkdir ./2_merged
mv *.fq ./2_merged
cat ./2_merged/*.fq >> ./all.fq
Trim primer sequence

My sequences look like following:

  • GTGYCAGCMGCCGCGGTAAmysequenceAAACTCAAAKRAATTGACGGCC

  • GGCCGYCAATTYMTTTRAGTTTmysequenceTTACCGCGGCKGCTGRCAC

cutadapt -a TTACCGCGGCKGCTGRCAC \
    -a AAACTCAAAKRAATTGACGGCC \
    -g GGCCGYCAATTYMTTTRAGTTT \
  -g GTGYCAGCMGCCGCGGTAA \
    -o all_trimmed2.fq \
    -j 10 \
    all_trimmed.fq
Quality control
vsearch --fastx_filter ./all_trimmed.fq \
  --fastq_maxee_rate 0.01 \
  --fastaout ./filtered.fa
Dereplication
vsearch --derep_fulllength ./filtered.fa \
                --sizeout --minuniquesize 2 \
                --output ./uniques.fa
Unoise
vsearch --cluster_unoise uniques.fa \
                --centroids zotus.fa \
                --uc uc_zotus.uc \
                --log unoise_log.txt \
                --threads 14
Chimeras detection
vsearch  --uchime3_denovo zotus.fa \
  --nonchimeras zotus_nochime.fa \
  --fasta_width 0 \
  --relabel zotu \
  --xsize \
  --log unchime3_log.txt
Build feature table
vsearch --usearch_global filtered.fa \
       --db zotus_nochime.fa \
       --id 0.97 \
       --otutabout unoise3_zotu_table.txt \
       --biomout unoise3_zotu_table.biom  \
       --threads 14 \
       --log otutab_log.txt