File: acnucopen.Rd

package info (click to toggle)
r-cran-seqinr 3.4-5-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,876 kB
  • sloc: ansic: 1,987; makefile: 14
file content (79 lines) | stat: -rw-r--r-- 2,702 bytes parent folder | download | duplicates (4)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
\name{acnucopen}
\alias{acnucopen}
\alias{acnucclose}
\alias{clientid}
\alias{quitacnuc}
\title{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{
  \item{db}{the remote ACNUC database name}
  \item{socket}{an object of class \code{sockconn} connecting to an ACNUC server}
  \item{challenge}{unimplemented yet}
  \item{id}{client ID definition defaulting to seqinr + package version number}
  \item{verbose}{logical, if TRUE mode verbose is on}
}

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

\value{
For \code{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.

}
\references{ 
\code{citation("seqinr")}
}
\author{J.R. Lobry}
\seealso{
  \code{\link{choosebank}}, \code{\link{closebank}}
}

\examples{
 \dontrun{# 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"))

 }
}
\keyword{utilities}