load_edge_assignments {MetaComp} | R Documentation |
Efficiently loads a BWA (or other EDGE-like taxonomic assignment) tables from a list of files. Outputs a named list of assignments.
Description
Efficiently loads a BWA (or other EDGE-like taxonomic assignment) tables from a list of files. Outputs a named list of assignments.
Usage
load_edge_assignments(filepath, type)
Arguments
filepath |
the path to tab delimited, two-column file whose first column is a project_id (which will be used to name this assignment) and the second column is the assignment filename. |
type |
the type of assignments to be loaded. Following types are recognized: 'bwa', 'diamond', 'gottcha', 'gottcha2', 'kraken', 'metaphlan', and 'pangia'. |
Value
a list of all read assignments.
Examples
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 = load_edge_assignments(file.path(tempdir(), "assignments.txt"),
type = "gottcha2")
names(gottcha2_assignments)
table(gottcha2_assignments[[1]]$LEVEL)
[Package MetaComp version 1.1.2 Index]