inst/tests/test-manifest.R

context("manifest importing and listing suite")

test_that("list_illumina_manifest_files works", {
	res <- list_illumina_manifest_files(all=FALSE, verbose=FALSE)
	expected.res <- c("HumanHT-12_V3_0_R2_11283641_A", "HumanHT-12_V3_0_R3_11283641_A", 
	"HumanHT-12_V4_0_R1_15002873_B", "HumanHT-12_V4_0_R2_15002873_B", 
	"HumanHT-12_V4_0_R2_15002873_B_WGDASL", "HumanMI_V1_R2_XS0000122-MAP", 
	"HumanMI_V2_R0_XS0000124-MAP", "HumanRef-8_V2_0_R4_11223162_A", 
	"HUMANREF-8_V3_0_R1_11282963_A_WGDASL", "HumanRef-8_V3_0_R2_11282963_A", 
	"HumanRef-8_V3_0_R3_11282963_A", "HumanWG-6_V2_0_R4_11223189_A", 
	"HumanWG-6_V3_0_R2_11282955_A", "HumanWG-6_V3_0_R3_11282955_A", 
	"MouseMI_V1_R2_XS0000127-MAP", "MouseMI_V2_R0_XS0000129-MAP", 
	"MouseRef-8_V1_1_R4_11234312_A", "MouseRef-8_V2_0_R2_11278551_A", 
	"MouseRef-8_V2_0_R3_11278551_A", "MouseWG-6_V1_1_R4_11234304_A", 
	"MouseWG-6_V2_0_R2_11278593_A", "MouseWG-6_V2_0_R3_11278593_A", 
	"RatRef-12_V1_0_R5_11222119_A")
	expect_identical(res, expected.res)
	
	res <- list_illumina_manifest_files(all=TRUE, verbose=FALSE)
	expected.res <- c("HumanHT-12_V3_0_R1_11283641_A", "HumanHT-12_V3_0_R2_11283641_A", 
	"HumanHT-12_V3_0_R3_11283641_A", "HumanHT-12_V4_0_R1_15002873_B", 
	"HumanHT-12_V4_0_R2_15002873_B", "HumanHT-12_V4_0_R2_15002873_B_WGDASL", 
	"HumanMI_V1_R2_XS0000122-MAP", "HumanMI_V2_R0_XS0000124-MAP", 
	"HumanRef-8_V2_0_R2_11223162_A", "HumanRef-8_V2_0_R3_11223162_A", 
	"HumanRef-8_V2_0_R4_11223162_A", "HumanRef-8_V3_0_R0_11282963_A", 
	"HumanRef-8_V3_0_R0_11282963_A_WGDASL", "HumanRef-8_V3_0_R1_11282963_A", 
	"HUMANREF-8_V3_0_R1_11282963_A_WGDASL", "HumanRef-8_V3_0_R2_11282963_A", 
	"HumanRef-8_V3_0_R3_11282963_A", "HumanWG-6_V2_0_R2_11223189_A", 
	"HumanWG-6_V2_0_R3_11223189_A", "HumanWG-6_V2_0_R4_11223189_A", 
	"HumanWG-6_V3_0_R0_11282955_A", "HumanWG-6_V3_0_R1_11282955_A", 
	"HumanWG-6_V3_0_R2_11282955_A", "HumanWG-6_V3_0_R3_11282955_A", 
	"MouseMI_V1_R2_XS0000127-MAP", "MouseMI_V2_R0_XS0000129-MAP", 
	"MouseRef-8_V1_1_R2_11234312_A", "MouseRef-8_V1_1_R3_11234312_A", 
	"MouseRef-8_V1_1_R4_11234312_A", "MouseRef-8_V2_0_R0_11278551_A", 
	"MouseRef-8_V2_0_R1_11278551_A", "MouseRef-8_V2_0_R2_11278551_A", 
	"MouseRef-8_V2_0_R3_11278551_A", "MouseWG-6_V1_1_R2_11234304_A", 
	"MouseWG-6_V1_1_R3_11234304_A", "MouseWG-6_V1_1_R4_11234304_A", 
	"MouseWG-6_V2_0_R0_11278593_A", "MouseWG-6_V2_0_R1_11278593_A", 
	"MouseWG-6_V2_0_R2_11278593_A", "MouseWG-6_V2_0_R3_11278593_A", 
	"RatRef-12_V1_0_R2_11222119_A", "RatRef-12_V1_0_R3_11222119_A", 
	"RatRef-12_V1_0_R5_11222119_A")
	expect_identical(res, expected.res)
})

test_that(".parse_illumina_manifest_html works", {
	res <- .parse_illumina_manifest_html(verbose=FALSE)
	expected.res <- structure(list(Name = c("HumanHT-12_V3_0_R1_11283641_A", "HumanHT-12_V3_0_R2_11283641_A", 
	"HumanHT-12_V3_0_R3_11283641_A", "HumanHT-12_V4_0_R1_15002873_B", 
	"HumanHT-12_V4_0_R2_15002873_B", "HumanHT-12_V4_0_R2_15002873_B_WGDASL", 
	"HumanMI_V1_R2_XS0000122-MAP", "HumanMI_V2_R0_XS0000124-MAP", 
	"HumanRef-8_V2_0_R2_11223162_A", "HumanRef-8_V2_0_R3_11223162_A", 
	"HumanRef-8_V2_0_R4_11223162_A", "HumanRef-8_V3_0_R0_11282963_A", 
	"HumanRef-8_V3_0_R0_11282963_A_WGDASL", "HumanRef-8_V3_0_R1_11282963_A", 
	"HUMANREF-8_V3_0_R1_11282963_A_WGDASL", "HumanRef-8_V3_0_R2_11282963_A", 
	"HumanRef-8_V3_0_R3_11282963_A", "HumanWG-6_V2_0_R2_11223189_A", 
	"HumanWG-6_V2_0_R3_11223189_A", "HumanWG-6_V2_0_R4_11223189_A", 
	"HumanWG-6_V3_0_R0_11282955_A", "HumanWG-6_V3_0_R1_11282955_A", 
	"HumanWG-6_V3_0_R2_11282955_A", "HumanWG-6_V3_0_R3_11282955_A", 
	"MouseMI_V1_R2_XS0000127-MAP", "MouseMI_V2_R0_XS0000129-MAP", 
	"MouseRef-8_V1_1_R2_11234312_A", "MouseRef-8_V1_1_R3_11234312_A", 
	"MouseRef-8_V1_1_R4_11234312_A", "MouseRef-8_V2_0_R0_11278551_A", 
	"MouseRef-8_V2_0_R1_11278551_A", "MouseRef-8_V2_0_R2_11278551_A", 
	"MouseRef-8_V2_0_R3_11278551_A", "MouseWG-6_V1_1_R2_11234304_A", 
	"MouseWG-6_V1_1_R3_11234304_A", "MouseWG-6_V1_1_R4_11234304_A", 
	"MouseWG-6_V2_0_R0_11278593_A", "MouseWG-6_V2_0_R1_11278593_A", 
	"MouseWG-6_V2_0_R2_11278593_A", "MouseWG-6_V2_0_R3_11278593_A", 
	"RatRef-12_V1_0_R2_11222119_A", "RatRef-12_V1_0_R3_11222119_A", 
	"RatRef-12_V1_0_R5_11222119_A"), BGX = c("http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V3_0_R1_11283641_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V3_0_R2_11283641_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V3_0_R3_11283641_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V4_0_R1_15002873_B.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V4_0_R2_15002873_B.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V4_0_R2_15002873_B_WGDASL.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/humanMI_V1_R2_XS0000122-MAP.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/humanMI_V2_R0_XS0000124-MAP.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V2_0_R2_11223162_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V2_0_R3_11223162_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V2_0_R4_11223162_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V3_0_R0_11282963_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HUMANREF-8_V3_0_R0_11282963_A_WGDASL.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V3_0_R1_11282963_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HUMANREF-8_V3_0_R1_11282963_A_WGDASL.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V3_0_R2_11282963_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V3_0_R3_11282963_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V2_0_R2_11223189_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V2_0_R3_11223189_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V2_0_R4_11223189_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V3_0_R0_11282955_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V3_0_R1_11282955_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V3_0_R2_11282955_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V3_0_R3_11282955_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/mouseMI_V1_R2_XS0000127-MAP.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/mouseMI_V2_R0_XS0000129-MAP.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V1_1_R2_11234312_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V1_1_R3_11234312_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V1_1_R4_11234312_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V2_0_R0_11278551_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V2_0_R1_11278551_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V2_0_R2_11278551_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V2_0_R3_11278551_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V1_1_R2_11234304_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V1_1_R3_11234304_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V1_1_R4_11234304_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V2_0_R0_11278593_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V2_0_R1_11278593_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V2_0_R2_11278593_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V2_0_R3_11278593_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Rat/RatRef-12_V1_0_R2_11222119_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Rat/RatRef-12_V1_0_R3_11222119_A.bgx.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Rat/RatRef-12_V1_0_R5_11222119_A.zip"
	), TXT = c("http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V3_0_R1_11283641_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V3_0_R2_11283641_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V3_0_R3_11283641_A-text.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V4_0_R1_15002873_B.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V4_0_R2_15002873_B.txt.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanHT-12_V4_0_R2_15002873_B_WGDASL.txt.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanMI_V1_R2_XS0000122-MAP.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/humanMI_V2_R0_XS0000124-MAP.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V2_0_R2_11223162_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V2_0_R3_11223162_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V2_0_R4_11223162_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V3_0_R0_11282963_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HUMANREF-8_V3_0_R0_11282963_A_Control_Graphs.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V3_0_R1_11282963_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HUMANREF-8_V3_0_R1_11282963_A_WGDASL.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V3_0_R2_11282963_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanRef-8_V3_0_R3_11282963_A-text.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V2_0_R2_11223189_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V2_0_R3_11223189_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V2_0_R4_11223189_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V3_0_R0_11282955_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V3_0_R1_11282955_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V3_0_R2_11282955_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Human/HumanWG-6_V3_0_R3_11282955_A-text.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/mouseMI_V1_R2_XS0000127-MAP.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/mouseMI_V2_R0_XS0000129-MAP.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V1_1_R2_11234312_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V1_1_R3_11234312_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V1_1_R4_11234312_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V2_0_R0_11278551_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V2_0_R1_11278551_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V2_0_R2_11278551_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseRef-8_V2_0_R3_11278551_A-text.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V1_1_R2_11234304_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V1_1_R3_11234304_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V1_1_R4_11234304_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V2_0_R0_11278593_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V2_0_R1_11278593_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V2_0_R2_11278593_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Mouse/MouseWG-6_V2_0_R3_11278593_A-text.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Rat/RatRef-12_V1_0_R2_11222119_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Rat/RatRef-12_V1_0_R3_11222119_A.zip", 
	"http://www.switchtoi.com/pdf/Annotation%20Files/Rat/RatRef-12_V1_0_R5_11222119_A-text.zip"
	), current = c(FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, 
	FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, 
	FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, 
	TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, 
	TRUE, TRUE, FALSE, FALSE, TRUE)), .Names = c("Name", "BGX", "TXT", 
	"current"), row.names = c(NA, 43L), class = "data.frame")
	expect_identical(res, expected.res)
	
})

test_that("download_illumina_manifest_file works", {
	dir <- tempdir()
	# res <- download_illumina_manifest_file("HumanHT-12_V4_0_R2_15002873_B", type="txt", dir=dir, verbose=FALSE)
	# expected.res <- file.path(dir, "HumanHT-12_V4_0_R2_15002873_B.txt")
	# expect_identical(res, expected.res)
	# expect_equal(file.exists(res), TRUE)
	
	expect_error(download_illumina_manifest_file("HumanHT-12_V4_0_R2_15002873_B", type="garbage", dir=dir))
	expect_error(download_illumina_manifest_file("garbage", type="txt", dir=dir))
})
drmjc/lumidat documentation built on May 15, 2019, 2:23 p.m.