Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

acnucopen

open and close a remote access to an ACNUC database


Description

These are low level functions to start and stop a remote access to an ACNUC database.

Usage

acnucopen(db, socket, challenge = NA)
acnucclose(socket)
clientid(id = paste("seqinr_",
 packageDescription("seqinr")$Version, sep = ""),
 socket, verbose = FALSE)
quitacnuc(socket)

Arguments

db

the remote ACNUC database name

socket

an object of class sockconn connecting to an ACNUC server

challenge

unimplemented yet

id

client ID definition defaulting to seqinr + package version number

verbose

logical, if TRUE mode verbose is on

Details

these low level functions are usually not used directly by the user. Use choosebank to open a remote ACNUC database and closebank to close it.

Value

For openacnuc a list with the following components: type : the type of database that was opened. totseqs, totspec, totkey : total number of seqs, species, keywords in opened database. ACC\_LENGTH, L\_MNEMO, WIDTH\_KW, WIDTH\_SP, WIDTH\_SMJ, WIDTH\_AUT, WIDTH\_BIB, lrtxt, SUBINLNG: max lengths of record keys in database.

Author(s)

J.R. Lobry

References

citation("seqinr")

See Also

Examples

## Not run: # Need internet connection
  mysocket <- socketConnection( host = "pbil.univ-lyon1.fr", 
    port = 5558, server = FALSE, blocking = TRUE)
  readLines(mysocket, n = 1) # OK acnuc socket started
  acnucopen("emblTP", socket = mysocket) -> res
  expected <- c("EMBL", "14138095", "236401", "1186228", "8", 
    "16", "40", "40", "20", "20", "40", "60", "504")
  stopifnot(all(unlist(res) == expected))
  tryalreadyopen <- try(acnucopen("emblTP", socket = mysocket))
  stopifnot(inherits(tryalreadyopen, "try-error"))
  # Need a fresh socket because acnucopen() close it if error:
  mysocket <- socketConnection( host = "pbil.univ-lyon1.fr", 
    port = 5558, server = FALSE, blocking = TRUE)
  tryoff <-  try(acnucopen("off", socket = mysocket))
  stopifnot(inherits(tryoff, "try-error"))

  mysocket <- socketConnection( host = "pbil.univ-lyon1.fr", 
    port = 5558, server = FALSE, blocking = TRUE)
  tryinexistent <-  try(acnucopen("tagadatagadatsointsoin", socket = mysocket))
  stopifnot(inherits(tryinexistent, "try-error"))

  mysocket <- socketConnection( host = "pbil.univ-lyon1.fr", 
    port = 5558, server = FALSE, blocking = TRUE)
  trycloseunopened <- try(acnucclose(mysocket))
  stopifnot(inherits(trycloseunopened, "try-error"))

 
## End(Not run)

seqinr

Biological Sequences Retrieval and Analysis

v4.2-16
GPL (>= 2)
Authors
Delphine Charif [aut], Olivier Clerc [ctb], Carolin Frank [ctb], Jean R. Lobry [aut, cph], Anamaria Necşulea [ctb], Leonor Palmeira [ctb], Simon Penel [cre], Guy Perrière [ctb]
Initial release
2022-05-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.