tests/testthat/test_getvennlist.R

context("getvennlist work")
test_that("getvennlist work",{
	library(phyloseq)
	dir <- system.file("extdata", package="MicrobiotaProcess")
	otuda <- read.table(file.path(dir,"otu_tax_table.txt"),
						row.names=1, check.names=FALSE, skip=1,
						comment.char="", header=TRUE, sep="\t")
	otuda <- otuda[vapply(otuda,is.numeric,logical(1))]
	otuda <- data.frame(t(otuda))
	sampleda <- read.table(file.path(dir, "sample_info.txt"), 
						   header=TRUE, row.names=1)
	vennlist1 <- get_vennlist(obj=otuda, sampleinfo=sampleda, factorNames="group")
	testph <- import_qiime(file.path(dir,"otu_tax_table.txt"),
						   file.path(dir, "sample_info.txt")) 
	vennlist2 <- get_vennlist(testph, factorNames="group")
	expect_equal(vennlist1, vennlist2)
})

Try the MicrobiotaProcess package in your browser

Any scripts or data that you put into this service are public.

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.