Skip to content

Commit

Permalink
Add support for MetaPhlAn3 reports (fixes #75)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbreitwieser committed Apr 14, 2021
1 parent 8dd99bb commit cd2f217
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pavian
Type: Package
Title: Visualize and analyze metagenomics classification results
Version: 1.1.0
Version: 1.2.0
URL: https://github.com/fbreitwieser/pavian
BugReports: https://github.com/fbreitwieser/pavian/issues
Authors@R: person("Florian P", "Breitwieser", email = "[email protected]", role = c("aut", "cre"))
Expand Down
14 changes: 14 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pavian v1.1.0 (Release date: 2021-04-13)
==============

Changes:

* Add support of Kraken2-Uniq reports
* Add unit tests for read_report function

pavian v1.2.0 (Release date: 2021-04-14)
==============

Changes:

* Add support of Metaphlan3 reports
32 changes: 26 additions & 6 deletions R/datainput-read_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ read_report <- function(myfile, has_header=NULL, check_file = FALSE) {
if (is.null(has_header)) {
has_header <- grepl("^[a-zA-Z#%\"]",first.line)
}
is_metaphlan3_fmt <- grepl("^#mpa_v3", first.line)
is_metaphlan_fmt <- grepl("Metaphlan2_Analysis$", first.line)
is_krakenu_fmt <- grepl("^.?%\treads\ttaxReads\tkmers", first.line)
is_kaiju_fmt <- grepl("^ *%\t *reads", first.line)
Expand Down Expand Up @@ -438,6 +439,20 @@ read_report <- function(myfile, has_header=NULL, check_file = FALSE) {
tl_order <- order(report$taxLineage)
tl_order <- c(tl_order[length(tl_order)],tl_order[-length(tl_order)])
report <- report[tl_order, c("taxLineage", "taxonReads", "cladeReads")]
} else if (is_metaphlan3_fmt) {
report <- tryCatch({
## TODO: Having comment_char here causes a problem w/ Metaphlan report!!

utils::read.table(myfile,sep="\t",header = F,
quote = "",stringsAsFactors=FALSE,
comment.char = "#", nrows = nrows,
col.names = c("taxLineage", "taxID", "cladeReads", "additional_species"),
check.names=FALSE)
}, error = function(x) NULL, warning = function(x) NULL)
if (is.null(report)) { return(NULL); }

report$taxID <- sub(".*\\|", "", report$taxID)

} else if (has_header) {
report <- tryCatch({
## TODO: Having comment_char here causes a problem w/ Metaphlan report!!
Expand Down Expand Up @@ -484,17 +499,22 @@ read_report <- function(myfile, has_header=NULL, check_file = FALSE) {
dmessage(paste("Warning: File",myfile,"does not have the required format"))
return(NULL)
}
if (colnames(report)[2] == "Metaphlan2_Analysis") {
if (is_metaphlan_fmt || is_metaphlan3_fmt) {
## Metaphlan report
colnames(report) <- c("taxLineage", "cladeReads")
colnames(report)[1] <- "taxLineage"
colnames(report)[colnames(report) == "Metaphlan2_Analysis"] <- "cladeReads"
report <- report[order(report$taxLineage), ]
report$taxLineage <- gsub("_"," ",report$taxLineage)
report$taxLineage <- gsub(" ","_",report$taxLineage)
report$taxLineage <- paste0("-_root|", report$taxLineage)

report <- rbind(
data.frame(taxLineage=c("u_unclassified","-_root"),"cladeReads"=c(0,100), stringsAsFactors = F),
report)
root_lines <- data.frame(taxLineage=c("u_unclassified","-_root"),"cladeReads"=c(0,100), stringsAsFactors = F)

if ("taxID" %in% colnames(report)) {
root_lines <- cbind(root_lines, "taxID" = c(0, 1))
report <- report[, c("taxLineage", "cladeReads", "taxID")]
}

report <- rbind(root_lines, report)
}

if (all(c("name","taxRank") %in% colnames(report)) && !"taxLineage" %in% colnames(report)) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Pavian is a interactive browser application for analyzing and visualization metagenomics classification results from classifiers such as
Kraken, Centrifuge and MetaPhlAn. Pavian also provides an alignment viewer for validation of matches to a particular genome.
Kraken, KrakenUniq, Kraken 2, Centrifuge and MetaPhlAn. Pavian also provides an alignment viewer for validation of matches to a particular genome.

For more information look at the publication at https://doi.org/10.1093/bioinformatics/btz715

Expand Down
100 changes: 100 additions & 0 deletions tests/testthat/read_report/input/metaphlan2-report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#SampleID Metaphlan2_Analysis
k__Bacteria 100.0
k__Bacteria|p__Bacteroidetes 92.24896
k__Bacteria|p__Firmicutes 4.65876
k__Bacteria|p__Proteobacteria 2.8865
k__Bacteria|p__Verrucomicrobia 0.18438
k__Bacteria|p__Actinobacteria 0.0214
k__Bacteria|p__Bacteroidetes|c__Bacteroidia 92.24896
k__Bacteria|p__Firmicutes|c__Clostridia 4.47127
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria 2.84571
k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae 0.18438
k__Bacteria|p__Firmicutes|c__Negativicutes 0.12083
k__Bacteria|p__Firmicutes|c__Bacilli 0.04699
k__Bacteria|p__Proteobacteria|c__Gammaproteobacteria 0.04079
k__Bacteria|p__Actinobacteria|c__Actinobacteria 0.0214
k__Bacteria|p__Firmicutes|c__Erysipelotrichia 0.01967
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales 92.24896
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales 4.47127
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria|o__Burkholderiales 2.84571
k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae|o__Verrucomicrobiales 0.18438
k__Bacteria|p__Firmicutes|c__Negativicutes|o__Selenomonadales 0.12083
k__Bacteria|p__Firmicutes|c__Bacilli|o__Lactobacillales 0.04699
k__Bacteria|p__Proteobacteria|c__Gammaproteobacteria|o__Pasteurellales 0.04079
k__Bacteria|p__Actinobacteria|c__Actinobacteria|o__Coriobacteriales 0.0214
k__Bacteria|p__Firmicutes|c__Erysipelotrichia|o__Erysipelotrichales 0.01967
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae 52.87458
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Porphyromonadaceae 27.64625
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Rikenellaceae 11.39634
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Ruminococcaceae 2.2975
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria|o__Burkholderiales|f__Burkholderiales_noname 2.23639
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae 1.66251
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria|o__Burkholderiales|f__Sutterellaceae 0.60463
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Eubacteriaceae 0.34162
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidales_noname 0.32378
k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae|o__Verrucomicrobiales|f__Verrucomicrobiaceae 0.18438
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Oscillospiraceae 0.16531
k__Bacteria|p__Firmicutes|c__Negativicutes|o__Selenomonadales|f__Veillonellaceae 0.12083
k__Bacteria|p__Firmicutes|c__Bacilli|o__Lactobacillales|f__Streptococcaceae 0.04699
k__Bacteria|p__Proteobacteria|c__Gammaproteobacteria|o__Pasteurellales|f__Pasteurellaceae 0.04079
k__Bacteria|p__Actinobacteria|c__Actinobacteria|o__Coriobacteriales|f__Coriobacteriaceae 0.0214
k__Bacteria|p__Firmicutes|c__Erysipelotrichia|o__Erysipelotrichales|f__Erysipelotrichaceae 0.01967
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Prevotellaceae 0.00802
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria|o__Burkholderiales|f__Oxalobacteraceae 0.00469
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Clostridiaceae 0.00433
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides 52.87458
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Porphyromonadaceae|g__Parabacteroides 27.33306
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Rikenellaceae|g__Alistipes 11.39634
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria|o__Burkholderiales|f__Burkholderiales_noname|g__Burkholderiales_noname 2.23639
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Ruminococcaceae|g__Faecalibacterium 1.54101
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Roseburia 1.18685
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Ruminococcaceae|g__Subdoligranulum 0.73178
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria|o__Burkholderiales|f__Sutterellaceae|g__Parasutterella 0.60463
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Eubacteriaceae|g__Eubacterium 0.34162
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidales_noname|g__Bacteroidales_noname 0.32378
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Porphyromonadaceae|g__Odoribacter 0.31319
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Lachnospiraceae_noname 0.22849
k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae|o__Verrucomicrobiales|f__Verrucomicrobiaceae|g__Akkermansia 0.18438
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Oscillospiraceae|g__Oscillibacter 0.16531
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Coprococcus 0.15628
k__Bacteria|p__Firmicutes|c__Negativicutes|o__Selenomonadales|f__Veillonellaceae|g__Veillonella 0.07793
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Dorea 0.06518
k__Bacteria|p__Firmicutes|c__Bacilli|o__Lactobacillales|f__Streptococcaceae|g__Streptococcus 0.04699
k__Bacteria|p__Firmicutes|c__Negativicutes|o__Selenomonadales|f__Veillonellaceae|g__Dialister 0.04289
k__Bacteria|p__Proteobacteria|c__Gammaproteobacteria|o__Pasteurellales|f__Pasteurellaceae|g__Haemophilus 0.04079
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Blautia 0.02572
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Ruminococcaceae|g__Ruminococcus 0.02471
k__Bacteria|p__Actinobacteria|c__Actinobacteria|o__Coriobacteriales|f__Coriobacteriaceae|g__Slackia 0.0214
k__Bacteria|p__Firmicutes|c__Erysipelotrichia|o__Erysipelotrichales|f__Erysipelotrichaceae|g__Erysipelotrichaceae_noname 0.01193
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Prevotellaceae|g__Prevotella 0.00802
k__Bacteria|p__Firmicutes|c__Erysipelotrichia|o__Erysipelotrichales|f__Erysipelotrichaceae|g__Catenibacterium 0.00774
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria|o__Burkholderiales|f__Oxalobacteraceae|g__Oxalobacter 0.00469
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Clostridiaceae|g__Clostridiaceae_noname 0.00433
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides|s__Bacteroides_cellulosilyticus 28.19471
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Porphyromonadaceae|g__Parabacteroides|s__Parabacteroides_merdae 26.66884
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides|s__Bacteroides_ovatus 10.9491
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides|s__Bacteroides_caccae 8.77088
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides|s__Bacteroides_vulgatus 4.86029
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Rikenellaceae|g__Alistipes|s__Alistipes_shahii 4.6638
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Rikenellaceae|g__Alistipes|s__Alistipes_putredinis 3.42932
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Rikenellaceae|g__Alistipes|s__Alistipes_finegoldii 3.06599
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria|o__Burkholderiales|f__Burkholderiales_noname|g__Burkholderiales_noname|s__Burkholderiales_bacterium_1_1_47 2.23639
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Ruminococcaceae|g__Faecalibacterium|s__Faecalibacterium_prausnitzii 1.54101
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Roseburia|s__Roseburia_intestinalis 1.04235
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Ruminococcaceae|g__Subdoligranulum|s__Subdoligranulum_unclassified 0.73178
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Porphyromonadaceae|g__Parabacteroides|s__Parabacteroides_distasonis 0.66423
k__Bacteria|p__Proteobacteria|c__Betaproteobacteria|o__Burkholderiales|f__Sutterellaceae|g__Parasutterella|s__Parasutterella_excrementihominis 0.60463
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidales_noname|g__Bacteroidales_noname|s__Bacteroidales_bacterium_ph8 0.32378
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Porphyromonadaceae|g__Odoribacter|s__Odoribacter_splanchnicus 0.31319
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Lachnospiraceae_noname|s__Lachnospiraceae_bacterium_3_1_46FAA 0.22065
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Eubacteriaceae|g__Eubacterium|s__Eubacterium_rectale 0.19829
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Rikenellaceae|g__Alistipes|s__Alistipes_sp_AP11 0.18603
k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae|o__Verrucomicrobiales|f__Verrucomicrobiaceae|g__Akkermansia|s__Akkermansia_muciniphila 0.18438
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Oscillospiraceae|g__Oscillibacter|s__Oscillibacter_unclassified 0.16531
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Coprococcus|s__Coprococcus_sp_ART55_1 0.15628
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Roseburia|s__Roseburia_hominis 0.1445
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides|s__Bacteroides_fragilis 0.0994
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Eubacteriaceae|g__Eubacterium|s__Eubacterium_ventriosum 0.07343
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Rikenellaceae|g__Alistipes|s__Alistipes_indistinctus 0.05119
k__Bacteria|p__Firmicutes|c__Negativicutes|o__Selenomonadales|f__Veillonellaceae|g__Dialister|s__Dialister_invisus 0.04289
k__Bacteria|p__Firmicutes|c__Negativicutes|o__Selenomonadales|f__Veillonellaceae|g__Veillonella|s__Veillonella_unclassified 0.04243
32 changes: 32 additions & 0 deletions tests/testthat/read_report/input/metaphlan3-report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#mpa_v30_CHOCOPhlAn_201901
#metaphlan metaphlan.fastq.gz --input_type fastq --bowtie2out metaphlan_bowtie2.bz2 -o metaphlan.out
#SampleID Metaphlan_Analysis
#clade_name NCBI_tax_id relative_abundance additional_species
k__Bacteria 2 100.0
k__Bacteria|p__Firmicutes 2|1239 72.20451
k__Bacteria|p__Deferribacteres 2|200930 23.27657
k__Bacteria|p__Bacteroidetes 2|976 4.51892
k__Bacteria|p__Firmicutes|c__Clostridia 2|1239|186801 70.49728
k__Bacteria|p__Deferribacteres|c__Deferribacteres 2|200930|68337 23.27657
k__Bacteria|p__Bacteroidetes|c__Bacteroidia 2|976|200643 4.51892
k__Bacteria|p__Firmicutes|c__Firmicutes_unclassified 2|1239| 1.70723
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales 2|1239|186801|186802 70.49728
k__Bacteria|p__Deferribacteres|c__Deferribacteres|o__Deferribacterales 2|200930|68337|191393 23.27657
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales 2|976|200643|171549 4.51892
k__Bacteria|p__Firmicutes|c__Firmicutes_unclassified|o__Firmicutes_unclassified 2|1239|| 1.70723
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Clostridiaceae 2|1239|186801|186802|31979 51.80893
k__Bacteria|p__Deferribacteres|c__Deferribacteres|o__Deferribacterales|f__Deferribacteraceae 2|200930|68337|191393|191394 23.27657
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Eubacteriaceae 2|1239|186801|186802|186806 18.68835
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Tannerellaceae 2|976|200643|171549|2005525 4.51892
k__Bacteria|p__Firmicutes|c__Firmicutes_unclassified|o__Firmicutes_unclassified|f__Firmicutes_unclassified 2|1239||| 1.70723
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Clostridiaceae|g__Clostridium 2|1239|186801|186802|31979|1485 51.80893
k__Bacteria|p__Deferribacteres|c__Deferribacteres|o__Deferribacterales|f__Deferribacteraceae|g__Mucispirillum 2|200930|68337|191393|191394|248038 23.27657
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Eubacteriaceae|g__Eubacterium 2|1239|186801|186802|186806|1730 18.68835
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Tannerellaceae|g__Parabacteroides 2|976|200643|171549|2005525|375288 4.51892
k__Bacteria|p__Firmicutes|c__Firmicutes_unclassified|o__Firmicutes_unclassified|f__Firmicutes_unclassified|g__Firmicutes_unclassified 2|1239|||| 1.70723
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Clostridiaceae|g__Clostridium|s__Clostridium_sp_ASF502 2|1239|186801|186802|31979|1485|97139 37.0475
k__Bacteria|p__Deferribacteres|c__Deferribacteres|o__Deferribacterales|f__Deferribacteraceae|g__Mucispirillum|s__Mucispirillum_schaedleri 2|200930|68337|191393|191394|248038|248039 23.27657
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Eubacteriaceae|g__Eubacterium|s__Eubacterium_plexicaudatum 2|1239|186801|186802|186806|1730|97253 18.68835
k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Clostridiaceae|g__Clostridium|s__Clostridium_sp_ASF356 2|1239|186801|186802|31979|1485|97138 14.76143
k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Tannerellaceae|g__Parabacteroides|s__Parabacteroides_goldsteinii 2|976|200643|171549|2005525|375288|328812 4.51892 k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Tannerellaceae|g__Parabacteroides|s__Parabacteroides_sp_ASF519
k__Bacteria|p__Firmicutes|c__Firmicutes_unclassified|o__Firmicutes_unclassified|f__Firmicutes_unclassified|g__Firmicutes_unclassified|s__Firmicutes_bacterium_ASF500 2|1239|||||1378168 1.70723
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions tests/testthat/test-read_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ test_that("kraken2uniq input works", {
expect_equal(res, readRDS("read_report/ref_output/k2uniq-report-res.rds"))
})

test_that("metaphlan2 input works", {
res <- read_report("read_report/input/metaphlan2-report.txt")
if (write_ref_output)
saveRDS(res, "read_report/ref_output/metaphlan2-report-res.rds")

expect_equal(res, readRDS("read_report/ref_output/metaphlan2-report-res.rds"))
})


test_that("metaphlan3 input works", {
res <- read_report("read_report/input/metaphlan3-report.txt")
if (write_ref_output)
saveRDS(res, "read_report/ref_output/metaphlan3-report-res.rds")

expect_equal(res, readRDS("read_report/ref_output/metaphlan3-report-res.rds"))
})

0 comments on commit cd2f217

Please sign in to comment.