We will be offering mothur and R workshops throughout 2019. Learn more.
bin.seqs prints out a fasta-formatted file where sequences are ordered according to the OTU that they belong to. Such an output may be helpful for generating primers specific to an OTU or for classification of sequences. For this tutorial, download and decompress AmazonData.zip.
mothur > read.dist(phylip=98_sq_phylip_amazon.dist) mothur > cluster(cutoff=0.10) mothur > bin.seqs(fasta=amazon.fasta)
mothur > read.otu(list=98_sq_phylip_amazon.fn.list) mothur > bin.seqs(fasta=amazon.fasta)
This command will generate 12 fasta-formatted files. Each file represents a different OTU. Within each file the sequences are sorted according to the OTU that they belong to. The sequence names have been modified to indicate its OTU grouping. For example, the file 98_sq_phylip_amazon.fn.0.10.fasta contains the following output:
>U68589|1 TAATACGTAGGGTGCAAGCGTTGCCCGGGTTTATTGGGCGTAAAGGGCGCGTAGGCG... >U68590|2 TAATACGGGGGGAGCAAGCGTTGTTCGGATTTACTGGGCGTAAAGGGCGCGTATGCG... >U68591|3 CGTAGGGTCCAAGCGTTATCCGGAATTACTGGGCGTAAAGAGTTGCGTAGGTGGCAT... >U68687|4 TAATACAGAGGTCCCAAGCGTTGTTCGGATTCACTGGGCGTAAAGGGTGCGTAGGTG... >U68592|4 TAATACAGAGGTCCCGAGCGTTGTTCGGATTCACTGGGCGTAAAGGGTGCGTAGGTG... >U68593|5 TAATACGTAAGGACCAAGCGTTGTTCGGATTTACTGGGCGTAAAGGGCGCGTANGCG... >U68594|6 TAATCCCAAGGGTGCAANCGTTACTCGGAATTACTGGGCGTAAAGCGTGCGTAGGTG... >U68636|7 TAATACAGAGGTCTCAAGCGTTGTTCGGATTCATTGGGCGTAAAGGGCGCGTAGGCG... >U68631|7 TAATACAGAGGTCTCAAGCGTTGTTCGGATTCATTGGGCGTAAAGGGCGCGTANGCG... ...
Here you can see that each sequence name has had a "|" and a number appended to it. The number indicates the OTU that the sequence belongs to.
A names file indicating sequence names that are identical to a references sequence, such as that used for the read.dist command, may be inputted to bin.seqs so that the fasta and list files are complementary. The following commands illustrate this:
mothur > read.dist(column=96_lt_column_amazon.dist, name=amazon.names, cutoff=0.10) mothur > cluster() mothur > bin.seqs(fasta=amazon.unique.fasta, name=amazon.names)
There may only be a couple of lines in your OTU data that you are interested in running through bin.seqs(). There are two options. You could: (i) manually delete the lines you aren't interested in from your list file; (ii) or use the label option. If you only want to read in the data for the lines labeled unique, 0.03, 0.05 and 0.10 you would enter:
mothur > bin.seqs(fasta=amazon.fasta, label=unique-0.03-0.05-0.10)