mp_import_metaphlan {MicrobiotaProcess} | R 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 sungroup 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 ... linenum should be set to 3.
`...` | 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), 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

[Package MicrobiotaProcess version 1.4.4 Index]