Bio::Community::Tools::RepresentativeIdConverter - Convert member ID to OTU representative ID or taxonomic ID


  use Bio::Community::Tools::RepresentativeIdConverter;

  my $converter = Bio::Community::Tools::Summarizer->new(
     -metacommunity => $meta,
     -cluster_file  => 'gg_99_otu_map.txt',
  my $meta_by_otu = $converter->get_converted_meta;


Given a metacommunity and an OTU cluster map file (or taxonomic assignment file), replace the ID of every member by that of its OTU cluster (or taxonomic) representative and add it in a new metacommunity.


Florent Angly


User feedback is an integral part of the evolution of this and other Bioperl modules. Please direct usage questions or support issues to the mailing list,, rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.

If you have found a bug, please report it on the BioPerl bug tracking system to help us keep track the bugs and their resolution:


Copyright 2011,2012,2013 by the BioPerl Team

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.


The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _


 Function: Create a new Bio::Community::Tool::RepresentativeIdConverter object
 Usage   : my $converter = Bio::Community::Tool::RepresentativeIdConverter->new(
              -metacommunity => $meta,
              -cluster_file  => '99_otu_map.txt',
           # or
           my $converter = Bio::Community::Tool::RepresentativeIdConverter->new(
              -metacommunity  => $meta,
              -taxassign_file => 'rep_set_tax_assignments.txt',
 Args    : -metacommunity  : See metacommunity().
           -cluster_file   : See cluster_file().
           -taxassign_file : See taxassign_file().
           Use either -cluster_file or -taxassign_file
 Returns : a Bio::Community::Tools::RepresentativeIdConverter object


 Function: Get/set communities, given as metacommunity, to summarize.
 Usage   : my $meta = $summarizer->metacommunity;
 Args    : A Bio::Community::Meta object
 Returns : A Bio::Community::Meta object


 Function: Get / set the tab-delimited file that defines the OTU clusters. The
           columns are: OTU ID, ID of the representative sequence, IDs of the
           other sequences in the OTU. For example:

               0        367523
               1        187144
               2        544886  544649
               3        310669
               4        355095  310677  347705  563209

           The OTU files distributed by Greengenes use this format (e.g.,
 Usage   : $summarizer->cluster_file('99_otu_map.txt');
 Args    : OTU cluster file name
 Returns : OTU cluster file name


 Function: Get / set the tab-delimited file that defines the OTU taxonomic
           assignemts. The first four columns (out of 12) should be: OTU ID,
           taxonomic string, E-value, taxonomic ID. For example:

           345     k__Bacteria; p__Actinobacteria; c__Actinobacteria; o__Actinomycetales; f__Propionibacteriaceae; g__Propionibacterium; s__acnes  5e-138  1042485 95.67   300     13      0       1       300     878     579
           346     k__Bacteria; p__Firmicutes; c__Bacilli; o__; f__; g__; s__      8e-134  1064834 99.59   245     1       0       1       245     909     665
           347     k__Bacteria; p__Proteobacteria; c__Gammaproteobacteria; o__Pseudomonadales; f__Pseudomonadaceae; g__Pseudomonas; s__    2e-103  959954  98.99   198     2       0       103     300     718     521

           The taxonomic assignment files generated by QIIME (rep_set_tax_assignments.txt)
           follow this format.
 Usage   : $summarizer->taxassign_file('rep_set_tax_assignments.txt');
 Args    : taxonomic assignment file name
 Returns : taxonomic assignment file name


 Function: Convert the communities and return the corresponding metacommunity.
 Usage   : my $meta_by_otu = $converter->get_converted_meta;
 Args    : None
 Returns : A Bio::Community::Meta object