mpa2meco: Transform metagenomic classification results of 'mpa' format...

Description Usage Arguments Value Examples

View source: R/mpa2meco.R

Description

Transform the classification results of mpa (MetaPhlAn) format to microtable object, such as MetaPhlAn and Kraken2 results. Kraken2 results can be obtained by merge_metaphlan_tables.py from MetaPhlAn or combine_mpa.py from KrakenTools (https://ccb.jhu.edu/software/krakentools/).

Usage

1
mpa2meco(abund_table, sample_data = NULL, match_table = NULL)

Arguments

abund_table

'mpa' format abundance table, see the example.

sample_data

default NULL; the sample metadata table, must be tab or comma seperated file, generally, a file with suffix "tsv" or "csv"..

match_table

default NULL; a two column table used to replace the sample names in 'HUMAnN abundance result; Remember just two columns with no column names; The first column must be sample names used in abund_table, the second column is the new sample names, e.g. the rownames in sample_table. See the example files.

Value

microtable object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# use the raw data files stored inside the package
abund_file_path <- system.file("extdata", "example_kraken2_merge.txt", package="file2meco")
sample_file_path <- system.file("extdata", "example_metagenome_sample_info.tsv", 
  package="file2meco")
match_file_path <- system.file("extdata", "example_metagenome_match_table.tsv", package="file2meco")
library(microeco)
library(file2meco)
library(magrittr)
mpa2meco(abund_table = abund_file_path)
test <- mpa2meco(abund_table = abund_file_path, sample_data = sample_file_path, 
  match_table = match_file_path)
# make the taxonomy standard for the following analysis
test$tax_table %<>% tidy_taxonomy
test$tidy_dataset()

file2meco documentation built on Jan. 6, 2022, 5:06 p.m.