Learn R Programming

MetaComp (version 1.1.2)

merge_edge_assignments: Merges two or more EDGE-like taxonomical assignments. The input data frames are assumed to have the following columns: LEVEL, TAXA, and ABUNDANCE -- these will be used in the merge procedure, all other columns will be ignored.

Description

Merges two or more EDGE-like taxonomical assignments. The input data frames are assumed to have the following columns: LEVEL, TAXA, and ABUNDANCE -- these will be used in the merge procedure, all other columns will be ignored.

Usage

merge_edge_assignments(assignments)

Arguments

assignments

A named list of assignments (the list element's name will be used as a resulting data frame column name).

Value

A merged table, which is a data frame whose rows are taxonomical ids and columns are the input assignments ids.

Examples

Run this code
# NOT RUN {
hmp_even_fp <- system.file("extdata", "HMP_even", package="MetaComp")
hmp_stagger_fp <- system.file("extdata", "HMP_stagger", package="MetaComp")
data_files <- data.frame(V1 = c("HMP_even", "HMP_stagger"),
                         V2 = c(file.path(hmp_even_fp, "allReads-gottcha2-speDB-b.list.txt"),
                                file.path(hmp_stagger_fp, "allReads-gottcha2-speDB-b.list.txt")))
write.table(data_files, file.path(tempdir(), "assignments.txt"),
                                                 row.names = FALSE, col.names = FALSE)
gottcha2_assignments = merge_edge_assignments(
                         load_edge_assignments(
                           file.path(tempdir(), "assignments.txt"), type = "gottcha2"))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab