tests/test_parse_sequence_string.R

parse_sequence_string <- seguid:::parse_sequence_string


spec <- "TATGCC\nATACGG"
truth <- list(type = "ds", specification = spec, watson = "TATGCC", crick = "GGCATA")
res <- parse_sequence_string(spec)
str(res)
stopifnot(all.equal(res, truth))

spec <- "-TATGCC\nCATACG-"
truth <- list(type = "ds", specification = spec, watson = "-TATGCC", crick = "-GCATAC")
res <- parse_sequence_string(spec)
str(res)
stopifnot(all.equal(res, truth))

spec <- "TATGCC--\n-TACGGGG"
truth <- list(type = "ds", specification = spec, watson = "TATGCC--", crick = "GGGGCAT-")
res <- parse_sequence_string(spec)
str(res)
stopifnot(all.equal(res, truth))

spec <- "TATGCC--\n--ACGGGG"
truth <- list(type = "ds", specification = spec, watson = "TATGCC--", crick = "GGGGCA--")
res <- parse_sequence_string(spec)
str(res)
stopifnot(all.equal(res, truth))


spec <- "- TGCC\nATACGG"
res <- tryCatch({
  parse_sequence_string(spec)
}, error = identity)
print(res)
stopifnot(inherits(res, "error"))

spec <- " -TGCC\nATACGG"
res <- tryCatch({
  parse_sequence_string(spec)
}, error = identity)
print(res)
stopifnot(inherits(res, "error"))

spec <- "---TGCC\nATACGG"
res <- tryCatch({
  parse_sequence_string(spec)
}, error = identity)
print(res)
stopifnot(inherits(res, "error"))

spec <- "---TGCC\n-ATACGG"
res <- tryCatch({
  parse_sequence_string(spec)
}, error = identity)
print(res)
stopifnot(inherits(res, "error"))

spec <- "TATGCC-\nATACGG-"
res <- tryCatch({
  parse_sequence_string(spec)
}, error = identity)
print(res)
stopifnot(inherits(res, "error"))

Try the seguid package in your browser

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

seguid documentation built on May 29, 2024, 12:33 p.m.