/usr/lib/R/site-library/ShortRead/unitTests/test_writeFastq.R is in r-bioc-shortread 1.36.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | sp <- SolexaPath(system.file("extdata", package="ShortRead"))
test_writeFastq_roundtrip <- function()
{
## potential coercion from '.' to 'N'
rfq <- readFastq(analysisPath(sp), pattern="s_1_sequence.txt")
file <- tempfile()
writeFastq(rfq, file)
fq <- readFastq(dirname(file), basename(file))
checkIdentical(as.character(id(fq)), as.character(id(rfq)))
checkIdentical(as.character(sread(fq)), as.character(sread(rfq)))
checkIdentical(as.character(quality(quality(fq))),
as.character(quality(quality(rfq))))
}
test_writeFastq_writeError <- function()
{
object <- readFastq(analysisPath(sp), pattern="s_1_sequence.txt")
file <- tempfile()
mode <- "w"
max_width <- 10L
.write_fastq <- ShortRead:::.write_fastq
checkException(.Call(.write_fastq, id(object), sread(object),
quality(quality(object)), file, mode,
max_width),
silent=TRUE)
}
test_writeFastq_roundtrip0length <- function()
{
dest <- tempfile()
file.create(dest)
exp <- readFastq(dest)
writeFastq(exp, dest <- tempfile())
checkIdentical(exp, readFastq(dest))
}
|