mp_import_metaphlan: Import function to load the output of MetaPhlAn.

View source: R/method-io.R

mp_import_metaphlanR Documentation

Import function to load the output of MetaPhlAn.

Description

Import function to load the output of MetaPhlAn.

Usage

mp_import_metaphlan(
  profile,
  mapfilename = NULL,
  treefile = NULL,
  linenum = NULL,
  ...
)

Arguments

profile

the output file (text format) of MetaPhlAn.

mapfilename

the sample information file or data.frame, default is NULL.

treefile

the path of MetaPhlAn tree file ( mpa_v30_CHOCOPhlAn_201901_species_tree.nwk), default is NULL.

linenum

a integer, sometimes the output file of MetaPhlAn ( < 3) contained the sample information in the first several lines. The linenum should be required. for example:

group A A A A B B B B
subgroup A1 A1 A2 A2 B1 B1 B2 B2
subject S1 S2 S3 S4 S5 S6 S7 S8
Bacteria 99 99 99 99 99 99 99 99
...

the linenum should be set to 3.

sampleid A1 A2 A3 A4 A5
Bacteria 99 99 99 99 99
...

The linenum should be set to 1.

...

additional parameters, meaningless now.

Details

When the output abundance of MetaPhlAn is relative abundance, the force of mp_cal_abundance should be set to TRUE, and the relative of mp_cal_abundance should be set to FALSE. Because the abundance profile will be rarefied in the default (force=FALSE), which requires the integer (count) abundance, then the relative abundance will be calculated in the default (relative=TRUE).

Author(s)

Shuangbin Xu

Examples

file1 <- system.file("extdata/MetaPhlAn", "metaphlan_test.txt", package="MicrobiotaProcess")
sample.file <- system.file("extdata/MetaPhlAn", "sample_test.txt", package="MicrobiotaProcess")
readLines(file1, n=3) %>% writeLines()
mpse1 <- mp_import_metaphlan(profile=file1, mapfilename=sample.file)
mpse1

YuLab-SMU/MicrobiotaProcess documentation built on Nov. 8, 2024, 4:37 p.m.