Skip to contents

Convert taxonomy strings into dataframe of labels based on taxonomic classification

Usage

parse_tax(dat)

Arguments

dat

dataframe from mothur taxonomy file with columns OTU, Size, and Taxonomy

Value

a wide dataframe with taxonomic labels

Author

Nick Lesniak, nlesniak@umich.edu

Examples

taxonomy_filepath <- system.file("extdata",
  "test.taxonomy",
  package = "schtools"
)
taxonomy_tbl <- read_tax(taxonomy_filepath)
head(taxonomy_tbl)
#> # A tibble: 6 × 10
#>   otu      otu_label tax_otu_l…¹ label…² kingdom phylum class order family genus
#>   <chr>    <chr>     <chr>       <chr>   <chr>   <chr>  <chr> <chr> <chr>  <chr>
#> 1 Otu0001  OTU 1     Bacteroide… <i>Bac… Bacter… Bacte… Bact… Bact… Bacte… Bact…
#> 2 Otu0003  OTU 3     Porphyromo… <i>Por… Bacter… Bacte… Bact… Bact… Porph… Porp…
#> 3 Otu0004  OTU 4     Porphyromo… <i>Por… Bacter… Bacte… Bact… Bact… Porph… Porp…
#> 4 Otu00008 OTU 8     Enterobact… <i>Ent… Bacter… Prote… Gamm… Ente… Enter… Ente…
#> 5 Otu0044  OTU 44    Bacteria (… <i>Bac… Bacter… Bacte… Bact… Bact… Bacte… Bact…
#> 6 Otu0056  OTU 56    Bacteria (… <i>Bac… Bacter… Bacte… Bact… Bact… Bacte… Bact…
#> # … with abbreviated variable names ¹​tax_otu_label, ²​label_html