Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tidy_taxonomy

Clean up the taxonomic table to make taxonomic assignments consistent.


Description

Clean up the taxonomic table to make taxonomic assignments consistent.

Usage

tidy_taxonomy(
  taxonomy_table,
  column = "all",
  pattern = c(".*uncultur.*", ".*unknown.*", ".*unidentif.*", ".*unclassified.*",
    ".*No blast hit.*", ".*sp\\.$", ".*metagenome.*", ".*cultivar.*", ".*archaeon$",
    "__synthetic.*", ".*\\sbacterium$", ".*bacterium\\s.*"),
  replacement = "",
  ignore.case = TRUE,
  na_fill = ""
)

Arguments

taxonomy_table

a data.frame with taxonomic information.

column

default "all"; "all" or a number; 'all' represents cleaning up all the columns; a number represents cleaning up this column.

pattern

default see the function parameter; the characters (regular expression) to be cleaned up or replaced; cleaned up when parameter replacement = "", replaced when parameter replacement has something; Note that the capital and small letters are not distinguished.

replacement

default ""; the characters used to replace the character in pattern parameter.

ignore.case

default TRUE; if FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching.

na_fill

default ""; used to replace the NA.

Format

data.frame object.

Value

taxonomic table.

Examples

data("taxonomy_table_16S")
tidy_taxonomy(taxonomy_table_16S)

microeco

Microbial Community Ecology Data Analysis

v0.10.0
GPL-3
Authors
Chi Liu [aut, cre], Felipe R. P. Mansoldo [ctb], Umer Zeeshan Ijaz [ctb], Chenhao Li [ctb], Yang Cao [ctb], Minjie Yao [ctb], Xiangzhen Li [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.