TITLE: A Bioinformatics Analysis workflow for 16S rRNA Amplicon Sequencing data
AUTHORS: Lilan Hao

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block"><span>Deal with the 16S rRNA amplicon  sequencing reads, which sequenced by Ion PGM</span><span style = "vertical-align:super;">TM</span><span> Sequencer with Ion 318</span><span style = "vertical-align:super;">TM</span><span>Chip v2 with a read length of 400bp, and takes the OTU table( the measured abundance profile of detected operational taxonomic units (OTUs)).</span></div></div>

[STEPS]
?. ## Convert the bam files to fastq files../bam2fastq-1.1.0/bam2fastq -o vagina/01.trim.data/16_s1.fq ../rawdata/RFEMpxjMAADGAAPGM-47.bam
?. ## Trim the poly-A/T, multi-N and low-quality sequences.mothur "#trim.seqs(fasta= vagina/01.trim.data/16_s1.fa, qfile= vagina/01.trim.data/16_s1.qual, minlength=200,maxambig=1,maxhomop=10,qwindowaverage=25,qwindowsize=50,processors=8)" mothur "#reverse.seqs(fasta= vagina/01.trim.data/16_s1.trim.fasta, qfile=vagina/01.trim.data/16_s1.trim.qual)" perl ../creat.group.pl  vagina/01.trim.data/16_s1.trim.rc.fasta 16_s1 >> /vagina/02.processing.data/vagina.groupscat  vagina/01.trim.data/16_s1.trim.rc.fasta >> vagina/02.processing.data/vagina.trim.fastacat  vagina/01.trim.data/16_s1.trim.rc.qual >>  vagina/02.processing.data/vagina.trim.qual
?. ## Pick the representative sequences.mothur"#unique.seqs(fasta=vagina/02.processing.data/vagina.trim.fasta)"
?. ## Pick the high-scoring sequences mothur "#screen.seqs(fasta=vagina/02.processing.data/vagina.trim.unique.align, name=vagina/02.processing.data/vagina.trim.names,group=vagina/02.processing.data/vagina.groups,optimize=start-end, criteria=90,processors=8)" mothur "#filter.seqs(fasta=vagina/02.processing.data/vagina.trim.unique.good.align, vertical=T,trump=.,processors=8)" mothur "#unique.seqs(fasta=vagina/02.processing.data/vagina.trim.unique.good.filter.fasta, name=vagina/02.processing.data/vagina.trim.good.names)" rm vagina/02.processing.data/vagina.trim.unique.good.align vagina/02.processing.data/vagina.trim.unique.alignmothur "#summary.seqs(fasta=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.fasta, name=vagina/02.processing.data/vagina.trim.unique.good.filter.names)" > vagina/02.processing.data/vagina.trim.unique.good.filter.unique.fasta.summary.log
?. ##Check chimera and delete chimeric sequencesmothur "#pre.cluster(fasta=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.fasta, name=vagina/02.processing.data/vagina.trim.unique.good.filter.names,group=vagina/02.processing.data/vagina.good.groups,diffs=2)" mothur "#chimera.uchime(fasta=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.fasta, name=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.names,group=vagina/02.processing.data/vagina.good.groups,processors=8)" mothur "#remove.seqs(accnos=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.devono.uchime.accnos, fasta=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.fasta, name=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.names,group=vagina/02.processing.data/vagina.good.groups)" mothur "#summary.seqs(fasta=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.fasta, name=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.names)" > vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.fasta.summary.log
?. ## Classify according to the Greengene reference sequences (gg_13_8_otus)ln -s ../database/greengenes/gg_13_5_99.fasta vagina/02.processing.data/gg_13_5_99.fastaln -s ../database/greengenes/gg_13_5_99.gg.tax vagina/02.processing.data/gg_13_5_99.gg.taxmothur "#classify.seqs(fasta=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.fasta, template=vagina/02.processing.data/gg_13_5_99.fasta,taxonomy=vagina/02.processing.data/gg_13_5_99.gg.tax,cutoff=50,processors=8)"
?. ## Delete reads of Mitochondria and Chloroplast mothur "#remove.lineage(fasta=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.fasta, name=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.names,group=vagina/02.processing.data/vagina.good.pick.groups,taxonomy=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.gg.wang.taxonomy,taxon=Mitochondria-Cyanobacteria_Chloroplast-unknown)"
?. ## Make the otu tablepython ../bin/pick_otus.py -i vagina/03.otu.data/vagina.final.uclu.fasta -o vagina/03.otu.dataperl ../bin/OTU_format_trans.pl vagina/03.otu.data/vagina.final.uclu_otus.txt vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.pick.names 0.03 > vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.pick.an.listperl ../bin/tags_taxonomy.stat.v2.pl vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.pick.names vagina/02.processing.data/vagina.good.pick.pick.groups vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.gg.wang.pick.taxonomy.pick vagina/03.otu.data/vagina.raw.data.infomothur "#make.shared(list=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.pick.an.list, group=vagina/02.processing.data/vagina.good.pick.pick.groups,label=0.03)" mothur "#classify.otu(list=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.pick.an.list, name=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.pick.names,taxonomy=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.gg.wang.pick.taxonomy.pick,label=0.03)"mothur "#summary.single(shared=vagina/02.processing.data/vagina.trim.unique.good.filter.unique.precluster.pick.pick.an.shared,groupmode=t)"
?. ## Reverse fastq  to fasta and qualityperl ../fq2qual.pl vagina/01.trim.data/16_s1.fq vagina/01.trim.data/16_s1
?. ## Delete the primerperl ../iontorrent/re-primers.pl ../v4-v5_primers.fa 2 vagina/01.trim.data/16_s1.fq
?. ## Assign to the SAILVAmothur "#align.seqs(fasta=vagina/02.processing.data/vagina.trim.unique.fasta, reference=../bin/16s/database/silva.bacteria.fasta, processors=8)" mothur "#summary.seqs(fasta=vagina/02.processing.data/vagina.trim.unique.align, name=vagina/02.processing.data/vagina.trim.names)" > vagina/02.processing.data/vagina.trim.unique.align.summary.log