read_ko calculates the abundance of each KO within the bins based on the KofamScan or KofamKoala output.

read_ko(data_kofam=NULL, data_kaas=NULL, data_interpro=NULL, 
write=FALSE)

Arguments

data_kofam

a path where KofamScan/KofamKoala output data are. They should have the extension .txt and all files in the path are the ones that need to be read. Output data should have 5 columns with the bin names followed by the scaffold name divided by a '-' or '_': bin_scaffoldXX.

data_kaas

a data frame with 2 columns. Contigs are expected to indicate in their names the bin name followed by the scaffold name divided by a '-' or '_': bin_scaffoldXX.

data_interpro

a data frame output of read_interpro. This argument is used within mapping_ko.

write

a logical value indicating to save the data imported as a formatted table with .tsv extension with a time stamp and it will be located in your current working directory

Details

This function is part of a package used for the analysis of bins metabolism.

Examples

kofam_dir <- system.file("extdata", package = "rbims")
read_ko(data_kofam = kofam_dir, write = FALSE)
#> # A tibble: 1,800 × 4
#>    Scaffold_name             Bin_name KO     Abundance
#>    <chr>                     <chr>    <chr>      <int>
#>  1 Bin_10_scaffold_10_c1_10  Bin_10   K09800         1
#>  2 Bin_10_scaffold_10_c1_100 Bin_10   K01126         2
#>  3 Bin_10_scaffold_10_c1_103 Bin_10   K00616         1
#>  4 Bin_10_scaffold_10_c1_104 Bin_10   K05539         1
#>  5 Bin_10_scaffold_10_c1_107 Bin_10   K13936         1
#>  6 Bin_10_scaffold_10_c1_109 Bin_10   K01885         1
#>  7 Bin_10_scaffold_10_c1_11  Bin_10   K09807         1
#>  8 Bin_10_scaffold_10_c1_110 Bin_10   K01737         2
#>  9 Bin_10_scaffold_10_c1_111 Bin_10   K07141         1
#> 10 Bin_10_scaffold_10_c1_116 Bin_10   K06972         1
#> # ℹ 1,790 more rows